All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply
@ 2022-12-01 16:02 Otto Pflüger
  2022-12-01 16:02 ` [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Otto Pflüger
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Otto Pflüger @ 2022-12-01 16:02 UTC (permalink / raw)
  To: Noralf Trønnes, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Otto Pflüger

As stated in Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yml,
the MIPI DBI specification defines two power supplies, one for powering
the panel and one for the I/O voltage. The panel-mipi-dbi driver
currently only supports specifying a single "power-supply" in the
device tree.

Add support for a second power supply defined in a new "io-supply"
device tree property to make the driver properly configure the voltage
regulators on platforms where separate supplies are used.

Changes in v2:
 - Don't list power-supply in the properties section of
   panel-mipi-dbi-spi.yaml because it is already in panel-common.yaml

Otto Pflüger (3):
  drm/mipi-dbi: Support separate I/O regulator
  drm/tiny: panel-mipi-dbi: Read I/O supply from DT
  dt-bindings: display: panel: mipi-dbi-spi: Add io-supply

 .../bindings/display/panel/panel-mipi-dbi-spi.yaml |  8 +++++++-
 drivers/gpu/drm/drm_mipi_dbi.c                     | 14 ++++++++++++++
 drivers/gpu/drm/tiny/panel-mipi-dbi.c              |  5 +++++
 include/drm/drm_mipi_dbi.h                         |  7 ++++++-
 4 files changed, 32 insertions(+), 2 deletions(-)

-- 
2.30.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator
  2022-12-01 16:02 [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Otto Pflüger
@ 2022-12-01 16:02 ` Otto Pflüger
  2022-12-03 16:19   ` Noralf Trønnes
  2022-12-01 16:02 ` [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Otto Pflüger
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Otto Pflüger @ 2022-12-01 16:02 UTC (permalink / raw)
  To: Noralf Trønnes, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Otto Pflüger

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 <otto.pflueger@abscue.de>
---
 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
 	 */
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT
  2022-12-01 16:02 [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Otto Pflüger
  2022-12-01 16:02 ` [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Otto Pflüger
@ 2022-12-01 16:02 ` Otto Pflüger
  2022-12-03 16:20   ` Noralf Trønnes
  2022-12-01 16:02 ` [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Otto Pflüger
  2022-12-14 14:07 ` [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Noralf Trønnes
  3 siblings, 1 reply; 10+ messages in thread
From: Otto Pflüger @ 2022-12-01 16:02 UTC (permalink / raw)
  To: Noralf Trønnes, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Otto Pflüger

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 <otto.pflueger@abscue.de>
---
 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");
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply
  2022-12-01 16:02 [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Otto Pflüger
  2022-12-01 16:02 ` [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Otto Pflüger
  2022-12-01 16:02 ` [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Otto Pflüger
@ 2022-12-01 16:02 ` Otto Pflüger
  2022-12-02  0:11     ` Rob Herring
  2022-12-03 16:21   ` Noralf Trønnes
  2022-12-14 14:07 ` [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Noralf Trønnes
  3 siblings, 2 replies; 10+ messages in thread
From: Otto Pflüger @ 2022-12-01 16:02 UTC (permalink / raw)
  To: Noralf Trønnes, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Otto Pflüger

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 <otto.pflueger@abscue.de>
---
 .../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.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.
+
 required:
   - compatible
   - reg
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply
  2022-12-01 16:02 ` [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Otto Pflüger
@ 2022-12-02  0:11     ` Rob Herring
  2022-12-03 16:21   ` Noralf Trønnes
  1 sibling, 0 replies; 10+ messages in thread
From: Rob Herring @ 2022-12-02  0:11 UTC (permalink / raw)
  To: Otto Pflüger
  Cc: Thomas Zimmermann, Maxime Ripard, Thierry Reding,
	=?utf-8?q?=2C?=devicetree, linux-kernel, Maarten Lankhorst,
	Daniel Vetter, dri-devel, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Sam Ravnborg, Noralf Trønnes


On Thu, 01 Dec 2022 17:02:45 +0100, Otto Pflüger wrote:
> 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 <otto.pflueger@abscue.de>
> ---
>  .../bindings/display/panel/panel-mipi-dbi-spi.yaml        | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply
@ 2022-12-02  0:11     ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2022-12-02  0:11 UTC (permalink / raw)
  To: Otto Pflüger
  Cc: Noralf Trønnes, Krzysztof Kozlowski, Sam Ravnborg,
	linux-kernel, Rob Herring, Thierry Reding, dri-devel,
	Thomas Zimmermann, =?utf-8?q?=2C?=devicetree


On Thu, 01 Dec 2022 17:02:45 +0100, Otto Pflüger wrote:
> 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 <otto.pflueger@abscue.de>
> ---
>  .../bindings/display/panel/panel-mipi-dbi-spi.yaml        | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator
  2022-12-01 16:02 ` [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Otto Pflüger
@ 2022-12-03 16:19   ` Noralf Trønnes
  0 siblings, 0 replies; 10+ messages in thread
From: Noralf Trønnes @ 2022-12-03 16:19 UTC (permalink / raw)
  To: Otto Pflüger, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Noralf Trønnes



Den 01.12.2022 17.02, skrev Otto Pflüger:
> 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 <otto.pflueger@abscue.de>
> ---

Thanks for fixing this, I'll apply the patches in a few days.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT
  2022-12-01 16:02 ` [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Otto Pflüger
@ 2022-12-03 16:20   ` Noralf Trønnes
  0 siblings, 0 replies; 10+ messages in thread
From: Noralf Trønnes @ 2022-12-03 16:20 UTC (permalink / raw)
  To: Otto Pflüger, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Noralf Trønnes



Den 01.12.2022 17.02, skrev Otto Pflüger:
> 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 <otto.pflueger@abscue.de>
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply
  2022-12-01 16:02 ` [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Otto Pflüger
  2022-12-02  0:11     ` Rob Herring
@ 2022-12-03 16:21   ` Noralf Trønnes
  1 sibling, 0 replies; 10+ messages in thread
From: Noralf Trønnes @ 2022-12-03 16:21 UTC (permalink / raw)
  To: Otto Pflüger, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel
  Cc: Noralf Trønnes



Den 01.12.2022 17.02, skrev Otto Pflüger:
> 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 <otto.pflueger@abscue.de>
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply
  2022-12-01 16:02 [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Otto Pflüger
                   ` (2 preceding siblings ...)
  2022-12-01 16:02 ` [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Otto Pflüger
@ 2022-12-14 14:07 ` Noralf Trønnes
  3 siblings, 0 replies; 10+ messages in thread
From: Noralf Trønnes @ 2022-12-14 14:07 UTC (permalink / raw)
  To: Otto Pflüger, Thierry Reding, Sam Ravnborg, David Airlie,
	Daniel Vetter, Rob Herring, Krzysztof Kozlowski,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, dri-devel,
	devicetree, linux-kernel



Den 01.12.2022 17.02, skrev Otto Pflüger:
> As stated in Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yml,
> the MIPI DBI specification defines two power supplies, one for powering
> the panel and one for the I/O voltage. The panel-mipi-dbi driver
> currently only supports specifying a single "power-supply" in the
> device tree.
> 
> Add support for a second power supply defined in a new "io-supply"
> device tree property to make the driver properly configure the voltage
> regulators on platforms where separate supplies are used.
> 
> Changes in v2:
>  - Don't list power-supply in the properties section of
>    panel-mipi-dbi-spi.yaml because it is already in panel-common.yaml
> 
> Otto Pflüger (3):
>   drm/mipi-dbi: Support separate I/O regulator
>   drm/tiny: panel-mipi-dbi: Read I/O supply from DT
>   dt-bindings: display: panel: mipi-dbi-spi: Add io-supply
> 

Series applied to drm-misc-next.

Noralf.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-14 14:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 16:02 [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Otto Pflüger
2022-12-01 16:02 ` [PATCH v2 1/3] drm/mipi-dbi: Support separate I/O regulator Otto Pflüger
2022-12-03 16:19   ` Noralf Trønnes
2022-12-01 16:02 ` [PATCH v2 2/3] drm/tiny: panel-mipi-dbi: Read I/O supply from DT Otto Pflüger
2022-12-03 16:20   ` Noralf Trønnes
2022-12-01 16:02 ` [PATCH v2 3/3] dt-bindings: display: panel: mipi-dbi-spi: Add io-supply Otto Pflüger
2022-12-02  0:11   ` Rob Herring
2022-12-02  0:11     ` Rob Herring
2022-12-03 16:21   ` Noralf Trønnes
2022-12-14 14:07 ` [PATCH v2 0/3] drm/tiny: panel-mipi-dbi: Support separate I/O voltage supply Noralf Trønnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.