ASoC: mbhc-adc: Resolve headset removal detected because of elec irq

When SVA is enabled and headset is inserted and playback is started
on headset, sometimes electrical irq is triggered resulting in
headset removal being reported. This happens because of high mic
voltage being reported. Enable micbias before checking for adc
voltage to resolve issue.

Change-Id: If7445c906b2e62f12b48548a2d435db01f184587
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
此提交包含在:
Vatsal Bucha
2021-08-24 14:16:38 +05:30
父節點 fa58ae98f9
當前提交 47942f03ae

查看文件

@@ -1001,6 +1001,11 @@ static irqreturn_t wcd_mbhc_adc_hs_rem_irq(int irq, void *data)
msecs_to_jiffies(WCD_FAKE_REMOVAL_MIN_PERIOD_MS);
adc_threshold = wcd_mbhc_adc_get_hs_thres(mbhc);
/* Enable MICBIAS before checking for ADC Voltage */
if (mbhc->mbhc_cb->mbhc_micbias_control)
mbhc->mbhc_cb->mbhc_micbias_control(mbhc->component,
MIC_BIAS_2, MICB_ENABLE);
do {
retry++;
/*
@@ -1016,10 +1021,18 @@ static irqreturn_t wcd_mbhc_adc_hs_rem_irq(int irq, void *data)
retry > FAKE_REM_RETRY_ATTEMPTS) {
pr_debug("%s: headset is NOT actually removed\n",
__func__);
if (mbhc->mbhc_cb->mbhc_micbias_control)
mbhc->mbhc_cb->mbhc_micbias_control(
mbhc->component, MIC_BIAS_2,
MICB_DISABLE);
goto exit;
}
} while (!time_after(jiffies, timeout));
if (mbhc->mbhc_cb->mbhc_micbias_control)
mbhc->mbhc_cb->mbhc_micbias_control(mbhc->component, MIC_BIAS_2,
MICB_DISABLE);
if (wcd_swch_level_remove(mbhc)) {
pr_debug("%s: Switch level is low ", __func__);
goto exit;