From fe702b2f643283b5ee2fa04574154c7ff0ddaebc Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Thu, 27 Feb 2020 05:26:23 +0530 Subject: [PATCH] ASoC: wsa883x: Update sequence for temperature Update sequence to enable temperature sensor in wsa883x to read proper temperature measurement. Change-Id: I7db16344a92b82539929511bd0de322ed086beb7 Signed-off-by: Sudheer Papothi --- asoc/codecs/wsa883x/wsa883x.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/asoc/codecs/wsa883x/wsa883x.c b/asoc/codecs/wsa883x/wsa883x.c index 412d8f7a19..9f516a03f5 100644 --- a/asoc/codecs/wsa883x/wsa883x.c +++ b/asoc/codecs/wsa883x/wsa883x.c @@ -831,7 +831,7 @@ static const struct snd_kcontrol_new wsa883x_snd_controls[] = { SOC_SINGLE_EXT("WSA PA Mute", SND_SOC_NOPM, 0, 1, 0, wsa883x_get_mute, wsa883x_set_mute), - SOC_SINGLE_EXT("WSA Temp", SND_SOC_NOPM, 0, 1, 0, + SOC_SINGLE_EXT("WSA Temp", SND_SOC_NOPM, 0, UINT_MAX, 0, wsa_get_temp, NULL), SOC_ENUM_EXT("WSA MODE", wsa_dev_mode_enum, @@ -1055,7 +1055,19 @@ static int32_t wsa883x_temp_reg_read(struct snd_soc_component *component, mutex_lock(&wsa883x->res_lock); - /* TODO Vote for global PA */ + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x01, 0x01); + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x04, 0x04); + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x02, 0x02); + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x80, 0x80); + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x20, 0x20); + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0x40, 0x40); + snd_soc_component_update_bits(component, WSA883X_TADC_VALUE_CTL, 0x01, 0x00); wsa_temp_reg->dmeas_msb = snd_soc_component_read32( @@ -1073,7 +1085,8 @@ static int32_t wsa883x_temp_reg_read(struct snd_soc_component *component, wsa_temp_reg->d2_lsb = snd_soc_component_read32( component, WSA883X_OTP_REG_4); - /* TODO Unvote for global PA */ + snd_soc_component_update_bits(component, WSA883X_PA_FSM_BYP, + 0xE7, 0x00); mutex_unlock(&wsa883x->res_lock); return 0;