From 4b36a5da7b9ca36dee667e739101c740e4758a91 Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Wed, 12 Aug 2020 23:52:48 -0700 Subject: [PATCH] ASoC: wsa883x: enable vbat adc filter Enable vbat adc filter inorder to read vbat and temperature values for cps speaker protection. Change-Id: I31c50bdd6ed0becae355600ba3cf48e761406d87 Signed-off-by: Vignesh Kulothungan --- asoc/codecs/wsa883x/wsa883x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/asoc/codecs/wsa883x/wsa883x.c b/asoc/codecs/wsa883x/wsa883x.c index 752d4b7f5a7a..6dbfb5801ade 100644 --- a/asoc/codecs/wsa883x/wsa883x.c +++ b/asoc/codecs/wsa883x/wsa883x.c @@ -1052,6 +1052,12 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, /* Force remove group */ swr_remove_from_group(wsa883x->swr_slave, wsa883x->swr_slave->dev_num); + snd_soc_component_update_bits(component, + WSA883X_VBAT_ADC_FLT_CTL, + 0x0E, 0x06); + snd_soc_component_update_bits(component, + WSA883X_VBAT_ADC_FLT_CTL, + 0x01, 0x01); if (test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) snd_soc_component_update_bits(component, WSA883X_PA_FSM_CTL, 0x01, 0x01); @@ -1060,6 +1066,12 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) wcd_disable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD); + snd_soc_component_update_bits(component, + WSA883X_VBAT_ADC_FLT_CTL, + 0x01, 0x00); + snd_soc_component_update_bits(component, + WSA883X_VBAT_ADC_FLT_CTL, + 0x0E, 0x00); snd_soc_component_update_bits(component, WSA883X_PA_FSM_CTL, 0x01, 0x00); snd_soc_component_update_bits(component, WSA883X_PDM_WD_CTL,