Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1792197ybn; Thu, 26 Sep 2019 02:14:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaSvxsmHtOGSVgali1ESFNOjEBIatOTkIeDq9PJwIs3pgMTVGpsMbZRWay9+IJwuHAUhad X-Received: by 2002:a17:906:c72d:: with SMTP id fj13mr2200032ejb.36.1569489265541; Thu, 26 Sep 2019 02:14:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569489265; cv=pass; d=google.com; s=arc-20160816; b=NXNW10hC6gDWvedhrkWh5R8NZvIM5x6txWYR6P49rYHFznGeX7teQfd7UEfd1q/o/D OzcQg++SsB3xQ50B9T8QGHV25JkjrJnFz/sYYzA4hdbZjIufxTTef3SxCrozXASsLgUT wvEBruMOaMZTid/BpBXJDx5oEzVM4CHxs/U1HH+Fbqo//sVg9CmXGnrNiLqvdgLWJdSZ GR2++wHz25gWJPgVpb7sgyQCiXRE3PGtUo2SxA9W2Pe1+Ii2DZ/zxR2V0t7alajPfDRo q4nQUF42xIyo8kt2afctwDW8RIScxQmaFGFcn7z7BW7L5lgmLYSUCgrdMTRKX53izOoB Sl5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=CHTPzzG7WzqlJwzrN3HLPQL8iM9flXqwyeBFy88xZls=; b=dPQtUDkSN7CGoD4HvWPzRHJmQ3FaYnd5soe5pf+kfsS7f2LWxGVSgBQxIHZsRPeKwP eJuOBktYrRBu+XQsci11QlfZkgtuZFuibgx238Iu3/5/w+G69WWYzzbPBLeNzJgRaLZZ nOGagHmuHXRuz3E0CKw2ZDFJ66FIe9D+ltpizuhjXQGLYDL7nZ0Pau6e6ZwgLT4b/Stn 0MZtdKcPUWHlwYYuYyfvaSdsDeU6q5rcA1M0FTYYr1o9IqK1cHqCZx/IgOigdy7LRh7m Ip5QOmNDlNmBiXgsx+YBnOUQ2RPGzT7nWqPLXaj4wT0AkttJTMtpLNddaBP/KhXMAia9 FMjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b="id5zm/MF"; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rh27si646715ejb.52.2019.09.26.02.14.00; Thu, 26 Sep 2019 02:14:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b="id5zm/MF"; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633944AbfIYEcJ (ORCPT + 99 others); Wed, 25 Sep 2019 00:32:09 -0400 Received: from mail-eopbgr810131.outbound.protection.outlook.com ([40.107.81.131]:26942 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2633937AbfIYEcI (ORCPT ); Wed, 25 Sep 2019 00:32:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVx2mwyyRq+6cMIlExcrThqd76RxMwcBUfCl4jHDVu4Xh8fLE0u53llCdOQkwkCXHH40dHY4LHJBxj5aVioB/DQwt18xHo8rbGoC5JJvKOlsudtMJQbbR988vfFAHpoGDfMgwM8uH8JOwfcGsUTIV7H1cz1c//zgpE0Su1YHeEIx9EBF9H9ryCu5P8SlK65NeZSuvkq/1E6Kaqd7gckNb2C/sfwXtd39K+zbuAJIP7C9MjF5x4FHX5D0ee9KmCdssuSbdbGYGj26JPCSE5rj1/qJN6G2iaR3x0YE8buXdD+bbbuiVUD+rfkLwkyTkh2grkbqxvDs1wYtTDr83a/94w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CHTPzzG7WzqlJwzrN3HLPQL8iM9flXqwyeBFy88xZls=; b=KrXo0B0F4LSUJ0BAqYCwAz8o5eSZvY5B9NJFMEp4/1leYMWh4nJS0jJUCuLkG3Z7lxu64ocgBtCNf+HLKGCiheYmsb08+IXZN0seUyy+sZSDAeU78BvvP5WWxiW/V4zPQgv/oKBo3QwlA/IUwvuwvFAJYHPQK3/1l5zEiUSULVj4hF+BKo7f5RE0VKzVtfyJCuBe5XzzvELmUlRUwXsMrZdp5ew+p0sREZ8KvW//rqwcpppglkHg0yDj6ow5rkgI4fN5mYqPTk0q2YhL0oVSLJ/IRAk5feF6A4Z3WpdKx6NqRSlmxgOt0PV+VjHYEjp+XrSKendOayN0e2F0l2QKIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CHTPzzG7WzqlJwzrN3HLPQL8iM9flXqwyeBFy88xZls=; b=id5zm/MFqZlreQF/MixseV64vVgrE/Ou75LNOpKk2v1tISMIoHDuSvqzmq8zObknYMTDLr5iVA5ZMCdUHaahoasmNp/E6GwCnFAJGsm8q4He1hLuKhYokbBCZ24LXSYpoRzJ9F987YamzLTOtUqr409G9zoXv4AH//205UHWHSU= Received: from MN2PR04MB5886.namprd04.prod.outlook.com (20.179.22.213) by MN2PR04MB5712.namprd04.prod.outlook.com (20.179.21.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Wed, 25 Sep 2019 04:16:56 +0000 Received: from MN2PR04MB5886.namprd04.prod.outlook.com ([fe80::8520:f80f:ae9:63cd]) by MN2PR04MB5886.namprd04.prod.outlook.com ([fe80::8520:f80f:ae9:63cd%6]) with mapi id 15.20.2284.023; Wed, 25 Sep 2019 04:16:56 +0000 From: Xin Ji To: Dan Carpenter CC: "devel@driverdev.osuosl.org" , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Sheng Pan Subject: Re: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver Thread-Topic: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver Thread-Index: AQHVb3m3O6Kkudc69k2BA5rT6xVhEKc5UIWAgAKAn4A= Date: Wed, 25 Sep 2019 04:16:56 +0000 Message-ID: <20190925041647.GA3388@xin-VirtualBox> References: <02319a7db948900efe0f945b684221ac076bac48.1568957789.git.xji@analogixsemi.com> <20190923140355.GH2959@kadam> In-Reply-To: <20190923140355.GH2959@kadam> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR04CA0009.apcprd04.prod.outlook.com (2603:1096:203:36::21) To MN2PR04MB5886.namprd04.prod.outlook.com (2603:10b6:208:a3::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=xji@analogixsemi.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [43.252.149.35] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9fea7581-f7dc-48b6-89e4-08d7416f334d x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:MN2PR04MB5712; x-ms-traffictypediagnostic: MN2PR04MB5712: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:257; x-forefront-prvs: 01713B2841 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(7916004)(346002)(376002)(366004)(39840400004)(396003)(136003)(199004)(189003)(2906002)(256004)(186003)(9686003)(305945005)(86362001)(30864003)(446003)(71190400001)(26005)(6486002)(6512007)(229853002)(5660300002)(6246003)(52116002)(8936002)(107886003)(66946007)(66066001)(14454004)(6436002)(478600001)(25786009)(66556008)(66476007)(66446008)(64756008)(6116002)(54906003)(3846002)(486006)(81166006)(7416002)(6916009)(76176011)(71200400001)(4326008)(561924002)(33716001)(5024004)(476003)(6506007)(386003)(8676002)(11346002)(7736002)(1076003)(316002)(102836004)(81156014)(33656002)(55236004)(99286004)(14444005)(579004)(559001)(569006);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR04MB5712;H:MN2PR04MB5886.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: analogixsemi.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OJlCuBs4vfktXI6R0jX0ZTK7qWeSVyaVS/IOPTcZXqJPMFYEiCJivQlawrsZc7iRRdU2EIinFnxWv7j3+ivaRd6oxiRLJIaBduToG7EXqhO+Qg+FpJV+xXCaTAfq8jhdhl04Pxq5ubkooVNO8RV3JRrvJtMuHLvdSVNg0w6YfBj2iOSS1pvz3xR5/mY8ulMKPIf690czZB66ri8OoSLQkxfiK9LOefedb0f2nMU/84TSRRbAXwNnuRChBU8IwZgSwZ0giWNZyKt3unSejgd2V8MIBZKtj+EKCvtBw4x8myTfuq4PHVuf2MghqaWvN+Mw5sVnXr6JlDwWu5uVhj0Lh+kMGktVyVUHFeBW4tiHkge2NBqWO9Muz7Vcps3tdEl7TzKzAb4XC0LAfqW09qmFnFLs6022hnhQkngrVnvuY8Y= Content-Type: text/plain; charset="us-ascii" Content-ID: <63D33D3DCEAF51458312DF259E126E26@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fea7581-f7dc-48b6-89e4-08d7416f334d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 04:16:56.2224 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EnluRwAzXrsLBdWzHLT8P/ZO6uA0vBsMoxgNBKj8FGpnUrkxO557F+CKETOWiuzNVAVt9ka9kdRUDpKDhiWxGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5712 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 23, 2019 at 05:03:55PM +0300, Dan Carpenter wrote: > I wish you would think more about the error codes that you're returning. > Most functions do "ret |=3D frob()." which ORs the error codes together, > and results in a nonsense negative error code. But then some functions > return 1 on error and zero on success which is sometimes a bug, > sometimes confusing but always ugly. Hi Dan Carpenter, I'll take more care about return error codes. As I cannot to check all I2C operation result, so I use "ret |=3D frob()." to combine them, if one of them has negative return value, I'll pop out err= or message and retuan. Anyway I'll use uniform return error code(negative value as failed, 0 as success). Thanks, Xin >=20 > On Fri, Sep 20, 2019 at 06:07:43AM +0000, Xin Ji wrote: > > The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed > > for portable device. It converts MIPI to DisplayPort 1.3 4K. > >=20 > > Signed-off-by: Xin Ji > > --- > > drivers/gpu/drm/bridge/Makefile | 2 +- > > drivers/gpu/drm/bridge/analogix/Kconfig | 6 + > > drivers/gpu/drm/bridge/analogix/Makefile | 1 + > > drivers/gpu/drm/bridge/analogix/anx7625.c | 2085 +++++++++++++++++++++= ++++++++ > > drivers/gpu/drm/bridge/analogix/anx7625.h | 397 ++++++ > > 5 files changed, 2490 insertions(+), 1 deletion(-) > > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c > > create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h > >=20 > > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/M= akefile > > index 4934fcf..bcd388a 100644 > > --- a/drivers/gpu/drm/bridge/Makefile > > +++ b/drivers/gpu/drm/bridge/Makefile > > @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) +=3D sii9234.o > > obj-$(CONFIG_DRM_THINE_THC63LVD1024) +=3D thc63lvd1024.o > > obj-$(CONFIG_DRM_TOSHIBA_TC358764) +=3D tc358764.o > > obj-$(CONFIG_DRM_TOSHIBA_TC358767) +=3D tc358767.o > > -obj-$(CONFIG_DRM_ANALOGIX_DP) +=3D analogix/ > > obj-$(CONFIG_DRM_I2C_ADV7511) +=3D adv7511/ > > obj-$(CONFIG_DRM_TI_SN65DSI86) +=3D ti-sn65dsi86.o > > obj-$(CONFIG_DRM_TI_TFP410) +=3D ti-tfp410.o > > +obj-y +=3D analogix/ > > obj-y +=3D synopsys/ > > diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/= bridge/analogix/Kconfig > > index e930ff9..b2f127e 100644 > > --- a/drivers/gpu/drm/bridge/analogix/Kconfig > > +++ b/drivers/gpu/drm/bridge/analogix/Kconfig > > @@ -2,3 +2,9 @@ > > config DRM_ANALOGIX_DP > > tristate > > depends on DRM > > + > > +config ANALOGIX_ANX7625 > > + tristate "Analogix MIPI to DP interface support" > > + help > > + ANX7625 is an ultra-low power 4K mobile HD transmitter designed > > + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K. > > diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm= /bridge/analogix/Makefile > > index fdbf3fd..8a52867 100644 > > --- a/drivers/gpu/drm/bridge/analogix/Makefile > > +++ b/drivers/gpu/drm/bridge/analogix/Makefile > > @@ -1,3 +1,4 @@ > > # SPDX-License-Identifier: GPL-2.0-only > > +obj-$(CONFIG_ANALOGIX_ANX7625) +=3D anx7625.o > > analogix_dp-objs :=3D analogix_dp_core.o analogix_dp_reg.o > > obj-$(CONFIG_DRM_ANALOGIX_DP) +=3D analogix_dp.o > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/dr= m/bridge/analogix/anx7625.c > > new file mode 100644 > > index 0000000..eceadef > > --- /dev/null > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -0,0 +1,2085 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* > > + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved. > > + * > > + */ > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include