From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xin Ji Subject: Re: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190923140355.GH2959@kadam> Content-Language: en-US Content-ID: <63D33D3DCEAF51458312DF259E126E26@namprd04.prod.outlook.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Dan Carpenter Cc: "devel@driverdev.osuosl.org" , Jernej Skrabec , Jonas Karlman , David Airlie , Neil Armstrong , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Andrzej Hajda , Laurent Pinchart , Daniel Vetter , Sheng Pan List-Id: dri-devel@lists.freedesktop.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 |= 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 |= frob()." to combine them, if one of them has negative return value, I'll pop out error message and retuan. Anyway I'll use uniform return error code(negative value as failed, 0 as success). Thanks, Xin > > 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. > > > > 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 > > > > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile > > index 4934fcf..bcd388a 100644 > > --- a/drivers/gpu/drm/bridge/Makefile > > +++ b/drivers/gpu/drm/bridge/Makefile > > @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o > > obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o > > obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o > > obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o > > -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ > > obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ > > obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o > > obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o > > +obj-y += analogix/ > > obj-y += 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) += anx7625.o > > analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o > > obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/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