]> git.hungrycats.org Git - linux/commitdiff
drm/msm/dp: simplify link and clock disable sequence
authorYongxing Mou <yongxing.mou@oss.qualcomm.com>
Tue, 28 Jul 2026 10:21:41 +0000 (18:21 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fri, 31 Jul 2026 14:08:01 +0000 (17:08 +0300)
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@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/742749/
Link: https://lore.kernel.org/r/20260728-dp_mstclean-v9-12-f7779fce10f4@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/msm/dp/dp_display.c

index 44f4c2312fc38c2796df459ffc97b663ec817dcb..b4e1feead76526dc0fe18f1de12b7e273ff5b582 100644 (file)
@@ -718,27 +718,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);
 
-               /* 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);
-               msm_dp_ctrl_off_link(dp->ctrl, dp->panel);
+
+       msm_dp_ctrl_off_link(dp->ctrl, dp->panel);
+
+       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);
-               msm_dp_ctrl_off_link(dp->ctrl, dp->panel);
+       else
                msm_dp_display_host_phy_exit(dp);
-       }
 
        msm_dp_display->power_on = false;