[PATCH v5 15/18] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection
From: Damon Ding
Date: Tue Oct 27 2026 - 09:37:26 EST
On Rockchip platforms, the Analogix DP native HPD pin IRQ requires the
DP controller to remain powered and clocked to generate plug/unplug
interrupts. Without a runtime PM reference, the controller suspends
when the display pipeline is inactive, disabling HPD detection.
Acquire a runtime PM reference in analogix_dp_bind() and release it in
analogix_dp_unbind() for native HPD pin mode. This keeps the controller
alive throughout the device lifecycle for continuous hotplug detection.
Persistent power is only necessary for native HPD pin mode on the
RK3576 and RK3588 platforms, which are the only ones confirmed to
support the DP mode hotplug detection, as it relies on their HDPTX PHY.
It is not needed for the GPIO HPD mode, the force HPD mode or the fixed
panels, which need no such detection. Add helper
analogix_dp_require_pm_for_hpd_irq() to identify those configurations.
Tested-by: Heiko Stuebner <heiko@xxxxxxxxx>
Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx>
---
Changes in v2:
- Split IRQ enable/disable logic, handle native HPD pin and
GPIO/force-HPD modes separately to avoid unbalanced enable_irq()
calls. (Sashiko)
Changes in v3:
- Modify the commit msg according to the previous commit for moving IRQ
enabling/disabling.
Changes in v4:
- Add Tested-by tag.
Changes in v5:
- Limit the runtime PM holding to the RK3576/RK3588 platforms, which
are the only ones confirmed to support the DP mode hotplug
detection, and exclude the boards with a fixed panel, so that the
runtime suspend still works when the screen is blanked. (Sashiko)
- Add a new commit declaring DRM_BRIDGE_OP_HPD on the Analogix DP
bridge and reporting the hotplug events via drm_bridge_hpd_notify().
(Sashiko)
---
.../drm/bridge/analogix/analogix_dp_core.c | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 50177d1ccb5c..009567da5f17 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -42,6 +42,20 @@
static const bool verify_fast_training;
+/*
+ * Only the RK3576 and RK3588 platforms are confirmed to support the
+ * DP mode hotplug detection for now, which relies on their HDPTX PHY
+ * and requires the controller to stay powered and clocked. So the
+ * runtime PM reference is held only for them, and not for the GPIO
+ * HPD mode, the force HPD mode or the fixed panels, which need no
+ * such detection.
+ */
+static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
+{
+ return (dp->plat_data->dev_type == RK3576_EDP || dp->plat_data->dev_type == RK3588_EDP) &&
+ !dp->hpd_gpiod && !dp->force_hpd && !dp->force_connected_mode;
+}
+
static void analogix_dp_init_dp(struct analogix_dp_device *dp)
{
analogix_dp_reset(dp);
@@ -1611,6 +1625,12 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ if (analogix_dp_require_pm_for_hpd_irq(dp)) {
+ ret = pm_runtime_resume_and_get(dp->dev);
+ if (ret)
+ goto err_unregister_aux;
+ }
+
enable_irq(dp->irq);
return 0;
@@ -1625,6 +1645,10 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
disable_irq(dp->irq);
+
+ if (analogix_dp_require_pm_for_hpd_irq(dp))
+ pm_runtime_put_sync(dp->dev);
+
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1