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=-7.0 required=3.0 tests=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 41A30C433DF for ; Sun, 21 Jun 2020 08:09:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB3B32487A for ; Sun, 21 Jun 2020 08:09:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729484AbgFUIJr (ORCPT ); Sun, 21 Jun 2020 04:09:47 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:56310 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729443AbgFUIJq (ORCPT ); Sun, 21 Jun 2020 04:09:46 -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 asavdk3.altibox.net (Postfix) with ESMTPS id 2DDBB20026; Sun, 21 Jun 2020 10:09:26 +0200 (CEST) Date: Sun, 21 Jun 2020 10:09:25 +0200 From: Sam Ravnborg To: Xin Ji Cc: devel@driverdev.osuosl.org, Laurent Pinchart , Andrzej Hajda , Nicolas Boichat , Jernej Skrabec , Nicolas Boichat , Pi-Hsun Shih , Jonas Karlman , David Airlie , Shawn Ku , Neil Armstrong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sheng Pan , Hsin-Yi Wang , Dan Carpenter Subject: Re: [PATCH v13 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP Message-ID: <20200621080925.GH74146@ravnborg.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=edQTgYMH c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=bbNUuHX0AAAA:8 a=e5mUnYsNAAAA:8 a=WuTIMwpaZP_gVESzas0A:9 a=Uh4VTly-S2yuYZWg:21 a=te-yXDEZyxPkjRxM:21 a=CjuIK1q_8ugA:10 a=3b-t3vAtY4IUXy2q2Ylb:22 a=Vxmtnl_E_bksehYqCbjh:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xin. On Tue, Jun 09, 2020 at 03:19:50PM +0800, Xin Ji wrote: > The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed > for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K. > > Signed-off-by: Xin Ji The bridge driver now implements the bridge functions for get_edid + detect which is good. But the bridge driver also needs to check the flags argument of anx7625_bridge_attach() so the connector creation is optional. This is required to prepare the bridge driver to fully support a chain of bridges and is mandatory for new bridge drivers. Futhermore the bridge driver needs to be converted to use the bridge panel. See what other bridge drivers do. In short - the drm_panel shall be replaced by a bridge in your platform data structure. Usual this end up in less code after the conversion. Sam > --- > drivers/gpu/drm/bridge/analogix/Kconfig | 9 + > drivers/gpu/drm/bridge/analogix/Makefile | 1 + > drivers/gpu/drm/bridge/analogix/anx7625.c | 1999 +++++++++++++++++++++++++++++ > drivers/gpu/drm/bridge/analogix/anx7625.h | 397 ++++++ > 4 files changed, 2406 insertions(+) > 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/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig > index e1fa7d8..024ea2a 100644 > --- a/drivers/gpu/drm/bridge/analogix/Kconfig > +++ b/drivers/gpu/drm/bridge/analogix/Kconfig > @@ -25,3 +25,12 @@ config DRM_ANALOGIX_ANX78XX > config DRM_ANALOGIX_DP > tristate > depends on DRM > + > +config DRM_ANALOGIX_ANX7625 > + tristate "Analogix Anx7625 MIPI to DP interface support" > + depends on DRM > + depends on OF > + 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 97669b3..44da392 100644 > --- a/drivers/gpu/drm/bridge/analogix/Makefile > +++ b/drivers/gpu/drm/bridge/analogix/Makefile > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0-only > analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o analogix-i2c-dptx.o > obj-$(CONFIG_DRM_ANALOGIX_ANX6345) += analogix-anx6345.o > +obj-$(CONFIG_DRM_ANALOGIX_ANX7625) += anx7625.o > obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.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..db37f68 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -0,0 +1,1999 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright(c) 2020, 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