Loading asoc/codecs/wcd-mbhc-adc.c +26 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,20 @@ static int wcd_measure_adc_once(struct wcd_mbhc *mbhc, int mux_ctl) WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 0); /* Set the appropriate MUX selection */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_MUX_CTL, mux_ctl); /* * Current source mode requires Auto zeroing to be enabled * automatically. If HW doesn't do it, SW has to take care of this * for button interrupts to work fine and to avoid * fake electrical removal interrupts by enabling autozero before FSM * enable and disable it after FSM enable */ if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, true); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 1); if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, false); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ADC_EN, 1); while (retry--) { Loading Loading @@ -351,8 +364,20 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc) WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 0); /* Set the MUX selection to Auto */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_MUX_CTL, MUX_CTL_AUTO); /* * Current source mode requires Auto zeroing to be enabled * automatically. If HW doesn't do it, SW has to take care of this * for button interrupts to work fine and to avoid * fake electrical removal interrupts by enabling autozero before FSM * enable and disable it after FSM enable */ if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, true); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 1); if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, false); /* Restore ADC Enable */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ADC_EN, adc_en); Loading Loading
asoc/codecs/wcd-mbhc-adc.c +26 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,20 @@ static int wcd_measure_adc_once(struct wcd_mbhc *mbhc, int mux_ctl) WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 0); /* Set the appropriate MUX selection */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_MUX_CTL, mux_ctl); /* * Current source mode requires Auto zeroing to be enabled * automatically. If HW doesn't do it, SW has to take care of this * for button interrupts to work fine and to avoid * fake electrical removal interrupts by enabling autozero before FSM * enable and disable it after FSM enable */ if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, true); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 1); if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, false); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ADC_EN, 1); while (retry--) { Loading Loading @@ -351,8 +364,20 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc) WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 0); /* Set the MUX selection to Auto */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_MUX_CTL, MUX_CTL_AUTO); /* * Current source mode requires Auto zeroing to be enabled * automatically. If HW doesn't do it, SW has to take care of this * for button interrupts to work fine and to avoid * fake electrical removal interrupts by enabling autozero before FSM * enable and disable it after FSM enable */ if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, true); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 1); if (mbhc->mbhc_cb->mbhc_comp_autozero_control) mbhc->mbhc_cb->mbhc_comp_autozero_control(mbhc, false); /* Restore ADC Enable */ WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ADC_EN, adc_en); Loading