From 7544634ca6d5e5e279a797cb8f77cb996568ce65 Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Wed, 11 Mar 2020 13:11:51 +0530 Subject: [PATCH] ASoC: wcd-mbhc: Disable moisture detect threshold if duty cycle disabled Moisture detection is not disabled properly if threshold remains set as 24k even if duty cycle is disabled. This is leading into headset not getting detected sometimes. Disable threshold as well if duty cycle disabled. Change-Id: Ic90c65d8bbaa965cf147f95edf5add8980889e1f Signed-off-by: Vatsal Bucha --- asoc/codecs/wcd-mbhc-v2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asoc/codecs/wcd-mbhc-v2.c b/asoc/codecs/wcd-mbhc-v2.c index f173f3e31455..d41bfa120750 100644 --- a/asoc/codecs/wcd-mbhc-v2.c +++ b/asoc/codecs/wcd-mbhc-v2.c @@ -1419,8 +1419,7 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc) if (mbhc->mbhc_cfg->moisture_en && mbhc->mbhc_cb->mbhc_moisture_config && !mbhc->mbhc_cfg->moisture_duty_cycle_en) mbhc->mbhc_cb->mbhc_moisture_config(mbhc); - else if (mbhc->mbhc_cfg->moisture_duty_cycle_en && - mbhc->mbhc_cb->mbhc_moisture_detect_en) + else if (mbhc->mbhc_cb->mbhc_moisture_detect_en) mbhc->mbhc_cb->mbhc_moisture_detect_en(mbhc, false); /*