From patchwork Sun Nov 27 19:14:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13057089 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 C5ECEC4321E for ; Mon, 28 Nov 2022 07:18:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E818110E1D7; Mon, 28 Nov 2022 07:18:33 +0000 (UTC) Received: from srv01.abscue.de (abscue.de [IPv6:2a03:4000:63:bf5:4817:8eff:feeb:8ac7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 91D8810E141 for ; Sun, 27 Nov 2022 19:14:52 +0000 (UTC) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 100F81C0049; Sun, 27 Nov 2022 20:14:51 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id E780C1C0048; Sun, 27 Nov 2022 20:14:50 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: =?utf-8?q?Noralf_Tr=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 Subject: [PATCH 1/4] drm/mipi-dbi: Support separate I/O regulator Date: Sun, 27 Nov 2022 20:14:30 +0100 Message-Id: <20221127191433.1363395-2-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Nov 2022 07:18:16 +0000 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: =?utf-8?q?Otto_Pfl=C3=BCger?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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üger --- 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_pipe *pipe) if (dbidev->regulator) regulator_disable(dbidev->regulator); + if (dbidev->io_regulator) + regulator_disable(dbidev->io_regulator); } EXPORT_SYMBOL(mipi_dbi_pipe_disable); @@ -652,6 +654,16 @@ static int mipi_dbi_poweron_reset_conditional(struct mipi_dbi_dev *dbidev, bool } } + if (dbidev->io_regulator) { + ret = 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; @@ -661,6 +673,8 @@ static int mipi_dbi_poweron_reset_conditional(struct mipi_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; } 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; /** - * @regulator: power regulator (optional) + * @regulator: power regulator (Vdd) (optional) */ struct regulator *regulator; + /** + * @io_regulator: I/O power regulator (Vddi) (optional) + */ + struct regulator *io_regulator; + /** * @dbi: MIPI DBI interface */ From patchwork Sun Nov 27 19:14:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13057088 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 16A4CC4321E for ; Mon, 28 Nov 2022 07:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5815F10E1D5; Mon, 28 Nov 2022 07:18:19 +0000 (UTC) Received: from srv01.abscue.de (abscue.de [IPv6:2a03:4000:63:bf5:4817:8eff:feeb:8ac7]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB44310E141 for ; Sun, 27 Nov 2022 19:16:53 +0000 (UTC) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 5E5981C004C; Sun, 27 Nov 2022 20:16:52 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 4A9271C004B; Sun, 27 Nov 2022 20:16:52 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: =?utf-8?q?Noralf_Tr=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 Subject: [PATCH 2/4] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Date: Sun, 27 Nov 2022 20:14:31 +0100 Message-Id: <20221127191433.1363395-3-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221127191433.1363395-2-otto.pflueger@abscue.de> References: <20221127191433.1363395-2-otto.pflueger@abscue.de> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Nov 2022 07:18:16 +0000 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: =?utf-8?q?Otto_Pfl=C3=BCger?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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üger --- 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/panel-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"); + dbidev->io_regulator = 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 = devm_of_find_backlight(dev); if (IS_ERR(dbidev->backlight)) return dev_err_probe(dev, PTR_ERR(dbidev->backlight), "Failed to get backlight\n"); From patchwork Sun Nov 27 19:14:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13057090 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 4B901C433FE for ; Mon, 28 Nov 2022 07:18:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28C2010E1D8; Mon, 28 Nov 2022 07:18:34 +0000 (UTC) X-Greylist: delayed 1093 seconds by postgrey-1.36 at gabe; Sun, 27 Nov 2022 19:18:37 UTC Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by gabe.freedesktop.org (Postfix) with ESMTPS id C1AA910E141 for ; Sun, 27 Nov 2022 19:18:37 +0000 (UTC) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 662081C004C; Sun, 27 Nov 2022 20:18:36 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 525B01C004B; Sun, 27 Nov 2022 20:18:36 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: =?utf-8?q?Noralf_Tr=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 Subject: [PATCH 3/4] dt-bindings: display: panel: mipi-dbi-spi: Add missing power-supply Date: Sun, 27 Nov 2022 20:14:32 +0100 Message-Id: <20221127191433.1363395-4-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221127191433.1363395-2-otto.pflueger@abscue.de> References: <20221127191433.1363395-2-otto.pflueger@abscue.de> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Nov 2022 07:18:16 +0000 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: =?utf-8?q?Otto_Pfl=C3=BCger?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The power-supply property is only mentioned in the description and not listed in the properties section of the binding. Add it there. Signed-off-by: Otto Pflüger Reviewed-by: Rob Herring --- .../devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml | 3 +++ 1 file changed, 3 insertions(+) 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..d55bf12ecead 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml @@ -80,6 +80,9 @@ properties: Controller data/command selection (D/CX) in 4-line SPI mode. If not set, the controller is in 3-line SPI mode. + power-supply: + description: Power supply for the display module (Vdd). + required: - compatible - reg From patchwork Sun Nov 27 19:14:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13057091 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 915A3C4321E for ; Mon, 28 Nov 2022 07:18:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DFAA10E1D9; Mon, 28 Nov 2022 07:18:50 +0000 (UTC) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0323110E141 for ; Sun, 27 Nov 2022 19:20:57 +0000 (UTC) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 928531C0049; Sun, 27 Nov 2022 20:20:55 +0100 (CET) Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by srv01.abscue.de (Postfix) with ESMTPSA id 7D9961C0048; Sun, 27 Nov 2022 20:20:55 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: =?utf-8?q?Noralf_Tr=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 Subject: [PATCH 4/4] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Date: Sun, 27 Nov 2022 20:14:33 +0100 Message-Id: <20221127191433.1363395-5-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221127191433.1363395-2-otto.pflueger@abscue.de> References: <20221127191433.1363395-2-otto.pflueger@abscue.de> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Nov 2022 07:18:16 +0000 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: =?utf-8?q?Otto_Pfl=C3=BCger?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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üger --- .../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 d55bf12ecead..68cbdfab5438 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml @@ -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. + io-supply: + description: | + Logic level supply for interface signals (Vddi). + No need to set if this is the same as power-supply. + power-supply: description: Power supply for the display module (Vdd).