From 63b193fcd045e1a6713594f60b806cb4e3cb12ce Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Mon, 12 Aug 2019 11:56:55 +0530 Subject: [PATCH] soc: swr-mstr: Fix headset detection after pdr Sometimes, headset is not detected after pdr during music playback. This is because enable_irq does not get called as master remains in suspend state. Decrease auto suspend timer to 1 to fix the issue. Change-Id: I8cea3e74487977af801dccac7e4f873831c26264 Signed-off-by: Vatsal Bucha --- soc/swr-mstr-ctrl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index f184e1bccfcb..d1b8ebf2b479 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -2453,8 +2453,14 @@ static int swrm_runtime_resume(struct device *dev) SWR_WAKE_IRQ_DEREGISTER, (void *)swrm); } - if (swrm_clk_request(swrm, true)) + if (swrm_clk_request(swrm, true)) { + /* + * Set autosuspend timer to 1 for + * master to enter into suspend. + */ + auto_suspend_timer = 1; goto exit; + } if (!swrm->clk_stop_mode0_supp || swrm->state == SWR_MSTR_SSR) { list_for_each_entry(swr_dev, &mstr->devices, dev_list) { ret = swr_device_up(swr_dev); @@ -2494,6 +2500,7 @@ exit: if (!hw_core_err) swrm_request_hw_vote(swrm, LPASS_HW_CORE, false); pm_runtime_set_autosuspend_delay(&pdev->dev, auto_suspend_timer); + auto_suspend_timer = SWR_AUTO_SUSPEND_DELAY * 1000; mutex_unlock(&swrm->reslock); return ret;