From patchwork Wed Nov 13 15:51:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242167 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9D8F1709 for ; Wed, 13 Nov 2019 15:51:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD82D22D0A for ; Wed, 13 Nov 2019 15:51:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727487AbfKMPvs (ORCPT ); Wed, 13 Nov 2019 10:51:48 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:21771 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbfKMPvs (ORCPT ); Wed, 13 Nov 2019 10:51:48 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593899" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:51:46 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id DD37D400E9F7; Thu, 14 Nov 2019 00:51:41 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 01/13] dt-bindings: display: bridge: Convert lvds-transmitter binding to json-schema Date: Wed, 13 Nov 2019 15:51:20 +0000 Message-Id: <1573660292-10629-2-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Convert the lvds-transmitter binding to DT schema format using json-schema. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * Fixed the description of property "compatible" according to Laurent's comments v2->v3: * Extracted conversion to dt-schema as per Rob's comment v1->v2: * Converted to dt-schema as per Neil's comment --- .../bindings/display/bridge/lvds-transmitter.txt | 66 ---------------- .../bindings/display/bridge/lvds-transmitter.yaml | 91 ++++++++++++++++++++++ 2 files changed, 91 insertions(+), 66 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt create mode 100644 Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt deleted file mode 100644 index 60091db..0000000 --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt +++ /dev/null @@ -1,66 +0,0 @@ -Parallel to LVDS Encoder ------------------------- - -This binding supports the parallel to LVDS encoders that don't require any -configuration. - -LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple -incompatible data link layers have been used over time to transmit image data -to LVDS panels. This binding targets devices compatible with the following -specifications only. - -[JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February -1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA) -[LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National -Semiconductor -[VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video -Electronics Standards Association (VESA) - -Those devices have been marketed under the FPD-Link and FlatLink brand names -among others. - - -Required properties: - -- compatible: Must be "lvds-encoder" - - Any encoder compatible with this generic binding, but with additional - properties not listed here, must list a device specific compatible first - followed by this generic compatible. - -Required nodes: - -This device has two video ports. Their connections are modeled using the OF -graph bindings specified in Documentation/devicetree/bindings/graph.txt. - -- Video port 0 for parallel input -- Video port 1 for LVDS output - - -Example -------- - -lvds-encoder { - compatible = "lvds-encoder"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - lvds_enc_in: endpoint { - remote-endpoint = <&display_out_rgb>; - }; - }; - - port@1 { - reg = <1>; - - lvds_enc_out: endpoint { - remote-endpoint = <&lvds_panel_in>; - }; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml new file mode 100644 index 0000000..b5dd0da --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml @@ -0,0 +1,91 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/lvds-transmitter.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Parallel to LVDS Encoder + +maintainers: + - Laurent Pinchart + +description: | + This binding supports the parallel to LVDS encoders that don't require any + configuration. + + LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple + incompatible data link layers have been used over time to transmit image data + to LVDS panels. This binding targets devices compatible with the following + specifications only. + + [JEIDA] "Digital Interface Standards for Monitor", JEIDA-59-1999, February + 1999 (Version 1.0), Japan Electronic Industry Development Association (JEIDA) + [LDI] "Open LVDS Display Interface", May 1999 (Version 0.95), National + Semiconductor + [VESA] "VESA Notebook Panel Standard", October 2007 (Version 1.0), Video + Electronics Standards Association (VESA) + + Those devices have been marketed under the FPD-Link and FlatLink brand names + among others. + +properties: + compatible: + description: | + Any encoder compatible with this generic binding, but with additional + properties not listed here, must define its own binding and list a device + specific compatible first followed by the generic compatible. + enum: + - lvds-encoder + + ports: + type: object + description: | + This device has two video ports. Their connections are modeled using the + OF graph bindings specified in Documentation/devicetree/bindings/graph.txt + properties: + port@0: + type: object + description: | + Port 0 is for parallel input + + port@1: + type: object + description: | + Port 1 is for LVDS output + + required: + - port@0 + - port@1 + +required: + - compatible + - ports + +examples: + - | + lvds-encoder { + compatible = "lvds-encoder"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + lvds_enc_in: endpoint { + remote-endpoint = <&display_out_rgb>; + }; + }; + + port@1 { + reg = <1>; + + lvds_enc_out: endpoint { + remote-endpoint = <&lvds_panel_in>; + }; + }; + }; + }; + +... From patchwork Wed Nov 13 15:51:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242169 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 798A21390 for ; Wed, 13 Nov 2019 15:51:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59C2422D2B for ; Wed, 13 Nov 2019 15:51:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727993AbfKMPvw (ORCPT ); Wed, 13 Nov 2019 10:51:52 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:21771 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbfKMPvw (ORCPT ); Wed, 13 Nov 2019 10:51:52 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593904" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:51:51 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id DDAD2400ED5C; Thu, 14 Nov 2019 00:51:46 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 02/13] dt-bindings: display: bridge: lvds-transmitter: Document powerdown-gpios Date: Wed, 13 Nov 2019 15:51:21 +0000 Message-Id: <1573660292-10629-3-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Add documentation for property powerdown-gpios. The property is optional. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- .../devicetree/bindings/display/bridge/lvds-transmitter.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml index b5dd0da..2484737 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml @@ -57,6 +57,11 @@ properties: - port@0 - port@1 + powerdown-gpios: + description: + The GPIO used to control the power down line of this device. + maxItems: 1 + required: - compatible - ports From patchwork Wed Nov 13 15:51:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242171 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 942251390 for ; Wed, 13 Nov 2019 15:51:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7EDC722D50 for ; Wed, 13 Nov 2019 15:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727996AbfKMPv5 (ORCPT ); Wed, 13 Nov 2019 10:51:57 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:21771 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbfKMPv5 (ORCPT ); Wed, 13 Nov 2019 10:51:57 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593909" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:51:56 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id D97E4400E9F7; Thu, 14 Nov 2019 00:51:51 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 03/13] dt-bindings: display: bridge: lvds-transmitter: Absorb ti,ds90c185.txt Date: Wed, 13 Nov 2019 15:51:22 +0000 Message-Id: <1573660292-10629-4-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org ti,ds90c185.txt documents LVDS encoders using the same driver as the one documented by lvds-transmitter.yaml. Since the properties listed in ti,ds90c185.txt are the same as the ones listed in lvds-transmitter.yaml, absorb the dt-binding into lvds-transmitter.yaml. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- .../bindings/display/bridge/lvds-transmitter.yaml | 14 +++--- .../bindings/display/bridge/ti,ds90c185.txt | 55 ---------------------- 2 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/ti,ds90c185.txt diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml index 2484737..a8326ce 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml @@ -31,11 +31,13 @@ description: | properties: compatible: description: | - Any encoder compatible with this generic binding, but with additional - properties not listed here, must define its own binding and list a device - specific compatible first followed by the generic compatible. - enum: - - lvds-encoder + Must list the device specific compatible string first, followed by the + generic compatible string. + items: + - enum: + - ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer + - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer + - const: lvds-encoder # Generic LVDS encoder compatible fallback ports: type: object @@ -69,7 +71,7 @@ required: examples: - | lvds-encoder { - compatible = "lvds-encoder"; + compatible = "ti,ds90c185", "lvds-encoder"; ports { #address-cells = <1>; diff --git a/Documentation/devicetree/bindings/display/bridge/ti,ds90c185.txt b/Documentation/devicetree/bindings/display/bridge/ti,ds90c185.txt deleted file mode 100644 index e575f99..0000000 --- a/Documentation/devicetree/bindings/display/bridge/ti,ds90c185.txt +++ /dev/null @@ -1,55 +0,0 @@ -Texas Instruments FPD-Link (LVDS) Serializer --------------------------------------------- - -The DS90C185 and DS90C187 are low-power serializers for portable -battery-powered applications that reduces the size of the RGB -interface between the host GPU and the display. - -Required properties: - -- compatible: Should be - "ti,ds90c185", "lvds-encoder" for the TI DS90C185 FPD-Link Serializer - "ti,ds90c187", "lvds-encoder" for the TI DS90C187 FPD-Link Serializer - -Optional properties: - -- powerdown-gpios: Power down control GPIO (the PDB pin, active-low) - -Required nodes: - -The devices have two video ports. Their connections are modeled using the OF -graph bindings specified in Documentation/devicetree/bindings/graph.txt. - -- Video port 0 for parallel input -- Video port 1 for LVDS output - - -Example -------- - -lvds-encoder { - compatible = "ti,ds90c185", "lvds-encoder"; - - powerdown-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - lvds_enc_in: endpoint { - remote-endpoint = <&lcdc_out_rgb>; - }; - }; - - port@1 { - reg = <1>; - - lvds_enc_out: endpoint { - remote-endpoint = <&lvds_panel_in>; - }; - }; - }; -}; From patchwork Wed Nov 13 15:51:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242173 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E6E01850 for ; Wed, 13 Nov 2019 15:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CC5A22D5B for ; Wed, 13 Nov 2019 15:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbfKMPwC (ORCPT ); Wed, 13 Nov 2019 10:52:02 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:21771 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728002AbfKMPwC (ORCPT ); Wed, 13 Nov 2019 10:52:02 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593914" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:01 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id DB6C2400E9F7; Thu, 14 Nov 2019 00:51:56 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 04/13] dt-bindings: display: bridge: lvds-transmitter: Document "ti,sn75lvds83" Date: Wed, 13 Nov 2019 15:51:23 +0000 Message-Id: <1573660292-10629-5-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Compatible string "ti,sn75lvds83" is being used by device tree rk3188-bqedison2qc.dts, but it's not documented anywhere, therefore document it within lvds-transmitter.yaml. Signed-off-by: Fabrizio Castro Acked-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml index a8326ce..27de616 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml @@ -37,6 +37,7 @@ properties: - enum: - ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer + - ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter - const: lvds-encoder # Generic LVDS encoder compatible fallback ports: From patchwork Wed Nov 13 15:51:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242175 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3C141709 for ; Wed, 13 Nov 2019 15:52:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8518422DA7 for ; Wed, 13 Nov 2019 15:52:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbfKMPwH (ORCPT ); Wed, 13 Nov 2019 10:52:07 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:21771 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728002AbfKMPwH (ORCPT ); Wed, 13 Nov 2019 10:52:07 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593920" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:06 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id CBC4B400ED5C; Thu, 14 Nov 2019 00:52:01 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 05/13] drm/bridge: Repurpose lvds-encoder.c Date: Wed, 13 Nov 2019 15:51:24 +0000 Message-Id: <1573660292-10629-6-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org lvds-encoder.c implementation is also suitable for LVDS decoders, not just LVDS encoders. Instead of creating a new driver for addressing support for transparent LVDS decoders, repurpose lvds-encoder.c for the greater good with this patch. This patch only "rebrands" the lvds-encoder.c driver, to make it suitable for hosting LVDS decoders support. The actual support for LVDS decoders will come with a later patch. Signed-off-by: Fabrizio Castro Reviewed-by: Laurent Pinchart --- v3->v4: * The patch now only renames the driver (with related data structures and build options), changes the description of the module, and refreshes the copyright v2->v3: * No change v1->v2: * No change --- drivers/gpu/drm/bridge/Kconfig | 8 +- drivers/gpu/drm/bridge/Makefile | 2 +- .../drm/bridge/{lvds-encoder.c => lvds-codec.c} | 97 +++++++++++----------- 3 files changed, 53 insertions(+), 54 deletions(-) rename drivers/gpu/drm/bridge/{lvds-encoder.c => lvds-codec.c} (45%) diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 3436297..fbbea46 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -45,14 +45,14 @@ config DRM_DUMB_VGA_DAC Support for non-programmable RGB to VGA DAC bridges, such as ADI ADV7123, TI THS8134 and THS8135 or passive resistor ladder DACs. -config DRM_LVDS_ENCODER - tristate "Transparent parallel to LVDS encoder support" +config DRM_LVDS_CODEC + tristate "Transparent LVDS encoders and decoders support" depends on OF select DRM_KMS_HELPER select DRM_PANEL_BRIDGE help - Support for transparent parallel to LVDS encoders that don't require - any configuration. + Support for transparent LVDS encoders and decoders that don't + require any configuration. config DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW tristate "MegaChips stdp4028-ge-b850v3-fw and stdp2690-ge-b850v3-fw" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 4934fcf..8a9178a 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o -obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.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 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o diff --git a/drivers/gpu/drm/bridge/lvds-encoder.c b/drivers/gpu/drm/bridge/lvds-codec.c similarity index 45% rename from drivers/gpu/drm/bridge/lvds-encoder.c rename to drivers/gpu/drm/bridge/lvds-codec.c index e2132a8..b5801a2 100644 --- a/drivers/gpu/drm/bridge/lvds-encoder.c +++ b/drivers/gpu/drm/bridge/lvds-codec.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* + * Copyright (C) 2019 Renesas Electronics Corporation * Copyright (C) 2016 Laurent Pinchart */ @@ -12,65 +13,62 @@ #include #include -struct lvds_encoder { +struct lvds_codec { struct drm_bridge bridge; struct drm_bridge *panel_bridge; struct gpio_desc *powerdown_gpio; }; -static int lvds_encoder_attach(struct drm_bridge *bridge) +static int lvds_codec_attach(struct drm_bridge *bridge) { - struct lvds_encoder *lvds_encoder = container_of(bridge, - struct lvds_encoder, - bridge); + struct lvds_codec *lvds_codec = container_of(bridge, + struct lvds_codec, bridge); - return drm_bridge_attach(bridge->encoder, lvds_encoder->panel_bridge, + return drm_bridge_attach(bridge->encoder, lvds_codec->panel_bridge, bridge); } -static void lvds_encoder_enable(struct drm_bridge *bridge) +static void lvds_codec_enable(struct drm_bridge *bridge) { - struct lvds_encoder *lvds_encoder = container_of(bridge, - struct lvds_encoder, - bridge); + struct lvds_codec *lvds_codec = container_of(bridge, + struct lvds_codec, bridge); - if (lvds_encoder->powerdown_gpio) - gpiod_set_value_cansleep(lvds_encoder->powerdown_gpio, 0); + if (lvds_codec->powerdown_gpio) + gpiod_set_value_cansleep(lvds_codec->powerdown_gpio, 0); } -static void lvds_encoder_disable(struct drm_bridge *bridge) +static void lvds_codec_disable(struct drm_bridge *bridge) { - struct lvds_encoder *lvds_encoder = container_of(bridge, - struct lvds_encoder, - bridge); + struct lvds_codec *lvds_codec = container_of(bridge, + struct lvds_codec, bridge); - if (lvds_encoder->powerdown_gpio) - gpiod_set_value_cansleep(lvds_encoder->powerdown_gpio, 1); + if (lvds_codec->powerdown_gpio) + gpiod_set_value_cansleep(lvds_codec->powerdown_gpio, 1); } static struct drm_bridge_funcs funcs = { - .attach = lvds_encoder_attach, - .enable = lvds_encoder_enable, - .disable = lvds_encoder_disable, + .attach = lvds_codec_attach, + .enable = lvds_codec_enable, + .disable = lvds_codec_disable, }; -static int lvds_encoder_probe(struct platform_device *pdev) +static int lvds_codec_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *port; struct device_node *endpoint; struct device_node *panel_node; struct drm_panel *panel; - struct lvds_encoder *lvds_encoder; + struct lvds_codec *lvds_codec; - lvds_encoder = devm_kzalloc(dev, sizeof(*lvds_encoder), GFP_KERNEL); - if (!lvds_encoder) + lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL); + if (!lvds_codec) return -ENOMEM; - lvds_encoder->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", - GPIOD_OUT_HIGH); - if (IS_ERR(lvds_encoder->powerdown_gpio)) { - int err = PTR_ERR(lvds_encoder->powerdown_gpio); + lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", + GPIOD_OUT_HIGH); + if (IS_ERR(lvds_codec->powerdown_gpio)) { + int err = PTR_ERR(lvds_codec->powerdown_gpio); if (err != -EPROBE_DEFER) dev_err(dev, "powerdown GPIO failure: %d\n", err); @@ -105,51 +103,52 @@ static int lvds_encoder_probe(struct platform_device *pdev) return PTR_ERR(panel); } - lvds_encoder->panel_bridge = + lvds_codec->panel_bridge = devm_drm_panel_bridge_add_typed(dev, panel, DRM_MODE_CONNECTOR_LVDS); - if (IS_ERR(lvds_encoder->panel_bridge)) - return PTR_ERR(lvds_encoder->panel_bridge); + if (IS_ERR(lvds_codec->panel_bridge)) + return PTR_ERR(lvds_codec->panel_bridge); - /* The panel_bridge bridge is attached to the panel's of_node, + /* + * The panel_bridge bridge is attached to the panel's of_node, * but we need a bridge attached to our of_node for our user * to look up. */ - lvds_encoder->bridge.of_node = dev->of_node; - lvds_encoder->bridge.funcs = &funcs; - drm_bridge_add(&lvds_encoder->bridge); + lvds_codec->bridge.of_node = dev->of_node; + lvds_codec->bridge.funcs = &funcs; + drm_bridge_add(&lvds_codec->bridge); - platform_set_drvdata(pdev, lvds_encoder); + platform_set_drvdata(pdev, lvds_codec); return 0; } -static int lvds_encoder_remove(struct platform_device *pdev) +static int lvds_codec_remove(struct platform_device *pdev) { - struct lvds_encoder *lvds_encoder = platform_get_drvdata(pdev); + struct lvds_codec *lvds_codec = platform_get_drvdata(pdev); - drm_bridge_remove(&lvds_encoder->bridge); + drm_bridge_remove(&lvds_codec->bridge); return 0; } -static const struct of_device_id lvds_encoder_match[] = { +static const struct of_device_id lvds_codec_match[] = { { .compatible = "lvds-encoder" }, { .compatible = "thine,thc63lvdm83d" }, {}, }; -MODULE_DEVICE_TABLE(of, lvds_encoder_match); +MODULE_DEVICE_TABLE(of, lvds_codec_match); -static struct platform_driver lvds_encoder_driver = { - .probe = lvds_encoder_probe, - .remove = lvds_encoder_remove, +static struct platform_driver lvds_codec_driver = { + .probe = lvds_codec_probe, + .remove = lvds_codec_remove, .driver = { - .name = "lvds-encoder", - .of_match_table = lvds_encoder_match, + .name = "lvds-codec", + .of_match_table = lvds_codec_match, }, }; -module_platform_driver(lvds_encoder_driver); +module_platform_driver(lvds_codec_driver); MODULE_AUTHOR("Laurent Pinchart "); -MODULE_DESCRIPTION("Transparent parallel to LVDS encoder"); +MODULE_DESCRIPTION("LVDS encoders and decoders"); MODULE_LICENSE("GPL"); From patchwork Wed Nov 13 15:51:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242177 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 838021390 for ; Wed, 13 Nov 2019 15:52:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B5C722DA9 for ; Wed, 13 Nov 2019 15:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728002AbfKMPwN (ORCPT ); Wed, 13 Nov 2019 10:52:13 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:54368 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbfKMPwN (ORCPT ); Wed, 13 Nov 2019 10:52:13 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31380894" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:11 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C4296400ED5C; Thu, 14 Nov 2019 00:52:06 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 06/13] drm/bridge: lvds-codec: Add "lvds-decoder" support Date: Wed, 13 Nov 2019 15:51:25 +0000 Message-Id: <1573660292-10629-7-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Add support for transparent LVDS decoders by adding a new compatible string ("lvds-decoder") to the driver. This patch also adds member connector_type to struct lvds_codec, and that's because LVDS decoders have a different connector type from LVDS encoders. We fill this new member up with the data matching the compatible string. Signed-off-by: Fabrizio Castro Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- drivers/gpu/drm/bridge/lvds-codec.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c index b5801a2..c32e125 100644 --- a/drivers/gpu/drm/bridge/lvds-codec.c +++ b/drivers/gpu/drm/bridge/lvds-codec.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,7 @@ struct lvds_codec { struct drm_bridge bridge; struct drm_bridge *panel_bridge; struct gpio_desc *powerdown_gpio; + u32 connector_type; }; static int lvds_codec_attach(struct drm_bridge *bridge) @@ -65,6 +67,7 @@ static int lvds_codec_probe(struct platform_device *pdev) if (!lvds_codec) return -ENOMEM; + lvds_codec->connector_type = (u32)of_device_get_match_data(&pdev->dev); lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_HIGH); if (IS_ERR(lvds_codec->powerdown_gpio)) { @@ -105,7 +108,7 @@ static int lvds_codec_probe(struct platform_device *pdev) lvds_codec->panel_bridge = devm_drm_panel_bridge_add_typed(dev, panel, - DRM_MODE_CONNECTOR_LVDS); + lvds_codec->connector_type); if (IS_ERR(lvds_codec->panel_bridge)) return PTR_ERR(lvds_codec->panel_bridge); @@ -133,8 +136,18 @@ static int lvds_codec_remove(struct platform_device *pdev) } static const struct of_device_id lvds_codec_match[] = { - { .compatible = "lvds-encoder" }, - { .compatible = "thine,thc63lvdm83d" }, + { + .compatible = "lvds-decoder", + .data = (void *)DRM_MODE_CONNECTOR_DPI, + }, + { + .compatible = "lvds-encoder", + .data = (void *)DRM_MODE_CONNECTOR_LVDS, + }, + { + .compatible = "thine,thc63lvdm83d", + .data = (void *)DRM_MODE_CONNECTOR_LVDS, + }, {}, }; MODULE_DEVICE_TABLE(of, lvds_codec_match); From patchwork Wed Nov 13 15:51:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242181 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9131E1850 for ; Wed, 13 Nov 2019 15:52:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A64222EBF for ; Wed, 13 Nov 2019 15:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728104AbfKMPwR (ORCPT ); Wed, 13 Nov 2019 10:52:17 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:29184 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728028AbfKMPwR (ORCPT ); Wed, 13 Nov 2019 10:52:17 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593928" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:16 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C040E400EE7D; Thu, 14 Nov 2019 00:52:11 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 07/13] drm/bridge: lvds-codec: Simplify panel DT node localisation Date: Wed, 13 Nov 2019 15:51:26 +0000 Message-Id: <1573660292-10629-8-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The probe function needs to get ahold of the panel device tree node, and it achieves that by using a combination of of_graph_get_port_by_id, of_get_child_by_name, and of_graph_get_remote_port_parent. We can achieve the same goal by replacing those calls with a call to of_graph_get_remote_node these days. Signed-off-by: Fabrizio Castro Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- drivers/gpu/drm/bridge/lvds-codec.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c index c32e125..784bbd3 100644 --- a/drivers/gpu/drm/bridge/lvds-codec.c +++ b/drivers/gpu/drm/bridge/lvds-codec.c @@ -57,8 +57,6 @@ static struct drm_bridge_funcs funcs = { static int lvds_codec_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *port; - struct device_node *endpoint; struct device_node *panel_node; struct drm_panel *panel; struct lvds_codec *lvds_codec; @@ -79,23 +77,9 @@ static int lvds_codec_probe(struct platform_device *pdev) } /* Locate the panel DT node. */ - port = of_graph_get_port_by_id(dev->of_node, 1); - if (!port) { - dev_dbg(dev, "port 1 not found\n"); - return -ENXIO; - } - - endpoint = of_get_child_by_name(port, "endpoint"); - of_node_put(port); - if (!endpoint) { - dev_dbg(dev, "no endpoint for port 1\n"); - return -ENXIO; - } - - panel_node = of_graph_get_remote_port_parent(endpoint); - of_node_put(endpoint); + panel_node = of_graph_get_remote_node(dev->of_node, 1, 0); if (!panel_node) { - dev_dbg(dev, "no remote endpoint for port 1\n"); + dev_dbg(dev, "panel DT node not found\n"); return -ENXIO; } From patchwork Wed Nov 13 15:51:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242183 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2643B1390 for ; Wed, 13 Nov 2019 15:52:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 112FB230F1 for ; Wed, 13 Nov 2019 15:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbfKMPwW (ORCPT ); Wed, 13 Nov 2019 10:52:22 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:28234 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727907AbfKMPwW (ORCPT ); Wed, 13 Nov 2019 10:52:22 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31380904" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:21 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B9714400EE6B; Thu, 14 Nov 2019 00:52:16 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 08/13] dt-bindings: display: bridge: Repurpose lvds-encoder Date: Wed, 13 Nov 2019 15:51:27 +0000 Message-Id: <1573660292-10629-9-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org In an effort to repurpose lvds-encoder.c to also serve the function of LVDS decoders, we ended up defining a new "generic" compatible string ("lvds-decoder"), therefore adapt the dt schema to allow for the new compatible string. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * Improved title and description according to Laurent's comments * Reworked definition of the compatible property v2->v3: * Extracted conversion to lvds-codec as per Rob's comment v1->v2: * Converted to dt-schema as per Neil's comment --- .../{lvds-transmitter.yaml => lvds-codec.yaml} | 54 +++++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) rename Documentation/devicetree/bindings/display/bridge/{lvds-transmitter.yaml => lvds-codec.yaml} (61%) diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml similarity index 61% rename from Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml rename to Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml index 27de616..0ecc8a4 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml @@ -1,17 +1,17 @@ # SPDX-License-Identifier: GPL-2.0 %YAML 1.2 --- -$id: http://devicetree.org/schemas/display/bridge/lvds-transmitter.yaml# +$id: http://devicetree.org/schemas/display/bridge/lvds-codec.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Parallel to LVDS Encoder +title: Transparent LVDS encoders and decoders maintainers: - Laurent Pinchart description: | - This binding supports the parallel to LVDS encoders that don't require any - configuration. + This binding supports transparent LVDS encoders and decoders that don't + require any configuration. LVDS is a physical layer specification defined in ANSI/TIA/EIA-644-A. Multiple incompatible data link layers have been used over time to transmit image data @@ -33,12 +33,14 @@ properties: description: | Must list the device specific compatible string first, followed by the generic compatible string. - items: - - enum: - - ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer - - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer - - ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter - - const: lvds-encoder # Generic LVDS encoder compatible fallback + oneOf: + - items: + - enum: + - ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer + - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer + - ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter + - const: lvds-encoder # Generic LVDS encoder compatible fallback + - const: lvds-decoder # Generic LVDS decoders compatible fallback ports: type: object @@ -49,12 +51,14 @@ properties: port@0: type: object description: | - Port 0 is for parallel input + With LVDS encoders port 0 is for parallel input + With LVDS decoders port 0 is for LVDS input port@1: type: object description: | - Port 1 is for LVDS output + With LVDS encoders port 1 is for LVDS output + With LVDS decoders port 1 is for parallel output required: - port@0 @@ -96,4 +100,30 @@ examples: }; }; + - | + lvds-decoder { + compatible = "lvds-decoder"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + lvds_dec_in: endpoint { + remote-endpoint = <&display_out_lvds>; + }; + }; + + port@1 { + reg = <1>; + + lvds_dec_out: endpoint { + remote-endpoint = <&rgb_panel_in>; + }; + }; + }; + }; + ... From patchwork Wed Nov 13 15:51:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242185 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B28971390 for ; Wed, 13 Nov 2019 15:52:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BAE823159 for ; Wed, 13 Nov 2019 15:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728105AbfKMPw1 (ORCPT ); Wed, 13 Nov 2019 10:52:27 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:43910 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727907AbfKMPw1 (ORCPT ); Wed, 13 Nov 2019 10:52:27 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593939" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:26 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id ADDC2400EE6B; Thu, 14 Nov 2019 00:52:21 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 09/13] dt-bindings: display: bridge: lvds-codec: Document ti,ds90cf384a Date: Wed, 13 Nov 2019 15:51:28 +0000 Message-Id: <1573660292-10629-10-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The DS90CF384A from TI is a transparent LVDS receiver (decoder), and therefore it is compatible with the lvds-codec driver and bindings. Document the ti,ds90cf384a compatible string with the dt-bindings. No driver change required. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3->v4: * New patch --- Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml index 0ecc8a4..21f8c6e 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml @@ -40,7 +40,10 @@ properties: - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer - ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter - const: lvds-encoder # Generic LVDS encoder compatible fallback - - const: lvds-decoder # Generic LVDS decoders compatible fallback + - items: + - enum: + - ti,ds90cf384a # For the DS90CF384A FPD-Link LVDS Receiver + - const: lvds-decoder # Generic LVDS decoders compatible fallback ports: type: object @@ -102,7 +105,7 @@ examples: - | lvds-decoder { - compatible = "lvds-decoder"; + compatible = "ti,ds90cf384a", "lvds-decoder"; ports { #address-cells = <1>; From patchwork Wed Nov 13 15:51:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242187 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CDB11390 for ; Wed, 13 Nov 2019 15:52:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC33B2332F for ; Wed, 13 Nov 2019 15:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbfKMPwc (ORCPT ); Wed, 13 Nov 2019 10:52:32 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:59620 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727907AbfKMPwc (ORCPT ); Wed, 13 Nov 2019 10:52:32 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31380911" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:31 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B7DA1400ED5C; Thu, 14 Nov 2019 00:52:26 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 10/13] ARM: dts: iwg20d-q7-common: Add LCD support Date: Wed, 13 Nov 2019 15:51:29 +0000 Message-Id: <1573660292-10629-11-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The iwg20d comes with a 7" capacitive touch screen, therefore add support for it. Signed-off-by: Fabrizio Castro Acked-by: Laurent Pinchart --- v3->v4: * Reworked compatibility of DT node lvds-receiver * s/powerdown/powerdown-gpios/g in lvds-receiver * Reworked compatibility of DT node panel v2->v3: * No change v1->v2: * No change --- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 85 ++++++++++++++++++++++++++++++++ arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi | 1 - 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/iwg20d-q7-common.dtsi b/arch/arm/boot/dts/iwg20d-q7-common.dtsi index ae75a1db..ab5ae93 100644 --- a/arch/arm/boot/dts/iwg20d-q7-common.dtsi +++ b/arch/arm/boot/dts/iwg20d-q7-common.dtsi @@ -46,6 +46,49 @@ clock-frequency = <26000000>; }; + lcd_backlight: backlight { + compatible = "pwm-backlight"; + + pwms = <&pwm3 0 5000000 0>; + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <7>; + enable-gpios = <&gpio5 14 GPIO_ACTIVE_HIGH>; + }; + + lvds-receiver { + compatible = "ti,ds90cf384a", "lvds-decoder"; + powerdown-gpios = <&gpio7 25 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + lvds_receiver_in: endpoint { + remote-endpoint = <&lvds0_out>; + }; + }; + port@1 { + reg = <1>; + lvds_receiver_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; + + panel { + compatible = "edt,etm0700g0dh6"; + backlight = <&lcd_backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&lvds_receiver_out>; + }; + }; + }; + reg_1p5v: 1p5v { compatible = "regulator-fixed"; regulator-name = "1P5V"; @@ -120,6 +163,18 @@ status = "okay"; }; +&du { + status = "okay"; +}; + +&gpio2 { + touch-interrupt { + gpio-hog; + gpios = <12 GPIO_ACTIVE_LOW>; + input; + }; +}; + &hsusb { status = "okay"; pinctrl-0 = <&usb0_pins>; @@ -147,6 +202,25 @@ VDDIO-supply = <®_3p3v>; VDDD-supply = <®_1p5v>; }; + + touch: touchpanel@38 { + compatible = "edt,edt-ft5406"; + reg = <0x38>; + interrupt-parent = <&gpio2>; + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + }; +}; + +&lvds0 { + status = "okay"; + + ports { + port@1 { + lvds0_out: endpoint { + remote-endpoint = <&lvds_receiver_in>; + }; + }; + }; }; &pci0 { @@ -180,6 +254,11 @@ function = "i2c2"; }; + pwm3_pins: pwm3 { + groups = "pwm3"; + function = "pwm3"; + }; + scif0_pins: scif0 { groups = "scif0_data_d"; function = "scif0"; @@ -218,6 +297,12 @@ }; }; +&pwm3 { + pinctrl-0 = <&pwm3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + &rcar_sound { pinctrl-0 = <&sound_pins>; pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi b/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi index 0e99df2..ede2e0c 100644 --- a/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi +++ b/arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi @@ -39,7 +39,6 @@ &du { pinctrl-0 = <&du_pins>; pinctrl-names = "default"; - status = "okay"; ports { port@0 { From patchwork Wed Nov 13 15:51:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242189 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24F931390 for ; Wed, 13 Nov 2019 15:52:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0483F23333 for ; Wed, 13 Nov 2019 15:52:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbfKMPwh (ORCPT ); Wed, 13 Nov 2019 10:52:37 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:59620 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726074AbfKMPwh (ORCPT ); Wed, 13 Nov 2019 10:52:37 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31380916" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:36 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B808A400EE6B; Thu, 14 Nov 2019 00:52:31 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 11/13] ARM: shmobile_defconfig: Enable support for panels from EDT Date: Wed, 13 Nov 2019 15:51:30 +0000 Message-Id: <1573660292-10629-12-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The iwg20d comes with an LCD panel from Emerging Display Technologies Corporation (EDT), therefore enable what's required to support it. Signed-off-by: Fabrizio Castro Acked-by: Laurent Pinchart --- v3->v4: * No change v2->v3: * No change v1->v2: * No change --- arch/arm/configs/shmobile_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig index c6c7035..ab416a5 100644 --- a/arch/arm/configs/shmobile_defconfig +++ b/arch/arm/configs/shmobile_defconfig @@ -66,6 +66,7 @@ CONFIG_INPUT_EVDEV=y CONFIG_KEYBOARD_GPIO=y # CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_EDT_FT5X06=y CONFIG_TOUCHSCREEN_ST1232=y CONFIG_INPUT_MISC=y CONFIG_INPUT_ADXL34X=y @@ -125,7 +126,9 @@ CONFIG_VIDEO_ADV7604=y CONFIG_VIDEO_ML86V7667=y CONFIG_DRM=y CONFIG_DRM_RCAR_DU=y +CONFIG_DRM_PANEL_SIMPLE=y CONFIG_DRM_DUMB_VGA_DAC=y +CONFIG_DRM_LVDS_CODEC=y CONFIG_DRM_SII902X=y CONFIG_DRM_I2C_ADV7511=y CONFIG_DRM_I2C_ADV7511_AUDIO=y From patchwork Wed Nov 13 15:51:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242191 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34B6C1709 for ; Wed, 13 Nov 2019 15:52:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F0F62333D for ; Wed, 13 Nov 2019 15:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728120AbfKMPwm (ORCPT ); Wed, 13 Nov 2019 10:52:42 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:12714 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726074AbfKMPwm (ORCPT ); Wed, 13 Nov 2019 10:52:42 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593960" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:41 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B3A1D400EE6B; Thu, 14 Nov 2019 00:52:36 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 12/13] [HACK] drm/bridge: lvds-codec: Enforce device specific compatible strings Date: Wed, 13 Nov 2019 15:51:31 +0000 Message-Id: <1573660292-10629-13-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The lvds-codec driver is a generic stub for transparent LVDS encoders and decoders. It's good practice to list a device specific compatible string before the generic fallback (if any) in the DT node for the relevant LVDS encoder/decoder, and it's also required by the dt-bindings. A notable exception to the generic fallback mechanism is the case of "thine,thc63lvdm83d", as documented in: Documentation/devicetree/bindings/display/bridge/thine,thc63lvdm83d.txt This patch enforces the adoption of a device specific compatible string (as fist string in the list), by using markers for the compatible string we match against and the index of the matching compatible string in the list. Signed-off-by: Fabrizio Castro --- Hi Laurent, I don't think we need to do anything in the driver to address your comment, as we can "enforce" this with the bindings (please see the next patch, as it would help with the "enforcing" of the compatible string for the thine device). I am sending this patch only so that you can see what a possible solution in the driver could look like. v3->v4: * New patch addressing the below comment from Laurent: "I think the lvds-decoder driver should error out at probe time if only one compatible string is listed." --- drivers/gpu/drm/bridge/lvds-codec.c | 55 +++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c index 784bbd3..145c25d 100644 --- a/drivers/gpu/drm/bridge/lvds-codec.c +++ b/drivers/gpu/drm/bridge/lvds-codec.c @@ -14,11 +14,16 @@ #include #include +struct lvds_codec_data { + u32 connector_type; + bool device_specific; +}; + struct lvds_codec { struct drm_bridge bridge; struct drm_bridge *panel_bridge; struct gpio_desc *powerdown_gpio; - u32 connector_type; + const struct lvds_codec_data *data; }; static int lvds_codec_attach(struct drm_bridge *bridge) @@ -65,7 +70,30 @@ static int lvds_codec_probe(struct platform_device *pdev) if (!lvds_codec) return -ENOMEM; - lvds_codec->connector_type = (u32)of_device_get_match_data(&pdev->dev); + lvds_codec->data = of_device_get_match_data(&pdev->dev); + if (!lvds_codec->data) + return -EINVAL; + + /* + * If we haven't matched a device specific compatible string, we need + * to work out if the generic compatible string we matched against was + * listed first in the compatible property. + */ + if (!lvds_codec->data->device_specific) { + const struct of_device_id *match; + int compatible_index; + + match = of_match_node(dev->driver->of_match_table, + dev->of_node); + compatible_index = of_property_match_string(dev->of_node, + "compatible", + match->compatible); + if (compatible_index == 0) { + dev_err(dev, "Device specific compatible needed\n"); + return -EINVAL; + } + } + lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_HIGH); if (IS_ERR(lvds_codec->powerdown_gpio)) { @@ -92,7 +120,7 @@ static int lvds_codec_probe(struct platform_device *pdev) lvds_codec->panel_bridge = devm_drm_panel_bridge_add_typed(dev, panel, - lvds_codec->connector_type); + lvds_codec->data->connector_type); if (IS_ERR(lvds_codec->panel_bridge)) return PTR_ERR(lvds_codec->panel_bridge); @@ -119,18 +147,33 @@ static int lvds_codec_remove(struct platform_device *pdev) return 0; } +static const struct lvds_codec_data lvds_codec_decoder_data = { + .connector_type = DRM_MODE_CONNECTOR_DPI, + .device_specific = false, +}; + +static const struct lvds_codec_data lvds_codec_encoder_data = { + .connector_type = DRM_MODE_CONNECTOR_LVDS, + .device_specific = false, +}; + +static const struct lvds_codec_data lvds_codec_thc63lvdm83d_data = { + .connector_type = DRM_MODE_CONNECTOR_LVDS, + .device_specific = true, +}; + static const struct of_device_id lvds_codec_match[] = { { .compatible = "lvds-decoder", - .data = (void *)DRM_MODE_CONNECTOR_DPI, + .data = &lvds_codec_decoder_data, }, { .compatible = "lvds-encoder", - .data = (void *)DRM_MODE_CONNECTOR_LVDS, + .data = &lvds_codec_encoder_data, }, { .compatible = "thine,thc63lvdm83d", - .data = (void *)DRM_MODE_CONNECTOR_LVDS, + .data = &lvds_codec_thc63lvdm83d_data, }, {}, }; From patchwork Wed Nov 13 15:51:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11242193 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8960F1709 for ; Wed, 13 Nov 2019 15:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7477C2333F for ; Wed, 13 Nov 2019 15:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbfKMPwr (ORCPT ); Wed, 13 Nov 2019 10:52:47 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:12714 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726074AbfKMPwr (ORCPT ); Wed, 13 Nov 2019 10:52:47 -0500 X-IronPort-AV: E=Sophos;i="5.68,300,1569250800"; d="scan'208";a="31593969" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 14 Nov 2019 00:52:46 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B391E400EE6B; Thu, 14 Nov 2019 00:52:41 +0900 (JST) From: Fabrizio Castro To: Neil Armstrong , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Andrzej Hajda Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , Laurent Pinchart , Peter Rosin , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v4 13/13] [HACK] dt-bindings: display: bridge: lvds-codec: Absorb thine,thc63lvdm83d.txt Date: Wed, 13 Nov 2019 15:51:32 +0000 Message-Id: <1573660292-10629-14-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1573660292-10629-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org At this point in time, compatible string "thine,thc63lvdm83d" is backed by the lvds-codec driver, and the documentation contained in thine,thc63lvdm83d.txt is basically the same as the one contained in lvds-codec.yaml (generic fallback compatible string aside), therefore absorb thine,thc63lvdm83d.txt. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- Hi Laurent, what do you think about this patch? Thanks, Fab v3->v4: * New patch --- .../bindings/display/bridge/lvds-codec.yaml | 5 +-- .../bindings/display/bridge/thine,thc63lvdm83d.txt | 50 ---------------------- 2 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/thine,thc63lvdm83d.txt diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml index 21f8c6e..420bfce 100644 --- a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml @@ -30,9 +30,6 @@ description: | properties: compatible: - description: | - Must list the device specific compatible string first, followed by the - generic compatible string. oneOf: - items: - enum: @@ -44,6 +41,8 @@ properties: - enum: - ti,ds90cf384a # For the DS90CF384A FPD-Link LVDS Receiver - const: lvds-decoder # Generic LVDS decoders compatible fallback + - enum: + - thine,thc63lvdm83d # For the THC63LVDM83D LVDS serializer ports: type: object diff --git a/Documentation/devicetree/bindings/display/bridge/thine,thc63lvdm83d.txt b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvdm83d.txt deleted file mode 100644 index fee3c88..0000000 --- a/Documentation/devicetree/bindings/display/bridge/thine,thc63lvdm83d.txt +++ /dev/null @@ -1,50 +0,0 @@ -THine Electronics THC63LVDM83D LVDS serializer ----------------------------------------------- - -The THC63LVDM83D is an LVDS serializer designed to support pixel data -transmission between a host and a flat panel. - -Required properties: - -- compatible: Should be "thine,thc63lvdm83d" - -Optional properties: - -- powerdown-gpios: Power down control GPIO (the /PWDN pin, active low). - -Required nodes: - -The THC63LVDM83D has two video ports. Their connections are modeled using the -OFgraph bindings specified in Documentation/devicetree/bindings/graph.txt. - -- Video port 0 for CMOS/TTL input -- Video port 1 for LVDS output - - -Example -------- - - lvds_enc: encoder@0 { - compatible = "thine,thc63lvdm83d"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - lvds_enc_in: endpoint@0 { - remote-endpoint = <&rgb_out>; - }; - }; - - port@1 { - reg = <1>; - - lvds_enc_out: endpoint@0 { - remote-endpoint = <&panel_in>; - }; - }; - }; - };