From b44192e48818f46ccd27574dfb3ba974b9c379d6 Mon Sep 17 00:00:00 2001 From: Zhang Yubing Date: Mon, 21 Oct 2024 15:00:29 +0800 Subject: [PATCH] drm/rockchip: dw-dp: enable phy when hpd irq coming when hpd irq coming, the dptx will access dpcd registers, but the phy may be disabled. it need enable phy first. Change-Id: I0a07659eafdbf5d093949d85e9f6f18651dc04ec Signed-off-by: Zhang Yubing --- drivers/gpu/drm/rockchip/dw-dp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw-dp.c b/drivers/gpu/drm/rockchip/dw-dp.c index 1b7f80af7731..79ca1f2f8e79 100644 --- a/drivers/gpu/drm/rockchip/dw-dp.c +++ b/drivers/gpu/drm/rockchip/dw-dp.c @@ -4996,24 +4996,30 @@ static void dw_dp_hpd_work(struct work_struct *work) dev_dbg(dp->dev, "got hpd irq - %s\n", long_hpd ? "long" : "short"); if (!long_hpd) { + phy_power_on(dp->phy); if (dp->is_mst) { dw_dp_check_mst_status(dp); + phy_power_off(dp->phy); return; } - if (dw_dp_hpd_short_pulse(dp)) + if (dw_dp_hpd_short_pulse(dp)) { + phy_power_off(dp->phy); return; + } if (dp->compliance.test_active && dp->compliance.test_type == DP_TEST_LINK_PHY_TEST_PATTERN) { dw_dp_phy_test(dp); /* just do the PHY test and nothing else */ + phy_power_off(dp->phy); return; } ret = dw_dp_link_retrain(dp); if (ret) dev_warn(dp->dev, "Retrain link failed\n"); + phy_power_off(dp->phy); } else { drm_helper_hpd_irq_event(dp->bridge.dev); }