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 E48C0C43465 for ; Sun, 26 Jul 2020 07:15:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C201A20738 for ; Sun, 26 Jul 2020 07:15:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C201A20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37E396E094; Sun, 26 Jul 2020 07:15:21 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55CAD6E094 for ; Sun, 26 Jul 2020 07:15:20 +0000 (UTC) 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 4E4CC804DA; Sun, 26 Jul 2020 09:15:18 +0200 (CEST) Date: Sun, 26 Jul 2020 09:15:17 +0200 From: Sam Ravnborg To: Marek Vasut Subject: Re: [PATCH 2/2] drm/bridge: tc358762: Add basic driver for Toshiba TC358762 DSI-to-DPI bridge Message-ID: <20200726071517.GD1691925@ravnborg.org> References: <20200725211457.5772-1-marex@denx.de> <20200725211457.5772-2-marex@denx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200725211457.5772-2-marex@denx.de> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=aP3eV41m c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=e5mUnYsNAAAA:8 a=-VAfIpHNAAAA:8 a=VwQbUJbxAAAA:8 a=7gkXJVJtAAAA:8 a=hD80L64hAAAA:8 a=LbIKf5qS0vqErLkYX2EA:9 a=CjuIK1q_8ugA:10 a=Vxmtnl_E_bksehYqCbjh:22 a=srlwD-8ojaedGGhPAyx8:22 a=AjGcO6oz07-iQ99wixmX:22 a=E9Po1WZjFZOl8hwRPBS3:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Marek. On Sat, Jul 25, 2020 at 11:14:57PM +0200, Marek Vasut wrote: > Add very basic driver for Toshiba TC358762 DSI-to-DPI bridge, derived > from tc358764 driver and panel-raspberrypi-touchscreen. This driver is > meant to replace the panel-raspberrypi-touchscreen too, as the bridge > connection can be described in DT too. > > Signed-off-by: Marek Vasut > To: dri-devel@lists.freedesktop.org > Cc: Eric Anholt > Cc: Rob Herring > Cc: Sam Ravnborg > Cc: devicetree@vger.kernel.org > --- Two general comments. - This driver should use the bridge panel - this will simplify the driver in many places. We already have several good examples in-tree that does this. - The driver does not respect the "flags" argument in the attach operation. All new bridge drivers shall respect the flags operation to prepare for use in a setup with chained bridges. In short the flags is used to determine if the display driver or the bridge creates the connector. When the bridge panel is introduced you can drop all the connector creation code and just pass the flag to the bridge panel. The bridge panel will then create the connector if requested. This is possible because this simple bridge driver does not add anything to the connector that the bridge panel does not know. Sam > drivers/gpu/drm/bridge/Kconfig | 9 + > drivers/gpu/drm/bridge/Makefile | 1 + > drivers/gpu/drm/bridge/tc358762.c | 352 ++++++++++++++++++++++++++++++ > 3 files changed, 362 insertions(+) > create mode 100644 drivers/gpu/drm/bridge/tc358762.c > > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig > index 43271c21d3fc..3e76e3fccb78 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -153,6 +153,15 @@ config DRM_THINE_THC63LVD1024 > help > Thine THC63LVD1024 LVDS/parallel converter driver. > > +config DRM_TOSHIBA_TC358762 > + tristate "TC358762 DSI/DPI bridge" > + depends on OF > + select DRM_MIPI_DSI > + select DRM_KMS_HELPER > + select DRM_PANEL > + help > + Toshiba TC358762 DSI/DPI bridge driver. > + > config DRM_TOSHIBA_TC358764 > tristate "TC358764 DSI/LVDS bridge" > depends on OF > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile > index d63d4b7e4347..b341c60ee96a 100644 > --- a/drivers/gpu/drm/bridge/Makefile > +++ b/drivers/gpu/drm/bridge/Makefile > @@ -12,6 +12,7 @@ obj-$(CONFIG_DRM_SII902X) += sii902x.o > obj-$(CONFIG_DRM_SII9234) += sii9234.o > obj-$(CONFIG_DRM_SIMPLE_BRIDGE) += simple-bridge.o > obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o > +obj-$(CONFIG_DRM_TOSHIBA_TC358762) += tc358762.o > obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o > obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o > obj-$(CONFIG_DRM_TOSHIBA_TC358768) += tc358768.o > diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c > new file mode 100644 > index 000000000000..6eb0c0c10623 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/tc358762.c > @@ -0,0 +1,352 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2020 Marek Vasut > + * > + * Based on tc358764.c by > + * Andrzej Hajda > + * Maciej Purski Someone should finish the conversion of tc358764.c to the new bridge API (that someone is me). > + * > + * Based on rpi_touchscreen.c by > + * Eric Anholt > + */ > + > +#include > +#include > +#include > +#include > + > +#include