asoc: mbhc: disable pa while measuring the adc values

While measuring the adc, if PA is on we will get incorrect values of
adc due to which the detection type is missmatched. So disable the PA
While measuring the adc values and restore back PA once measuring adc
done.

Change-Id: I5833452e23a71637353449bb48b937ee44be24ae
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla
2022-07-26 09:25:20 +05:30
parent 290f69973e
commit 05a1b9bd4d
3 changed files with 28 additions and 0 deletions

View File

@@ -804,6 +804,15 @@ static void wcd938x_mbhc_moisture_polling_ctrl(struct wcd_mbhc *mbhc,
0x04, (enable << 2));
}
static void wcd938x_mbhc_hph_pa_enable(struct snd_soc_component *component,
bool enable)
{
if (enable)
snd_soc_component_update_bits(component, WCD938X_ANA_HPH, 0xC0, 0xC0);
else
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,0xC0, 00);
}
static void wcd938x_mbhc_bcs_enable(struct wcd_mbhc *mbhc,
bool bcs_enable)
{
@@ -838,6 +847,7 @@ static const struct wcd_mbhc_cb mbhc_cb = {
.mbhc_moisture_polling_ctrl = wcd938x_mbhc_moisture_polling_ctrl,
.mbhc_moisture_detect_en = wcd938x_mbhc_moisture_detect_en,
.bcs_enable = wcd938x_mbhc_bcs_enable,
.hph_pa_enable = wcd938x_mbhc_hph_pa_enable,
};
static int wcd938x_get_hph_type(struct snd_kcontrol *kcontrol,