dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] drm/bridge: ti-sn65dsi86: Use HPD in a DP use case
@ 2025-05-01  7:48 max.oss.09
  2025-05-02  3:38 ` Doug Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: max.oss.09 @ 2025-05-01  7:48 UTC (permalink / raw)
  To: max.krummenacher, Jayesh Choudhary
  Cc: Andrzej Hajda, David Airlie, Douglas Anderson, Jernej Skrabec,
	Jonas Karlman, Laurent Pinchart, Maarten Lankhorst, Maxime Ripard,
	Neil Armstrong, Robert Foss, Simona Vetter, Thomas Zimmermann,
	dri-devel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>

The bridge driver currently disables handling the hot plug input and
relies on a always connected eDP panel with fixed delays when the
panel is ready.

If one uses the bridge for a regular display port monitor this
assumption is no longer true.
If used with a display port monitor change to keep the hot plug
detection functionality enabled and change to have the bridge working
during runtime suspend to be able to detect the connection state.

Note that if HPD_DISABLE is set the HPD bit always returns connected
independent of the actual state of the hot plug pin. Thus
currently bridge->detect() always returns connected.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

---

 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 01d456b955ab..c7496bf142d1 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -333,9 +333,11 @@ static void ti_sn65dsi86_enable_comms(struct ti_sn65dsi86 *pdata)
 	 * If HPD somehow makes sense on some future panel we'll have to
 	 * change this to be conditional on someone specifying that HPD should
 	 * be used.
+	 * Only disable HDP if used for eDP.
 	 */
-	regmap_update_bits(pdata->regmap, SN_HPD_DISABLE_REG, HPD_DISABLE,
-			   HPD_DISABLE);
+	if (pdata->bridge.type == DRM_MODE_CONNECTOR_eDP)
+		regmap_update_bits(pdata->regmap, SN_HPD_DISABLE_REG,
+				   HPD_DISABLE, HPD_DISABLE);
 
 	pdata->comms_enabled = true;
 
@@ -357,6 +359,10 @@ static int __maybe_unused ti_sn65dsi86_resume(struct device *dev)
 	struct ti_sn65dsi86 *pdata = dev_get_drvdata(dev);
 	int ret;
 
+	if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort &&
+	    pdata->comms_enabled)
+		return 0;
+
 	ret = regulator_bulk_enable(SN_REGULATOR_SUPPLY_NUM, pdata->supplies);
 	if (ret) {
 		DRM_ERROR("failed to enable supplies %d\n", ret);
@@ -386,6 +392,9 @@ static int __maybe_unused ti_sn65dsi86_suspend(struct device *dev)
 	struct ti_sn65dsi86 *pdata = dev_get_drvdata(dev);
 	int ret;
 
+	if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort)
+		return 0;
+
 	if (pdata->refclk)
 		ti_sn65dsi86_disable_comms(pdata);
 
-- 
2.42.0


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

end of thread, other threads:[~2025-05-13 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-01  7:48 [PATCH v1] drm/bridge: ti-sn65dsi86: Use HPD in a DP use case max.oss.09
2025-05-02  3:38 ` Doug Anderson
2025-05-06 16:44   ` Max Krummenacher
2025-05-07 10:15     ` Jayesh Choudhary
2025-05-13 12:43       ` Max Krummenacher

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).