dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add enable gpio to display connector
@ 2025-10-28 15:26 Prahlad Valluru
  2025-10-28 15:26 ` [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio Prahlad Valluru
  2025-10-28 15:26 ` [PATCH 2/2] drm: bridge: add enable gpio for display-connector Prahlad Valluru
  0 siblings, 2 replies; 5+ messages in thread
From: Prahlad Valluru @ 2025-10-28 15:26 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Tomi Valkeinen, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec
  Cc: dri-devel, devicetree, linux-kernel, Prahlad Valluru

In some cases, dp-connectors may need to enable gpios to
select or enable the port. For cases like those, we don't have
any gpio devicetree option.
In this patch, add optional enable gpio to handle them in
display-connector, so that it can be used for any connector.

---
Prahlad Valluru (2):
      dt-bindings: dp-connector: describe enable gpio
      drm: bridge: add enable gpio for display-connector

 .../devicetree/bindings/display/connector/dp-connector.yaml        | 4 ++++
 drivers/gpu/drm/bridge/display-connector.c                         | 7 +++++++
 2 files changed, 11 insertions(+)
---
base-commit: 4f9ffd2c80a2fa09dcc8dfa0482cb7e0fb6fcf6c
change-id: 20251028-enable-gpio-dp-connector-1e4e8611ec08

Best regards,
-- 
Prahlad Valluru <venkata.valluru@oss.qualcomm.com>


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

* [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio
  2025-10-28 15:26 [PATCH 0/2] Add enable gpio to display connector Prahlad Valluru
@ 2025-10-28 15:26 ` Prahlad Valluru
  2025-10-28 15:55   ` Krzysztof Kozlowski
  2025-10-28 15:26 ` [PATCH 2/2] drm: bridge: add enable gpio for display-connector Prahlad Valluru
  1 sibling, 1 reply; 5+ messages in thread
From: Prahlad Valluru @ 2025-10-28 15:26 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Tomi Valkeinen, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec
  Cc: dri-devel, devicetree, linux-kernel, Prahlad Valluru

In some cases, dp-connector need a gpio for
connector to be enabled. Currently, there is no such
entry so, add enable-gpios for such cases.

Signed-off-by: Prahlad Valluru <venkata.valluru@oss.qualcomm.com>
---
 Documentation/devicetree/bindings/display/connector/dp-connector.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/connector/dp-connector.yaml b/Documentation/devicetree/bindings/display/connector/dp-connector.yaml
index 1f2b449dc910..e703b19b7168 100644
--- a/Documentation/devicetree/bindings/display/connector/dp-connector.yaml
+++ b/Documentation/devicetree/bindings/display/connector/dp-connector.yaml
@@ -20,6 +20,10 @@ properties:
       - full-size
       - mini
 
+  enable-gpios:
+    description: A GPIO line connected to enable connector
+    maxItems: 1
+
   hpd-gpios:
     description: A GPIO line connected to HPD
     maxItems: 1

-- 
2.34.1


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

* [PATCH 2/2] drm: bridge: add enable gpio for display-connector
  2025-10-28 15:26 [PATCH 0/2] Add enable gpio to display connector Prahlad Valluru
  2025-10-28 15:26 ` [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio Prahlad Valluru
@ 2025-10-28 15:26 ` Prahlad Valluru
  2025-10-28 15:49   ` Laurent Pinchart
  1 sibling, 1 reply; 5+ messages in thread
From: Prahlad Valluru @ 2025-10-28 15:26 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Tomi Valkeinen, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec
  Cc: dri-devel, devicetree, linux-kernel, Prahlad Valluru

In some cases, need gpio to be set for the connector
enable. Add optional enable gpio to display-connector.

Signed-off-by: Prahlad Valluru <venkata.valluru@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/display-connector.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
index e9f16dbc9535..52f5e4175e64 100644
--- a/drivers/gpu/drm/bridge/display-connector.c
+++ b/drivers/gpu/drm/bridge/display-connector.c
@@ -21,6 +21,7 @@ struct display_connector {
 	struct drm_bridge	bridge;
 
 	struct gpio_desc	*hpd_gpio;
+	struct gpio_desc	*enable_gpio;
 	int			hpd_irq;
 
 	struct regulator	*supply;
@@ -298,6 +299,12 @@ static int display_connector_probe(struct platform_device *pdev)
 					     "Unable to retrieve HPD GPIO\n");
 
 		conn->hpd_irq = gpiod_to_irq(conn->hpd_gpio);
+
+		conn->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+							 GPIOD_OUT_HIGH);
+		if (IS_ERR(conn->enable_gpio))
+			return dev_err_probe(&pdev->dev, PTR_ERR(conn->enable_gpio),
+					     "Unable to retrieve enable GPIO\n");
 	} else {
 		conn->hpd_irq = -EINVAL;
 	}

