From patchwork Thu May 14 14:36:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= X-Patchwork-Id: 11548931 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 EFDDD138A for ; Thu, 14 May 2020 14:38:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CB93E2070A for ; Thu, 14 May 2020 14:38:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JLbXd/y8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB93E2070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gIAa1JRG1SDHh5OEFXqGIeu0ok0hDO31MWGwNM2/CvU=; b=JLbXd/y81qvZjB Ybq5ECyK8xt8vdkTwfoww1rgYSKXUyGn1HjHF6ViNKj/yCb5XtwE0t4eSBJ9YkZ7+J3sZuJPfWYEs DvBovy5jOpgPSDprFcPGETtKq8+PxDiJlyua3Fctmu7zoTuW/iXfezRqLz/FUKFmvcFAtBRbhCndr BQJQcNy/EBbDSWX8YzNkNuFWUZtDejdGow+Dk1bcy8avNX8/xwB9cy+Yb//zuDh61H9CNA6n1SJH3 Kabcyo/6JGxJwpP+NYQ27T9UM74G66sGQRqrPUPshp0DK+FLAw2EwUoQHVF6NdI/a4DgZzgq93wAx PFtd3R0jOvIAQe5/kddA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZF0J-0006LS-RM; Thu, 14 May 2020 14:38:31 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEyT-0004qj-Jc for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 14:36:43 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id 5D1B42A2EE1 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v2 1/4] ARM: dts: dove: Make the DT compliant with the ti, tfp410 binding Date: Thu, 14 May 2020 16:36:09 +0200 Message-Id: <20200514143612.2094-2-ricardo.canuelo@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200514143612.2094-1-ricardo.canuelo@collabora.com> References: <20200514143612.2094-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_073637_777584_B9048B9F X-CRM114-Status: GOOD ( 10.36 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, jason@lakedaemon.net, airlied@linux.ie, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, tomi.valkeinen@ti.com, kernel@collabora.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Define a 'ports' node for 'dvi: video@39' and use the proper naming for the powerdown-gpios property to make it compliant with the ti,tfp410 binding. This fills the minimum requirements to meet the binding requirements, port endpoints are not defined. Signed-off-by: Ricardo Cañuelo --- arch/arm/boot/dts/dove-sbc-a510.dts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/dove-sbc-a510.dts b/arch/arm/boot/dts/dove-sbc-a510.dts index 2bb85a9b7614..32804c981625 100644 --- a/arch/arm/boot/dts/dove-sbc-a510.dts +++ b/arch/arm/boot/dts/dove-sbc-a510.dts @@ -132,7 +132,18 @@ dvi: video@39 { compatible = "ti,tfp410"; reg = <0x39>; - powerdown-gpio = <&gpio_ext 3 GPIO_ACTIVE_LOW>; + powerdown-gpios = <&gpio_ext 3 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + }; + port@1 { + reg = <1>; + }; + }; }; }; From patchwork Thu May 14 14:36:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= X-Patchwork-Id: 11548923 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 AE9F4913 for ; Thu, 14 May 2020 14:37:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 67EF52070A for ; Thu, 14 May 2020 14:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e+TN0TqU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67EF52070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cQd7OP97ByfVM7tF3auA2juEJcHJsyHDELOK1L1a0qk=; b=e+TN0TqU1fylmc yz8scT2Af6GaDUoAr2I2mGe+hB29UOAq8hsSYXtDOUEyE2E6VePGuyyU4DeowtP3N1S4ikCI0GKjP sVxvk4yWlmtAAylha/Hy5p1biQV0DUhnvzeyY/TvMy1X8VtOueUmXlIQ9Ym6FK7jhpJXi4ZVXU0nb Z2Uohho6LDqvEdAghzu670ARasOqwp4p/HmZu7alNTTLiUzVkalZd+VGtfQjOjfGYHln8uHgt/SZ/ tbxZKuvfqZEoCkRV5KVhpX235F+X/GjtZR3mDTO/yH3CNEExn+AoNRJHgQuLiJxSE4z1VB3zK6Z4B 45hMuRiEtr+hue9ZQMMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEzc-0005lz-Vd; Thu, 14 May 2020 14:37:49 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEyS-0004rt-V9 for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 14:36:43 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id 2E8ED2A2EE6 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v2 2/4] ARM: dts: ims53: Group port definitions for the dvi-converter Date: Thu, 14 May 2020 16:36:10 +0200 Message-Id: <20200514143612.2094-3-ricardo.canuelo@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200514143612.2094-1-ricardo.canuelo@collabora.com> References: <20200514143612.2094-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_073637_304189_44978E49 X-CRM114-Status: UNSURE ( 9.68 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, jason@lakedaemon.net, airlied@linux.ie, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, tomi.valkeinen@ti.com, kernel@collabora.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Group the port definitions of the dvi-converter in a 'ports' node to make it compliant with the ti,tfp410 binding. Signed-off-by: Ricardo Cañuelo --- arch/arm/boot/dts/imx53-cx9020.dts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/arch/arm/boot/dts/imx53-cx9020.dts b/arch/arm/boot/dts/imx53-cx9020.dts index 0a475c234054..cfb18849a92b 100644 --- a/arch/arm/boot/dts/imx53-cx9020.dts +++ b/arch/arm/boot/dts/imx53-cx9020.dts @@ -59,23 +59,26 @@ }; dvi-converter { - #address-cells = <1>; - #size-cells = <0>; compatible = "ti,tfp410"; - port@0 { - reg = <0>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; - tfp410_in: endpoint { - remote-endpoint = <&display0_out>; + tfp410_in: endpoint { + remote-endpoint = <&display0_out>; + }; }; - }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - tfp410_out: endpoint { - remote-endpoint = <&dvi_connector_in>; + tfp410_out: endpoint { + remote-endpoint = <&dvi_connector_in>; + }; }; }; }; From patchwork Thu May 14 14:36:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= X-Patchwork-Id: 11548933 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 68E26913 for ; Thu, 14 May 2020 14:39:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 438B6205CB for ; Thu, 14 May 2020 14:39:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HX09byup" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 438B6205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dE4o2YCRIWAHrwpdjHZCIY9OKU/U9GgPxiHUFY3A8zw=; b=HX09byupvi+EfZ qDP4AQInw+W17tS9fmIzqObX/wvMNL0YFDU23qPg11dZCc0yRl+ekJmA+2iHtKm2oTSsDNF37qu3f V1QIBi3UrSu0LNtr8WZFfSDFIYpdWkdhAc5d4PeP7o/oWVMh2Hlb+zvQbPnvZ9PTeLd1Q+E6c8Kim u4K0dgGhdQ/z3RTLa8vi4xkIjw22+5Q6d+XTB1sZS9bWwvy+BON6/xj7uOWiakXsulEzLumP18rv3 GQbcUQsYKQbUPBqVl1b8REQwOub1imrwMhAUZO7+q1IJSrQsDHLUjEZv0SYX3HwUvf+nWcsLAOIJt AH83uca0r7E1bAhGPoEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZF0h-0006dN-67; Thu, 14 May 2020 14:38:55 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEyU-0004sZ-1f for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 14:36:45 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id 0FB972A2EF2 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v2 3/4] dt-bindings: display: ti,tfp410.txt: convert to yaml Date: Thu, 14 May 2020 16:36:11 +0200 Message-Id: <20200514143612.2094-4-ricardo.canuelo@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200514143612.2094-1-ricardo.canuelo@collabora.com> References: <20200514143612.2094-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_073638_381883_61BAEE86 X-CRM114-Status: GOOD ( 16.71 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, jason@lakedaemon.net, airlied@linux.ie, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, tomi.valkeinen@ti.com, kernel@collabora.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Convert the DT binding documentation for the TI TFP410 DPI-to-DVI encoder to json-schema. The 'ti,deskew' is now an unsigned value from 0 to 7 instead of a signed value from -4 to 3. The rest of the binding is a direct translation from the old one. Signed-off-by: Ricardo Cañuelo Reviewed-by: Laurent Pinchart --- .../bindings/display/bridge/ti,tfp410.txt | 66 ---------- .../bindings/display/bridge/ti,tfp410.yaml | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 66 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/ti,tfp410.txt create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/ti,tfp410.txt b/Documentation/devicetree/bindings/display/bridge/ti,tfp410.txt deleted file mode 100644 index 5ff4f64ef8e8..000000000000 --- a/Documentation/devicetree/bindings/display/bridge/ti,tfp410.txt +++ /dev/null @@ -1,66 +0,0 @@ -TFP410 DPI to DVI encoder -========================= - -Required properties: -- compatible: "ti,tfp410" - -Optional properties: -- powerdown-gpios: power-down gpio -- reg: I2C address. If and only if present the device node should be placed - into the I2C controller node where the TFP410 I2C is connected to. -- ti,deskew: data de-skew in 350ps increments, from -4 to +3, as configured - through th DK[3:1] pins. This property shall be present only if the TFP410 - is not connected through I2C. - -Required nodes: - -This device has two video ports. Their connections are modeled using the OF -graph bindings specified in [1]. Each port node shall have a single endpoint. - -- Port 0 is the DPI input port. Its endpoint subnode shall contain a - pclk-sample and bus-width property and a remote-endpoint property as specified - in [1]. - - If pclk-sample is not defined, pclk-sample = 0 should be assumed for - backward compatibility. - - If bus-width is not defined then bus-width = 24 should be assumed for - backward compatibility. - bus-width = 24: 24 data lines are connected and single-edge mode - bus-width = 12: 12 data lines are connected and dual-edge mode - -- Port 1 is the DVI output port. Its endpoint subnode shall contain a - remote-endpoint property is specified in [1]. - -[1] Documentation/devicetree/bindings/media/video-interfaces.txt - - -Example -------- - -tfp410: encoder@0 { - compatible = "ti,tfp410"; - powerdown-gpios = <&twl_gpio 2 GPIO_ACTIVE_LOW>; - ti,deskew = <4>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - tfp410_in: endpoint@0 { - pclk-sample = <1>; - bus-width = <24>; - remote-endpoint = <&dpi_out>; - }; - }; - - port@1 { - reg = <1>; - - tfp410_out: endpoint@0 { - remote-endpoint = <&dvi_connector_in>; - }; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml b/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml new file mode 100644 index 000000000000..a9f4fd8ea621 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/ti,tfp410.yaml @@ -0,0 +1,124 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/ti,tfp410.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TFP410 DPI to DVI encoder + +maintainers: + - Tomi Valkeinen + - Jyri Sarha + +properties: + compatible: + const: ti,tfp410 + + reg: + description: I2C address of the device. + maxItems: 1 + + powerdown-gpios: + maxItems: 1 + + ti,deskew: + description: + Data de-skew value in 350ps increments, from 0 to 7, as configured + through the DK[3:1] pins. The de-skew multiplier is computed as + (DK[3:1] - 4), so it ranges from -4 to 3. This property shall be + present only if the TFP410 is not connected through I2C. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 7 + + ports: + description: + A node containing input and output port nodes with endpoint + definitions as documented in + Documentation/devicetree/bindings/media/video-interfaces.txt + type: object + + properties: + port@0: + description: DPI input port. + type: object + + properties: + reg: + const: 0 + + endpoint: + type: object + + properties: + pclk-sample: + description: + Endpoint sampling edge. If not defined, pclk-sample = + 0 should be assumed for backwards compatibility. + enum: + - 0 # Falling edge + - 1 # Rising edge + default: 0 + + bus-width: + description: + Endpoint bus width. If not defined, bus-width = 24 + should be assumed for backwards compatibility. + enum: + - 12 # 12 data lines connected and dual-edge mode + - 24 # 24 data lines connected and single-edge mode + default: 24 + + port@1: + description: DVI output port. + type: object + + properties: + reg: + const: 1 + + endpoint: + type: object + + required: + - port@0 + - port@1 + +required: + - compatible + - ports + +additionalProperties: false + +examples: + - | + #include + + tfp410: encoder { + compatible = "ti,tfp410"; + powerdown-gpios = <&twl_gpio 2 GPIO_ACTIVE_LOW>; + ti,deskew = <3>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + tfp410_in: endpoint { + pclk-sample = <1>; + bus-width = <24>; + remote-endpoint = <&dpi_out>; + }; + }; + + port@1 { + reg = <1>; + tfp410_out: endpoint { + remote-endpoint = <&dvi_connector_in>; + }; + }; + }; + }; + +... From patchwork Thu May 14 14:36:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= X-Patchwork-Id: 11548927 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 F3727913 for ; Thu, 14 May 2020 14:38:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C2E3D20728 for ; Thu, 14 May 2020 14:38:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="psilI10S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E3D20728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1OwytWpFX1FGZZFyQijCoMV//5O0ySOOLyJ4LHBdce4=; b=psilI10SqF/7kJ cVBlQSvzNFiyABhCXLchPeUa6fV78dP4xpNT9bm2VoIsWsUIEIocSvvyGvWiwnk4AZe4eHuiiH7KU +lEn0uF88ANqf4gTirsksRGb0XvXEOVGFyyqJraH5dKgYq/ztf1EhQCsLUMJ9RERWHU+9q+yWOoAO WKU2wnzSjMQrR2HZQo2d/nhy0OVnOjAZslLAjAuNP6DGdFZqZRbdEugOQP8qA086pVzqpQLtJDslc Pg2EgW9xvzQ9O07v73ylfCtvzjV2vqhPGQXFPJrFLxjrnJyja6KmMVzp64bTIa9i2HgLgQ7S+RjYf 0C3ioWyPT4TcjImAp+ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZF00-00064j-Lt; Thu, 14 May 2020 14:38:12 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEyU-0004tY-HP for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 14:36:45 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id DE0952A2EE9 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v2 4/4] drm/bridge: tfp410: Fix setup and hold time calculation Date: Thu, 14 May 2020 16:36:12 +0200 Message-Id: <20200514143612.2094-5-ricardo.canuelo@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200514143612.2094-1-ricardo.canuelo@collabora.com> References: <20200514143612.2094-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_073638_714210_99A010C7 X-CRM114-Status: GOOD ( 12.81 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, jason@lakedaemon.net, airlied@linux.ie, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, tomi.valkeinen@ti.com, kernel@collabora.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The tfp410 has a data de-skew feature that allows the user to compensate the skew between IDCK and the pixel data and control signals. In the driver, the setup and hold times are calculated from the de-skew value. This retrieves the deskew value from the DT using the proper datatype and range check as described by the binding (u32 from 0 to 7) and fixes the calculation of the setup and hold times. Signed-off-by: Ricardo Cañuelo Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-tfp410.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index e3eb6364c0f7..21d99b4ea0c9 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -220,7 +220,7 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) struct device_node *ep; u32 pclk_sample = 0; u32 bus_width = 24; - s32 deskew = 0; + u32 deskew = 0; /* Start with defaults. */ *timings = tfp410_default_timings; @@ -274,12 +274,12 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) } /* Get the setup and hold time from vendor-specific properties. */ - of_property_read_u32(dvi->dev->of_node, "ti,deskew", (u32 *)&deskew); - if (deskew < -4 || deskew > 3) + of_property_read_u32(dvi->dev->of_node, "ti,deskew", &deskew); + if (deskew > 7) return -EINVAL; - timings->setup_time_ps = min(0, 1200 - 350 * deskew); - timings->hold_time_ps = min(0, 1300 + 350 * deskew); + timings->setup_time_ps = 1200 - 350 * ((s32)deskew - 4); + timings->hold_time_ps = max(0, 1300 + 350 * ((s32)deskew - 4)); return 0; }