[PATCH v4 24/39] drm/msm/dp: simplify link and clock disable sequence

From: Yongxing Mou

Date: Fri Apr 10 2026 - 05:43:44 EST


Move the common disable steps out of the sink_count check to make the
flow easier to follow.

No functional change intended.

Signed-off-by: Yongxing Mou <yongxing.mou@xxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/msm/dp/dp_display.c | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index e8028402f748..7b3b9160e005 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -734,28 +734,19 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)

msm_dp_panel_disable_vsc_sdp(dp->panel);

- /* dongle is still connected but sinks are disconnected */
- if (dp->link->sink_count == 0) {
- /*
- * irq_hpd with sink_count = 0
- * hdmi unplugged out of dongle
- */
+ msm_dp_ctrl_off_pixel_clk(dp->ctrl, dp->panel->stream_id);

- /* set dongle to D3 (power off) mode */
+ /* dongle is still connected but sinks are disconnected */
+ if (dp->link->sink_count == 0)
msm_dp_link_psm_config(dp->link, &dp->panel->link_info, true);
- msm_dp_ctrl_off_pixel_clk(dp->ctrl, dp->panel->stream_id);
- msm_dp_ctrl_off_link(dp->ctrl);
+
+ msm_dp_ctrl_off_link(dp->ctrl);
+
+ if (dp->link->sink_count == 0)
/* re-init the PHY so that we can listen to Dongle disconnect */
msm_dp_ctrl_reinit_phy(dp->ctrl);
- } else {
- /*
- * unplugged interrupt
- * dongle unplugged out of DUT
- */
- msm_dp_ctrl_off_pixel_clk(dp->ctrl, dp->panel->stream_id);
- msm_dp_ctrl_off_link(dp->ctrl);
+ else
msm_dp_display_host_phy_exit(dp);
- }

msm_dp_display->power_on = false;


--
2.43.0