ASoC: wcd-mbhc: Disable micbias internal pull-up after headphone detected

Micbias2 internal pull-up remains enabled even after headphone is detected.
This results in power issues. Disable pull up after insertion detection.

Change-Id: I335dbb498192738fc282421d92510400a661cf0c
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
Vatsal Bucha
2020-01-07 18:21:31 +05:30
committed by Gerrit - the friendly Code Review server
parent f34687bd3a
commit 2ccb20dc4c

View File

@@ -758,6 +758,10 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
mbhc->hph_status |= jack_type;
if (jack_type == SND_JACK_HEADPHONE &&
mbhc->mbhc_cb->mbhc_micb_ramp_control)
mbhc->mbhc_cb->mbhc_micb_ramp_control(component, false);
pr_debug("%s: Reporting insertion %d(%x)\n", __func__,
jack_type, mbhc->hph_status);
wcd_mbhc_jack_report(mbhc, &mbhc->headset_jack,
@@ -952,6 +956,10 @@ static void wcd_mbhc_swch_irq_handler(struct wcd_mbhc *mbhc)
else
pr_info("%s: hs_detect_plug work not cancelled\n", __func__);
/* Enable micbias ramp */
if (mbhc->mbhc_cb->mbhc_micb_ramp_control)
mbhc->mbhc_cb->mbhc_micb_ramp_control(component, true);
if (mbhc->mbhc_cb->micbias_enable_status)
micbias1 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
MIC_BIAS_1);
@@ -1459,9 +1467,6 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
/* Button Debounce set to 16ms */
WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_BTN_DBNC, 2);
/* Enable micbias ramp */
if (mbhc->mbhc_cb->mbhc_micb_ramp_control)
mbhc->mbhc_cb->mbhc_micb_ramp_control(component, true);
/* enable bias */
mbhc->mbhc_cb->mbhc_bias(component, true);
/* enable MBHC clock */