From 55fdf543d29a7c2ac8a2ec1e57bcadfc0f13ecf9 Mon Sep 17 00:00:00 2001 From: Soumya Managoli Date: Tue, 19 Oct 2021 14:17:05 +0530 Subject: [PATCH] ASoC: wcd937x: Update EAR PA CnP FSM sequence EAR PA short switch is not released after PA is turned on and off. Address this hardware issue by updating the EAR PA CnP FSM while EAR power down sequence. Change-Id: If4269c30c13572db1b252f223368d444b9250901 Signed-off-by: Soumya Managoli --- asoc/codecs/wcd937x/wcd937x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/asoc/codecs/wcd937x/wcd937x.c b/asoc/codecs/wcd937x/wcd937x.c index c1b6c898203e..7dbc9e9d93b2 100644 --- a/asoc/codecs/wcd937x/wcd937x.c +++ b/asoc/codecs/wcd937x/wcd937x.c @@ -1055,6 +1055,22 @@ static int wcd937x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w, snd_soc_component_update_bits(component, WCD937X_DIGITAL_PDM_WD_CTL0, 0x17, 0x00); + usleep_range(10000, 10010); + /* disable EAR CnP FSM */ + snd_soc_component_update_bits(component, + WCD937X_EAR_EAR_EN_REG, + 0x02, 0x00); + /* toggle EAR PA to let PA control registers take effect */ + snd_soc_component_update_bits(component, + WCD937X_ANA_EAR, + 0x80, 0x80); + snd_soc_component_update_bits(component, + WCD937X_ANA_EAR, + 0x80, 0x00); + /* enable EAR CnP FSM */ + snd_soc_component_update_bits(component, + WCD937X_EAR_EAR_EN_REG, + 0x02, 0x02); break; }; return ret;