From nobody Thu Sep 18 23:35:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B935CC4321E for ; Thu, 1 Dec 2022 16:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbiLAQGC (ORCPT ); Thu, 1 Dec 2022 11:06:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiLAQGA (ORCPT ); Thu, 1 Dec 2022 11:06:00 -0500 Received: from srv01.abscue.de (abscue.de [IPv6:2a03:4000:63:bf5:4817:8eff:feeb:8ac7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30FC0B392D; Thu, 1 Dec 2022 08:05:58 -0800 (PST) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 2E2591C004C; Thu, 1 Dec 2022 17:05:56 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 199441C004B; Thu, 1 Dec 2022 17:05:56 +0100 (CET) From: =?UTF-8?q?Otto=20Pfl=C3=BCger?= To: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Otto=20Pfl=C3=BCger?= Subject: [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Date: Thu, 1 Dec 2022 17:02:43 +0100 Message-Id: <20221201160245.2093816-2-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201160245.2093816-1-otto.pflueger@abscue.de> References: <20221201160245.2093816-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MIPI DBI specification defines separate vdd (panel power) and vddi (I/O voltage) supplies. Displays that require different voltages for the different supplies do exist, so the supplies cannot be combined into one as they are now. Add a new io_regulator property to the mipi_dbi_dev struct which can be set by the panel driver along with the regulator property. Signed-off-by: Otto Pfl=C3=BCger Reviewed-by: Noralf Tr=C3=B8nnes --- drivers/gpu/drm/drm_mipi_dbi.c | 14 ++++++++++++++ include/drm/drm_mipi_dbi.h | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index a6ac56580876..047cab93a041 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -427,6 +427,8 @@ void mipi_dbi_pipe_disable(struct drm_simple_display_pi= pe *pipe) =20 if (dbidev->regulator) regulator_disable(dbidev->regulator); + if (dbidev->io_regulator) + regulator_disable(dbidev->io_regulator); } EXPORT_SYMBOL(mipi_dbi_pipe_disable); =20 @@ -652,6 +654,16 @@ static int mipi_dbi_poweron_reset_conditional(struct m= ipi_dbi_dev *dbidev, bool } } =20 + if (dbidev->io_regulator) { + ret =3D regulator_enable(dbidev->io_regulator); + if (ret) { + DRM_DEV_ERROR(dev, "Failed to enable I/O regulator (%d)\n", ret); + if (dbidev->regulator) + regulator_disable(dbidev->regulator); + return ret; + } + } + if (cond && mipi_dbi_display_is_on(dbi)) return 1; =20 @@ -661,6 +673,8 @@ static int mipi_dbi_poweron_reset_conditional(struct mi= pi_dbi_dev *dbidev, bool DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret); if (dbidev->regulator) regulator_disable(dbidev->regulator); + if (dbidev->io_regulator) + regulator_disable(dbidev->io_regulator); return ret; } =20 diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h index 14eaecb1825c..e4efbd8ffc9d 100644 --- a/include/drm/drm_mipi_dbi.h +++ b/include/drm/drm_mipi_dbi.h @@ -122,10 +122,15 @@ struct mipi_dbi_dev { struct backlight_device *backlight; =20 /** - * @regulator: power regulator (optional) + * @regulator: power regulator (Vdd) (optional) */ struct regulator *regulator; =20 + /** + * @io_regulator: I/O power regulator (Vddi) (optional) + */ + struct regulator *io_regulator; + /** * @dbi: MIPI DBI interface */ --=20 2.30.2 From nobody Thu Sep 18 23:35:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4478C47089 for ; Thu, 1 Dec 2022 16:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232011AbiLAQHn (ORCPT ); Thu, 1 Dec 2022 11:07:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232156AbiLAQH3 (ORCPT ); Thu, 1 Dec 2022 11:07:29 -0500 Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E840CB68D1; Thu, 1 Dec 2022 08:06:49 -0800 (PST) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 8F9CA1C004C; Thu, 1 Dec 2022 17:06:48 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 7FFB21C004B; Thu, 1 Dec 2022 17:06:48 +0100 (CET) From: =?UTF-8?q?Otto=20Pfl=C3=BCger?= To: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Otto=20Pfl=C3=BCger?= Subject: [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Date: Thu, 1 Dec 2022 17:02:44 +0100 Message-Id: <20221201160245.2093816-3-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201160245.2093816-1-otto.pflueger@abscue.de> References: <20221201160245.2093816-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To support platforms with a separate I/O voltage supply, set the new io_regulator property along with the regulator property of the DBI device. Read the I/O supply from a new "io-supply" device tree property. Signed-off-by: Otto Pfl=C3=BCger Reviewed-by: Noralf Tr=C3=B8nnes --- drivers/gpu/drm/tiny/panel-mipi-dbi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/tiny/panel-mipi-dbi.c b/drivers/gpu/drm/tiny/p= anel-mipi-dbi.c index 955a61d628e7..353356ee0397 100644 --- a/drivers/gpu/drm/tiny/panel-mipi-dbi.c +++ b/drivers/gpu/drm/tiny/panel-mipi-dbi.c @@ -297,6 +297,11 @@ static int panel_mipi_dbi_spi_probe(struct spi_device = *spi) return dev_err_probe(dev, PTR_ERR(dbidev->regulator), "Failed to get regulator 'power'\n"); =20 + dbidev->io_regulator =3D devm_regulator_get(dev, "io"); + if (IS_ERR(dbidev->io_regulator)) + return dev_err_probe(dev, PTR_ERR(dbidev->io_regulator), + "Failed to get regulator 'io'\n"); + dbidev->backlight =3D devm_of_find_backlight(dev); if (IS_ERR(dbidev->backlight)) return dev_err_probe(dev, PTR_ERR(dbidev->backlight), "Failed to get bac= klight\n"); --=20 2.30.2 From nobody Thu Sep 18 23:35:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A583DC43217 for ; Thu, 1 Dec 2022 16:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbiLAQHr (ORCPT ); Thu, 1 Dec 2022 11:07:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232158AbiLAQH3 (ORCPT ); Thu, 1 Dec 2022 11:07:29 -0500 Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B928DB68D2; Thu, 1 Dec 2022 08:06:54 -0800 (PST) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 544DB1C0064; Thu, 1 Dec 2022 17:06:53 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 4307F1C004B; Thu, 1 Dec 2022 17:06:53 +0100 (CET) From: =?UTF-8?q?Otto=20Pfl=C3=BCger?= To: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Otto=20Pfl=C3=BCger?= Subject: [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Date: Thu, 1 Dec 2022 17:02:45 +0100 Message-Id: <20221201160245.2093816-4-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201160245.2093816-1-otto.pflueger@abscue.de> References: <20221201160245.2093816-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add documentation for the new io-supply property, which specifies the regulator for the I/O voltage supply on platforms where the panel panel power and I/O supplies are separate. Signed-off-by: Otto Pfl=C3=BCger Reviewed-by: Noralf Tr=C3=B8nnes Reviewed-by: Rob Herring --- .../bindings/display/panel/panel-mipi-dbi-spi.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi= -spi.yaml b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-= spi.yaml index c2df8d28aaf5..9b701df5e9d2 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.ya= ml +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.ya= ml @@ -22,8 +22,9 @@ description: | The standard defines the following interface signals for type C: - Power: - Vdd: Power supply for display module + Called power-supply in this binding. - Vddi: Logic level supply for interface signals - Combined into one in this binding called: power-supply + Called io-supply in this binding. - Interface: - CSx: Chip select - SCL: Serial clock @@ -80,6 +81,11 @@ properties: Controller data/command selection (D/CX) in 4-line SPI mode. If not set, the controller is in 3-line SPI mode. =20 + io-supply: + description: | + Logic level supply for interface signals (Vddi). + No need to set if this is the same as power-supply. + required: - compatible - reg --=20 2.30.2