From patchwork Sat Dec 2 07:54:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E192FC4167B for ; Sat, 2 Dec 2023 07:57:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBAB510E105; Sat, 2 Dec 2023 07:57:21 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1AA510E105 for ; Sat, 2 Dec 2023 07:57:19 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id EBB176049B; Sat, 2 Dec 2023 07:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701503839; bh=HWs1Jb+EiXvhQNMp0z9SgweFLx0LNj+D/nipqQhZAMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YbxoMeljA7L0qrMnf61jyzqqMeU1RU8ZxpxkEocWsmKy98DtzTWYRE9Ihngn5DCc0 HmnPZlTJrux6wYLxVacZCRtnuk2FVMGK43TMrOfzfPsy1gK3R4vhE6p/SnF1XyLHij KJdpgU+QOS5WkPRBxd+U0+gTT46gEPTImAT4kh6NYOXpw1sBMTmjrRIue6qQL5TZHC 24qPp8D8uHn5DT3QbH9qWzlNtETRynG7WJTU8A4DQw7uK38/ST7Mtc6eWpe+mqrln6 Wk/Btmmdd+vON3MFfk74JWXkJuA0IDP1yyKKOIR4yDAs3AWcpgQYDQKzDItro77Lp4 /p7OD9mNwERCA== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 01/10] dt-bindings: display: bridge: tc358775: make stby gpio and vdd supplies optional Date: Sat, 2 Dec 2023 09:54:40 +0200 Message-ID: <20231202075514.44474-2-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Michael Walle , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Michael Walle For a normal operation, the vdd supplies nor the stby GPIO is needed. There are boards, where these voltages are statically enabled during board power-up. The reset pin is required because once the PPI (PHY protocol interface) is started, it can only be stopped by asserting the reset pin. Signed-off-by: Michael Walle Signed-off-by: Tony Lindgren --- .../devicetree/bindings/display/bridge/toshiba,tc358775.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml @@ -68,9 +68,6 @@ properties: required: - compatible - reg - - vdd-supply - - vddio-supply - - stby-gpios - reset-gpios - ports From patchwork Sat Dec 2 07:54:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8368CC4167B for ; Sat, 2 Dec 2023 07:58:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6EA810E111; Sat, 2 Dec 2023 07:58:31 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id E632A10E10D for ; Sat, 2 Dec 2023 07:58:11 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 31C0D60406; Sat, 2 Dec 2023 07:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701503890; bh=pYZDqv60J0kWtQmrHNDGXYKDdbKD0ihTl1dkeCNc3YY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FfrmXavKTVtsrOQZGM6nHFamXh1BERMhcSsO/Dk31xYwoubD37esSl9aizRlyp6rT AEbSxWZDipGJmS6OxfVuLNE9SzceegNG9p3V37z5F1IBo/PPSjwE72e+hmF6TmlfZn Selk/G7p0kWGUrEEZPJHtxmtw0UPYTX6tFG+S1I4J/YG/DGZAptajBbg+zLDFEwqsL kmwWNOTiMxgTkSfPIh9OuQiT8QnJzaJx6VDv6oINnr66yzoxXKFr1qPY4As+XHjc2e qGhsbLuyYwrMao4RozTQ8BnlcENMNopECg9bKAUkXvhD0BcQjCpyvOVvHC9X6SBFPS 9proOG5au1oxg== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 02/10] dt-bindings: display: bridge: tc358775: Add data-lanes Date: Sat, 2 Dec 2023 09:54:41 +0200 Message-ID: <20231202075514.44474-3-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The device uses a clock lane, and 1 to 4 DSI data lanes. Let's add the data-lanes property starting at 1 similar to what the other bridge bindings are doing. Let's also drop the data-lanes properties in the example for the DSI host controller to avoid confusion. The configuration of the DSI host depends on the controller used and is unrelated to the bridge binding. Signed-off-by: Tony Lindgren --- .../display/bridge/toshiba,tc358775.yaml | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml @@ -46,11 +46,26 @@ properties: properties: port@0: - $ref: /schemas/graph.yaml#/properties/port + $ref: /schemas/graph.yaml#/$defs/port-base description: | DSI Input. The remote endpoint phandle should be a reference to a valid mipi_dsi_host device node. + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + description: array of physical DSI data lane indexes. + minItems: 1 + items: + - const: 1 + - const: 2 + - const: 3 + - const: 4 + port@1: $ref: /schemas/graph.yaml#/properties/port description: | @@ -105,6 +120,7 @@ examples: reg = <0>; d2l_in_test: endpoint { remote-endpoint = <&dsi0_out>; + data-lanes = <1 2 3 4>; }; }; @@ -129,7 +145,6 @@ examples: reg = <1>; dsi0_out: endpoint { remote-endpoint = <&d2l_in_test>; - data-lanes = <0 1 2 3>; }; }; }; @@ -164,6 +179,7 @@ examples: reg = <0>; d2l_in_dual: endpoint { remote-endpoint = <&dsi0_out_dual>; + data-lanes = <1 2 3 4>; }; }; @@ -195,7 +211,6 @@ examples: reg = <1>; dsi0_out_dual: endpoint { remote-endpoint = <&d2l_in_dual>; - data-lanes = <0 1 2 3>; }; }; }; From patchwork Sat Dec 2 07:54:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8FF4C4167B for ; Sat, 2 Dec 2023 07:59:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06DFC10E10D; Sat, 2 Dec 2023 07:59:06 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD66F10E10D for ; Sat, 2 Dec 2023 07:59:02 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 81C4A6049B; Sat, 2 Dec 2023 07:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701503942; bh=rEXaXAhXwZV+HLFAqao2ZWgjh9PzKE9IueUq6diAur0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ipxoBr9szrJ1580a2P3vmS0f97vS35GSvUBZHRs+JEYxbGxMbnebyOIyvr/W25FoB L9vCzk0l3vEK06ZC+cHJKew8mWwYNbek5xET5+SBRzkc1ScZVa/E2eWMbZFpoPhsWT 6vAKTDq4ItTCdKmrQGooQ3JUt/2aYaUoj32mztJEgOdmIzyo4NMu1GoTmHLNZv2uaj Rx43+YYslSXfsjHlwgjMk0MQiTy814Vx1EJ0wkpqJoHsCzuqqDmFnhxk4/pBaEV5or 0s+KF9hhhULaE0jLGwNp9KeQPuSdFCwMcMgTGZtyZ7ZdNskhedXt5f40f5MN6k4+vx Frqu1DnfdeiTA== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 03/10] dt-bindings: display: bridge: tc358775: Add support for tc358765 Date: Sat, 2 Dec 2023 09:54:42 +0200 Message-ID: <20231202075514.44474-4-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The tc358765 is similar to tc358775 except for the stdby-gpios. Signed-off-by: Tony Lindgren --- .../bindings/display/bridge/toshiba,tc358775.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml @@ -10,7 +10,7 @@ maintainers: - Vinay Simha BN description: | - This binding supports DSI to LVDS bridge TC358775 + This binding supports DSI to LVDS bridges TC358765 and TC358775 MIPI DSI-RX Data 4-lane, CLK 1-lane with data rates up to 800 Mbps/lane. Video frame size: @@ -21,7 +21,9 @@ description: | properties: compatible: - const: toshiba,tc358775 + enum: + - toshiba,tc358765 + - toshiba,tc358775 reg: maxItems: 1 From patchwork Sat Dec 2 07:54:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90AF5C4167B for ; Sat, 2 Dec 2023 08:00:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFB8610E163; Sat, 2 Dec 2023 08:00:01 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id B693210E163 for ; Sat, 2 Dec 2023 07:59:56 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 245B960406; Sat, 2 Dec 2023 07:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701503995; bh=uzjo2RffcTjEgLjSPgLgkOnLraYa1xWcykd73MjR6DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSS6y3aG5Nmd3CTW/8w94etvMkWFx7rd5+Kef+EKIjmDx5WUYXBIiU5z/P8jo6W1o 2ZSBxiytYlxr1suGV2p7yooFiXrHNVQt1bSYFBbgRvMkrlBmn6/EjHBziod6Sgtiox T8/3EL/WK3Tz6PRlQTCBf+tF7qlJVqjWtg/ZtreAzENtS+zob7oFuZHw6IVgV7Ds0z Mz4yBb4dv98+6hxxwKxucovKCMeIrMugto0mvmYF0kKvPYJm+x/CFrOtyBOe4MiAUB u8U4W8/nEI/JhPiJXMM6qTPWqEtyF38hLd6BeoUA9lDJHKnSWQM9y1WPXxNdAcplCT BehrAj8uo8Org== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 04/10] drm/bridge: tc358775: fix support for jeida-18 and jeida-24 Date: Sat, 2 Dec 2023 09:54:43 +0200 Message-ID: <20231202075514.44474-5-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Michael Walle , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Michael Walle The bridge always uses 24bpp internally. Therefore, for jeida-18 mapping we need to discard the lowest two bits for each channel and thus starting with LV_[RGB]2. jeida-24 has the same mapping but uses four lanes instead of three, with the forth pair transmitting the lowest two bits of each channel. Thus, the mapping between jeida-18 and jeida-24 is actually the same, except that one channel is turned off (by selecting the RGB666 format in VPCTRL). While at it, remove the bogus comment about the hardware default because the default is overwritten in any case. Tested with a jeida-18 display (Evervision VGG644804). Fixes: b26975593b17 ("display/drm/bridge: TC358775 DSI/LVDS driver") Signed-off-by: Michael Walle Signed-off-by: Tony Lindgren --- drivers/gpu/drm/bridge/tc358775.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -454,10 +454,6 @@ static void tc_bridge_enable(struct drm_bridge *bridge) dev_dbg(tc->dev, "bus_formats %04x bpc %d\n", connector->display_info.bus_formats[0], tc->bpc); - /* - * Default hardware register settings of tc358775 configured - * with MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA jeida-24 format - */ if (connector->display_info.bus_formats[0] == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG) { /* VESA-24 */ @@ -468,14 +464,15 @@ static void tc_bridge_enable(struct drm_bridge *bridge) d2l_write(tc->i2c, LV_MX1619, LV_MX(LVI_B6, LVI_B7, LVI_B1, LVI_B2)); d2l_write(tc->i2c, LV_MX2023, LV_MX(LVI_B3, LVI_B4, LVI_B5, LVI_L0)); d2l_write(tc->i2c, LV_MX2427, LV_MX(LVI_HS, LVI_VS, LVI_DE, LVI_R6)); - } else { /* MEDIA_BUS_FMT_RGB666_1X7X3_SPWG - JEIDA-18 */ - d2l_write(tc->i2c, LV_MX0003, LV_MX(LVI_R0, LVI_R1, LVI_R2, LVI_R3)); - d2l_write(tc->i2c, LV_MX0407, LV_MX(LVI_R4, LVI_L0, LVI_R5, LVI_G0)); - d2l_write(tc->i2c, LV_MX0811, LV_MX(LVI_G1, LVI_G2, LVI_L0, LVI_L0)); - d2l_write(tc->i2c, LV_MX1215, LV_MX(LVI_G3, LVI_G4, LVI_G5, LVI_B0)); - d2l_write(tc->i2c, LV_MX1619, LV_MX(LVI_L0, LVI_L0, LVI_B1, LVI_B2)); - d2l_write(tc->i2c, LV_MX2023, LV_MX(LVI_B3, LVI_B4, LVI_B5, LVI_L0)); - d2l_write(tc->i2c, LV_MX2427, LV_MX(LVI_HS, LVI_VS, LVI_DE, LVI_L0)); + } else { + /* JEIDA-18 and JEIDA-24 */ + d2l_write(tc->i2c, LV_MX0003, LV_MX(LVI_R2, LVI_R3, LVI_R4, LVI_R5)); + d2l_write(tc->i2c, LV_MX0407, LV_MX(LVI_R6, LVI_R1, LVI_R7, LVI_G2)); + d2l_write(tc->i2c, LV_MX0811, LV_MX(LVI_G3, LVI_G4, LVI_G0, LVI_G1)); + d2l_write(tc->i2c, LV_MX1215, LV_MX(LVI_G5, LVI_G6, LVI_G7, LVI_B2)); + d2l_write(tc->i2c, LV_MX1619, LV_MX(LVI_B0, LVI_B1, LVI_B3, LVI_B4)); + d2l_write(tc->i2c, LV_MX2023, LV_MX(LVI_B5, LVI_B6, LVI_B7, LVI_L0)); + d2l_write(tc->i2c, LV_MX2427, LV_MX(LVI_HS, LVI_VS, LVI_DE, LVI_R0)); } d2l_write(tc->i2c, VFUEN, VFUEN_EN); From patchwork Sat Dec 2 07:54:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45ED0C4167B for ; Sat, 2 Dec 2023 08:01:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F24EE10E185; Sat, 2 Dec 2023 08:01:08 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60EEC10E18C for ; Sat, 2 Dec 2023 08:00:49 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 694A660406; Sat, 2 Dec 2023 07:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504048; bh=gfNY2ft9C7j+wyb5biC9lBAtvg1/clPo7kd6qvdc/T0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZRHctGPNMRiHvQ75yXgnfok/PcHBjEknCpa+5eAOmv/PjFP7Z6ADxo/QLQn/Ir5I V7YAJ62dNOjGOfHmgqGXEqog8/uJAQvd4nPKbYfHv8XuJKicZNvX0bcwQt+CrS7ogg gkjNgVqI2KPjt6XuXQxSEHTK6PqM4VNWgtKebjA14hAYz0GTQjkT+O1Hrxdewe9l7t U2jcY7245M0j7aEwShrFXEa1AHugy25U/kUt+/5MM6tLU2agdWqLhR6nmIaDWM3glW W4Ok19V5ikpon3qo2Ym1Liw5TPZHPR5wjEuoZTrS3VQUUTszIukFtVtmzXb8rgGHHk DPu0UW1N2eH5w== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 05/10] drm/bridge: tc358775: make standby GPIO optional Date: Sat, 2 Dec 2023 09:54:44 +0200 Message-ID: <20231202075514.44474-6-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Michael Walle , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Michael Walle The stby pin is optional. It is only needed for power-up and down sequencing. It is not needed, if the power rails cannot by dynamically enabled. Because the GPIO is not optional, remove the error message. Signed-off-by: Michael Walle Signed-off-by: Tony Lindgren Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/tc358775.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -669,12 +669,9 @@ static int tc_probe(struct i2c_client *client) return ret; } - tc->stby_gpio = devm_gpiod_get(dev, "stby", GPIOD_OUT_HIGH); - if (IS_ERR(tc->stby_gpio)) { - ret = PTR_ERR(tc->stby_gpio); - dev_err(dev, "cannot get stby-gpio %d\n", ret); - return ret; - } + tc->stby_gpio = devm_gpiod_get_optional(dev, "stby", GPIOD_OUT_HIGH); + if (IS_ERR(tc->stby_gpio)) + return PTR_ERR(tc->stby_gpio); tc->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(tc->reset_gpio)) { From patchwork Sat Dec 2 07:54:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E58EDC10DCE for ; Sat, 2 Dec 2023 08:01:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F03D10E181; Sat, 2 Dec 2023 08:01:56 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6549D10E178 for ; Sat, 2 Dec 2023 08:01:52 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id CBDC26049B; Sat, 2 Dec 2023 08:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504111; bh=UnEeMpuqNGMIxtPB+snGTp0U20oNxmhtzN8lnS3gXxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccYfKS5QpAwx1xQNGrAOSh/CDp9WChuVNlmfdbOtCoaDs2Rp+grj3KPJKs8NcWz3j Bv9eQUqo+Fjb+81uFavZIDt4bWaFziHcrgFA+L8Ffaq07Wgyl0BArZnwzTg1oL4CPm UfFHIS1vao4n7Bv02fYblVyKi+DMaSTYOv0KL8fVvCyHRSxLKIcZtlssoHRQjRXtHZ 7Q/DNx8yenvP6Y9/RHjO6P1YvhKxMM1Fcadbeq5nVkGilnqwJ9oVxP28o6eiPNO+UT qMA7sIZ496F34PYF6LuUKdh+ay9hVmAtQ+yI/sn+bkloL8SBjwnKZ6yOc1hbtBbcrs 7V7kXFgN5ut0g== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 06/10] drm/bridge: tc358775: Get bridge data lanes instead of the DSI host lanes Date: Sat, 2 Dec 2023 09:54:45 +0200 Message-ID: <20231202075514.44474-7-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current code assumes the data-lanes property is configured on the DSI host side instead of the bridge side, and assumes DSI host endpoint 1. Let's standardize on what the other bridge drivers are doing and parse the data-lanes property for the bridge. Only if data-lanes property is not found, let's be nice and also check the DSI host for old dtb in use and warn. Signed-off-by: Tony Lindgren Reviewed-by: Dmitry Baryshkov Reviewed-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -525,27 +525,24 @@ tc_mode_valid(struct drm_bridge *bridge, static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc) { struct device_node *endpoint; - struct device_node *parent; struct device_node *remote; int dsi_lanes = -1; - /* - * To get the data-lanes of dsi, we need to access the dsi0_out of port1 - * of dsi0 endpoint from bridge port0 of d2l_in - */ endpoint = of_graph_get_endpoint_by_regs(tc->dev->of_node, TC358775_DSI_IN, -1); - if (endpoint) { - /* dsi0_out node */ - parent = of_graph_get_remote_port_parent(endpoint); - of_node_put(endpoint); - if (parent) { - /* dsi0 port 1 */ - dsi_lanes = drm_of_get_data_lanes_count_ep(parent, 1, -1, 1, 4); - of_node_put(parent); - } + dsi_lanes = drm_of_get_data_lanes_count(endpoint, 1, 4); + + /* Quirk old dtb: Use data lanes from the DSI host side instead of bridge */ + if (dsi_lanes == -EINVAL || dsi_lanes == -ENODEV) { + remote = of_graph_get_remote_endpoint(endpoint); + dsi_lanes = drm_of_get_data_lanes_count(remote, 1, 4); + of_node_put(remote); + if (dsi_lanes >= 1) + dev_warn(tc->dev, "missing dsi-lanes property for the bridge\n"); } + of_node_put(endpoint); + if (dsi_lanes < 0) return dsi_lanes; From patchwork Sat Dec 2 07:54:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB33FC4167B for ; Sat, 2 Dec 2023 08:03:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B88110E197; Sat, 2 Dec 2023 08:02:52 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E9E810E18C for ; Sat, 2 Dec 2023 08:02:43 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id A1C5860406; Sat, 2 Dec 2023 08:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504163; bh=XX98Cqt5NzbeNpKXwhQvSO72W3DmrA1+cXFaVWu20AI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2iY1w9hQzsJd6tsprr6wAbF7NSTBwi9g4G5xWnC5Nht4jWdrjnuDmjFAkg8y3GbT omPnGkj0dZlvuTjaI+HaCbIFiP+PkEZoO8QTgRmsFMJOxj2uSDiAZzBAOZuW5W2LV3 FqPUafnNfYPiSgMlBXyse73WO91TF2XBgyBhd13bvfO9TljQoln+xNlbXMrnklOnSZ GLWyHnHxZGLS/zfbFP1LsS8kgo17btlbH7hDZs8SN9N3Ez3FwhPvIkrmF2jPHYJudz 5GdbCRYPxvNFYYEkmcAgPDdm2nEhkDDZFgLwwwIY+BtOGkJ1o/54+76WY/vz2B/A/x P8fnjymCeFKkQ== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 07/10] drm/bridge: tc358775: Add burst and low-power modes Date: Sat, 2 Dec 2023 09:54:46 +0200 Message-ID: <20231202075514.44474-8-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Burst and low-power modes are supported both for tc358765 and tc358775. Signed-off-by: Tony Lindgren Reviewed-by: Michael Walle Tested-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -619,7 +619,8 @@ static int tc_attach_host(struct tc_data *tc) dsi->lanes = tc->num_dsi_lanes; dsi->format = MIPI_DSI_FMT_RGB888; - dsi->mode_flags = MIPI_DSI_MODE_VIDEO; + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM; ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { From patchwork Sat Dec 2 07:54:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFE1FC10DCE for ; Sat, 2 Dec 2023 08:03:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 742A210E18C; Sat, 2 Dec 2023 08:03:47 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 786D210E96A for ; Sat, 2 Dec 2023 08:03:35 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 082016049B; Sat, 2 Dec 2023 08:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504214; bh=APkUpUjdG6p2BEFI0aefXVu4L/0Kmz7mGVrA3hsZlwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKktrYYUsJXcuVe4F9Du17ZZLWmMXcEksUnVV5+Q2DZJ+SLdDAtRzdkRe/UlM/AEG SomfsvhEhIJkHcUjsgVfgAdkhXHFk9aszV+2zdSs3SrcXztaq/QT0xPKS+uV+w1b+6 3mzGsB+TiWIQsHhfPK/pZ/+ocJR1uvF+hcBiVHsTmPYHKDBgsd8wwWbIp+sS/5AJt+ s2RNmjv7RmsBF4w/e6YRCWbUcZsbuRYdcVMWtWmLinzhMto6XMIc9GBRK9xdyU4BKN UMX38B3LbjLlOwDq39zJcXEZoUo7GnBjyI7r7kmh4tjRF0HJ0xxhauWxOnMk+KZA+S 67uoKbjLOIC3w== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 08/10] drm/bridge: tc358775: Enable pre_enable_prev_first flag Date: Sat, 2 Dec 2023 09:54:47 +0200 Message-ID: <20231202075514.44474-9-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Set pre_enable_prev_first to ensure the previous bridge is enabled first. Signed-off-by: Tony Lindgren Reviewed-by: Dmitry Baryshkov Reviewed-by: Michael Walle Tested-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -680,6 +680,7 @@ static int tc_probe(struct i2c_client *client) tc->bridge.funcs = &tc_bridge_funcs; tc->bridge.of_node = dev->of_node; + tc->bridge.pre_enable_prev_first = true; drm_bridge_add(&tc->bridge); i2c_set_clientdata(client, tc); From patchwork Sat Dec 2 07:54:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F9E7C4167B for ; Sat, 2 Dec 2023 08:04:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99A4310E17F; Sat, 2 Dec 2023 08:04:28 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7264310E17F for ; Sat, 2 Dec 2023 08:04:26 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 6376260406; Sat, 2 Dec 2023 08:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504265; bh=i5hlFOUrpipsKtqPCP9/VPweATC36VuKIXOSxW9v2SU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UojeGNFbTAsiDIuJzBBUldx5ei8dPsxKU9ILNfIOVlTRSa04vwswLq2nBw272uT8r N7U0yKFzOrNhkwqB89/Hjz57Owff2TRNomWSyWxU11f2sg1EwdVwO0cT7xd2GadUeD ACneEOM96ilEKdgBu3PRFkbHuLc8Yc3IZrwCXLwofLfng/Ljp/LjrPp9Mpy6wASiJD yYfZVlf52tQRLN9tjtdYaqktFfTcUR27amo7Pmk31In2vHS5XWEXTHqmziRIZIGwHi yALV/+a5BHTo+SJPhrqHM2I9RObP6cNWe6zW/pJIDKQ1p2lGAzh4I+3UwtBnBLOc3h GjwUO8JXQIgVA== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 09/10] drm/bridge: tc358775: Add support for tc358765 Date: Sat, 2 Dec 2023 09:54:48 +0200 Message-ID: <20231202075514.44474-10-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The tc358775 bridge is pin compatible with earlier tc358765 according to the tc358774xbg_datasheet_en_20190118.pdf documentation. Compared to the tc358765, the tc358775 supports a STBY GPIO and higher data rates. The tc358765 has a register bit for video event mode vs video pulse mode. We must set it to video event mode for the LCD output to work, and on the tc358775, this bit no longer exists. Looks like the registers seem to match otherwise based on a quick glance comparing the defines to the earlier Android kernel tc358765 driver. Signed-off-by: Tony Lindgren Reviewed-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -107,6 +108,7 @@ #define RDPKTLN 0x0404 /* Command Read Packet Length */ #define VPCTRL 0x0450 /* Video Path Control */ +#define EVTMODE BIT(5) /* Video event mode enable, tc35876x only */ #define HTIM1 0x0454 /* Horizontal Timing Control 1 */ #define HTIM2 0x0458 /* Horizontal Timing Control 2 */ #define VTIM1 0x045C /* Vertical Timing Control 1 */ @@ -254,6 +256,11 @@ enum tc358775_ports { TC358775_LVDS_OUT1, }; +enum tc3587x5_type { + TC358765, + TC358775, +}; + struct tc_data { struct i2c_client *i2c; struct device *dev; @@ -271,6 +278,8 @@ struct tc_data { struct gpio_desc *stby_gpio; u8 lvds_link; /* single-link or dual-link */ u8 bpc; + + enum tc3587x5_type type; }; static inline struct tc_data *bridge_to_tc(struct drm_bridge *b) @@ -424,10 +433,16 @@ static void tc_bridge_enable(struct drm_bridge *bridge) d2l_write(tc->i2c, PPI_STARTPPI, PPI_START_FUNCTION); d2l_write(tc->i2c, DSI_STARTDSI, DSI_RX_START); + /* Video event mode vs pulse mode bit, does not exist for tc358775 */ + if (tc->type == TC358765) + val = EVTMODE; + else + val = 0; + if (tc->bpc == 8) - val = TC358775_VPCTRL_OPXLFMT(1); + val |= TC358775_VPCTRL_OPXLFMT(1); else /* bpc = 6; */ - val = TC358775_VPCTRL_MSF(1); + val |= TC358775_VPCTRL_MSF(1); dsiclk = mode->crtc_clock * 3 * tc->bpc / tc->num_dsi_lanes / 1000; clkdiv = dsiclk / (tc->lvds_link == DUAL_LINK ? DIVIDE_BY_6 : DIVIDE_BY_3); @@ -643,6 +658,7 @@ static int tc_probe(struct i2c_client *client) tc->dev = dev; tc->i2c = client; + tc->type = (enum tc3587x5_type)of_device_get_match_data(dev); tc->panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, TC358775_LVDS_OUT0, 0); @@ -704,13 +720,15 @@ static void tc_remove(struct i2c_client *client) } static const struct i2c_device_id tc358775_i2c_ids[] = { - { "tc358775", 0 }, + { "tc358765", TC358765, }, + { "tc358775", TC358775, }, { } }; MODULE_DEVICE_TABLE(i2c, tc358775_i2c_ids); static const struct of_device_id tc358775_of_ids[] = { - { .compatible = "toshiba,tc358775", }, + { .compatible = "toshiba,tc358765", .data = (void *)TC358765, }, + { .compatible = "toshiba,tc358775", .data = (void *)TC358775, }, { } }; MODULE_DEVICE_TABLE(of, tc358775_of_ids); From patchwork Sat Dec 2 07:54:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13476810 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CE21C4167B for ; Sat, 2 Dec 2023 08:06:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B90410E1B4; Sat, 2 Dec 2023 08:06:03 +0000 (UTC) Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id EABAC10E1B4 for ; Sat, 2 Dec 2023 08:05:17 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id A56CF60406; Sat, 2 Dec 2023 08:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701504317; bh=FTgDD2uIRgD8cARl+De2ZS7uFevrbIvFUr7xCEF/4dE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aRisSfgnuG6B1o2tqnryQaDgeaGPk67LTYuiWM9bmX2NIMFwesVGqm6WJBoVMclGO uCxmPCVBWwR3gdl1sxgxh8SeNpJzqEnfAMdLNPtgnlV9s4HGiqoxhkowPMOeAdd0q3 ud2UtxC6WY/ut/2NU0LKJiDQFJI/TC+FPWH/pLiFHLk52meRmiEDhlY9oxr1+KN158 Nu9Hwruvs09PEbxSpPwk3kvcx6O+bMB4GkqeExao+nepxoFtzwdy2BLLI4gCZV3aSk GGECtyWlsmZfX3i7ftCYk8v2m4/zrSYbUHOI7CJWQMIXRf0cxRIARhSbzh8vaRlxZb pXY3ACFEm03zw== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Subject: [PATCH v2 10/10] drm/bridge: tc358775: Configure hs_rate and lp_rate Date: Sat, 2 Dec 2023 09:54:49 +0200 Message-ID: <20231202075514.44474-11-tony@atomide.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202075514.44474-1-tony@atomide.com> References: <20231202075514.44474-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carl Philipp Klemm , devicetree@vger.kernel.org, Ivaylo Dimitrov , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Pavel Machek Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The hs_rate and lp_rate may be used by the dsi host for timing calculations. The tc358775 has a maximum bit rate of 1 Gbps/lane, tc358765 has maximurate of 800 Mbps per lane. Signed-off-by: Tony Lindgren Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/tc358775.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -636,6 +636,11 @@ static int tc_attach_host(struct tc_data *tc) dsi->format = MIPI_DSI_FMT_RGB888; dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM; + if (tc->type == TC358765) + dsi->hs_rate = 800000000; + else + dsi->hs_rate = 1000000000; + dsi->lp_rate = 10000000; ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) {