From 169ec403f1ff3718497bf01c726a7d183de01b3c Mon Sep 17 00:00:00 2001 From: Tatenda Chipeperekwa Date: Thu, 17 Oct 2019 15:42:45 -0700 Subject: [PATCH] disp: msm: dp: skip wait if audio engine is disabled Skip the wait in the disable path if the audio engine has already been disabled or was not previously enabled. This avoids an unnecessary wait since the audio subsystem will only acknowledge the notification and not request a tear down if no audio playback was started by the user. CRs-Fixed: 2550150 Change-Id: I7b47345430f3d9c63b80b0aa92cdc4dd77152da9 Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_audio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/msm/dp/dp_audio.c b/msm/dp/dp_audio.c index 61d13ca730..67f3741f9d 100644 --- a/msm/dp/dp_audio.c +++ b/msm/dp/dp_audio.c @@ -414,6 +414,9 @@ static int dp_audio_info_setup(struct platform_device *pdev, dp_audio_enable(audio, true); mutex_unlock(&audio->ops_lock); + + DP_DEBUG("audio stream configured\n"); + return rc; } @@ -671,8 +674,11 @@ static int dp_audio_notify(struct dp_audio_private *audio, u32 state) if (atomic_read(&audio->acked)) goto end; - if (state == EXT_DISPLAY_CABLE_CONNECT) - goto end; + if (state == EXT_DISPLAY_CABLE_DISCONNECT && !audio->engine_on) + goto end; + + if (state == EXT_DISPLAY_CABLE_CONNECT) + goto end; rc = wait_for_completion_timeout(&audio->hpd_comp, HZ * 4); if (!rc) {