From 4dcb7b2d162e206b774221e3ab3ff71948ecfee6 Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Mon, 16 Dec 2019 15:03:41 +0530 Subject: ASoC: wcd938x: Fix headset detection during SSR/PDR Headset is corrected as lineout during SSR/PDR. This is because adc voltage is not measured correctly due to SSR state. Enable flag deinit_in_progress during SSR down to check if device is not reported and disable it after device up. Change-Id: I6fc4fff4149c36ba16aa668a960505504a5d811f Signed-off-by: Vatsal Bucha --- asoc/codecs/wcd938x/wcd938x.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'asoc/codecs/wcd938x') diff --git a/asoc/codecs/wcd938x/wcd938x.c b/asoc/codecs/wcd938x/wcd938x.c index 3db8fc5a..aa62a469 100644 --- a/asoc/codecs/wcd938x/wcd938x.c +++ b/asoc/codecs/wcd938x/wcd938x.c @@ -1903,6 +1903,7 @@ static int wcd938x_event_notify(struct notifier_block *block, break; case BOLERO_WCD_EVT_SSR_DOWN: wcd938x->dev_up = false; + wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true; mbhc = &wcd938x->mbhc->wcd_mbhc; wcd938x_mbhc_ssr_down(wcd938x->mbhc, component); wcd938x_reset_low(wcd938x->dev); @@ -1927,6 +1928,7 @@ static int wcd938x_event_notify(struct notifier_block *block, } else { wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg); } + wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd938x->dev_up = true; break; case BOLERO_WCD_EVT_CLK_NOTIFY: -- cgit v1.2.3