From cc997cd3d1536cb88f98a7efb0a816022b667a32 Mon Sep 17 00:00:00 2001 From: Sandeep Gangadharaiah Date: Tue, 13 Sep 2022 16:08:09 -0700 Subject: [PATCH] disp: msm: dp: disable aux switch at the start of the disconnect path Currently the aux switch is disabled at the end of the disconnect path which would include the wait time upto 5 secs becauase of usermode cleanup. However, the PMIC module is expecting the aux switch to be disabled within 400 msec after the disconnect is notified. If not, this would trigger an LPD failure. This change moves aux switch disable further up in the disconnect path, before waiting on completion of usermode cleanup. Change-Id: I42e0608f06127729a78de11631d16d0a3ca0d2b4 Signed-off-by: Sandeep Gangadharaiah --- msm/dp/dp_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index fe073d4bed..6b61ea3028 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -1646,6 +1646,10 @@ static void dp_display_disconnect_sync(struct dp_display_private *dp) cancel_work_sync(&dp->attention_work); flush_workqueue(dp->wq); + if (!dp->debug->sim_mode && !dp->no_aux_switch + && !dp->parser->gpio_aux_switch) + dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE); + /* * Delay the teardown of the mainlink for better interop experience. * It is possible that certain sinks can issue an HPD high immediately @@ -1703,10 +1707,6 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) dp_display_state_remove(DP_STATE_CONFIGURED); mutex_unlock(&dp->session_lock); - if (!dp->debug->sim_mode && !dp->no_aux_switch - && !dp->parser->gpio_aux_switch) - dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE); - SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, dp->state); end: return rc;