-- 
2.34.1


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

* Re: [PATCH 2/2] drm: bridge: add enable gpio for display-connector
  2025-10-28 15:26 ` [PATCH 2/2] drm: bridge: add enable gpio for display-connector Prahlad Valluru
@ 2025-10-28 15:49   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2025-10-28 15:49 UTC (permalink / raw)
  To: Prahlad Valluru
  Cc: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Tomi Valkeinen, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Jonas Karlman, Jernej Skrabec, dri-devel, devicetree,
	linux-kernel

On Tue, Oct 28, 2025 at 08:56:50PM +0530, Prahlad Valluru wrote:
> In some cases, need gpio to be set for the connector
> enable. Add optional enable gpio to display-connector.
> 
> Signed-off-by: Prahlad Valluru <venkata.valluru@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/bridge/display-connector.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
> index e9f16dbc9535..52f5e4175e64 100644
> --- a/drivers/gpu/drm/bridge/display-connector.c
> +++ b/drivers/gpu/drm/bridge/display-connector.c
> @@ -21,6 +21,7 @@ struct display_connector {
>  	struct drm_bridge	bridge;
>  
>  	struct gpio_desc	*hpd_gpio;
> +	struct gpio_desc	*enable_gpio;
>  	int			hpd_irq;
>  
>  	struct regulator	*supply;
> @@ -298,6 +299,12 @@ static int display_connector_probe(struct platform_device *pdev)
>  					     "Unable to retrieve HPD GPIO\n");
>  
>  		conn->hpd_irq = gpiod_to_irq(conn->hpd_gpio);
> +
> +		conn->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
> +							 GPIOD_OUT_HIGH);

What does it mean to "enable the connector" ? Given that you don't set
the GPIO value at runtime, this seems to be a hack that is probably
better handled with GPIO hogs in the device tree.

> +		if (IS_ERR(conn->enable_gpio))
> +			return dev_err_probe(&pdev->dev, PTR_ERR(conn->enable_gpio),
> +					     "Unable to retrieve enable GPIO\n");
>  	} else {
>  		conn->hpd_irq = -EINVAL;
>  	}

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio
  2025-10-28 15:26 ` [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio Prahlad Valluru
@ 2025-10-28 15:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-28 15:55 UTC (permalink / raw)
  To: Prahlad Valluru, David Airlie, Simona Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Tomi Valkeinen, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec
  Cc: dri-devel, devicetree, linux-kernel

On 28/10/2025 16:26, Prahlad Valluru wrote:
> In some cases, dp-connector need a gpio for
> connector to be enabled. Currently, there is no such

In what cases? Please describe the hardware because I am surprised to
see that connector need to be enabled. Seems like you are solving
completely different problem.

Best regards,
Krzysztof

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

end of thread, other threads:[~2025-10-28 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 15:26 [PATCH 0/2] Add enable gpio to display connector Prahlad Valluru
2025-10-28 15:26 ` [PATCH 1/2] dt-bindings: dp-connector: describe enable gpio Prahlad Valluru
2025-10-28 15:55   ` Krzysztof Kozlowski
2025-10-28 15:26 ` [PATCH 2/2] drm: bridge: add enable gpio for display-connector Prahlad Valluru
2025-10-28 15:49   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).