From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE31BC43461 for ; Fri, 28 Aug 2020 19:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBBA920897 for ; Fri, 28 Aug 2020 19:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726677AbgH1T7D (ORCPT ); Fri, 28 Aug 2020 15:59:03 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:57328 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgH1T64 (ORCPT ); Fri, 28 Aug 2020 15:58:56 -0400 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 7422E80472; Fri, 28 Aug 2020 21:58:45 +0200 (CEST) Date: Fri, 28 Aug 2020 21:58:44 +0200 From: Sam Ravnborg To: Dmitry Baryshkov Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Herring , Daniel Vetter , David Airlie , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Vinod Koul Subject: Re: [PATCH v2 2/3] drm: bridge: add support for lontium LT9611UXC bridge Message-ID: <20200828195844.GB668578@ravnborg.org> References: <20200828154906.1662611-1-dmitry.baryshkov@linaro.org> <20200828154906.1662611-3-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200828154906.1662611-3-dmitry.baryshkov@linaro.org> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=A5ZCwZeG c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=KKAkSRfTAAAA:8 a=1AxOGK_fiuOiC5t-TeQA:9 a=kbvK5WNt2DYEMNCZ:21 a=ai77vUOJtgDun9WE:21 a=CjuIK1q_8ugA:10 a=cvBusfyB2V15izCimMoJ:22 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Dmitry On Fri, Aug 28, 2020 at 06:49:05PM +0300, Dmitry Baryshkov wrote: > Add support for Lontium LT9611UXC HDMI bridge. Lontium LT9611UXC is a > DSI to HDMI bridge which supports two DSI ports and I2S port as an input > and HDMI port as output. Despite name being similar to LT9611, these > devices are different enough to warrant separate driver. > > Signed-off-by: Dmitry Baryshkov I have browsed the driver - most looks good but the way modes are handled looks fishy. The code either relies on edid or modes returned by a panel-timings node. The panel-timings node seems to be used to override the edid info. We do not need this in any other bridge driver today - and thus it is questionaable if this driver needs it. If it is needed then please document the rationale behind it - in the source code. The binding does not exaplin anything about a panel-timings node. If the panel-timins stuff is not needed, then remember to drop include files that are no logner used. And then there is mode_valid which uses a set of modes obtained from a static list which also looks strange. The last part can also be found in lontium-lt9611.c but that does not make it correct. Please see other bridge drivers. The extra patch that makes connector creation optinal should be merged with the first patch - there is no gain to split it in two. There was also a few style issues, see comments in the following. Looks forward to see a new revision. Sam > --- > drivers/gpu/drm/bridge/Kconfig | 13 + > drivers/gpu/drm/bridge/Makefile | 1 + > drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 774 +++++++++++++++++++++ > 3 files changed, 788 insertions(+) > create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611uxc.c > > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig > index 3e11af4e9f63..8343fb054652 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -61,6 +61,19 @@ config DRM_LONTIUM_LT9611 > HDMI signals > Please say Y if you have such hardware. > > +config DRM_LONTIUM_LT9611UXC > + tristate "Lontium LT9611UXC DSI/HDMI bridge" > + select SND_SOC_HDMI_CODEC if SND_SOC > + depends on OF > + select DRM_PANEL_BRIDGE > + select DRM_KMS_HELPER > + select REGMAP_I2C > + help > + Driver for Lontium LT9611UXC DSI to HDMI bridge > + chip driver that converts dual DSI and I2S to > + HDMI signals > + Please say Y if you have such hardware. > + > config DRM_LVDS_CODEC > tristate "Transparent LVDS encoders and decoders support" > depends on OF > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile > index c589a6a7cbe1..306850a5899b 100644 > --- a/drivers/gpu/drm/bridge/Makefile > +++ b/drivers/gpu/drm/bridge/Makefile > @@ -3,6 +3,7 @@ obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o > obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o > obj-$(CONFIG_DRM_DISPLAY_CONNECTOR) += display-connector.o > obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o > +obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o > obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o > obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o > obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > new file mode 100644 > index 000000000000..77c5aa5c6ad7 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > @@ -0,0 +1,774 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2018, The Linux Foundation. All rights reserved. > + * Copyright (c) 2019-2020. Linaro Limited. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include