From 03f44b662b2cf21281a87dc12080eb3aae321368 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Wed, 24 Jul 2024 10:20:07 +0800 Subject: [PATCH] ASoC: codecs: rk3506: set ADC_IP enable or disable when power on or off The ADC_IP bit controls all powers of the codec. Change-Id: Iaaa4f277093023e430b98e9f1d343d3f0e5086ba Signed-off-by: Jason Zhu --- sound/soc/codecs/rk3506_codec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rk3506_codec.c b/sound/soc/codecs/rk3506_codec.c index 7c8cec32e4e2..02172c6dbd86 100644 --- a/sound/soc/codecs/rk3506_codec.c +++ b/sound/soc/codecs/rk3506_codec.c @@ -67,6 +67,8 @@ static unsigned int samplerate_to_bit(unsigned int samplerate) static void rk3506_codec_power_on(struct snd_soc_component *component) { + snd_soc_component_update_bits(component, AUDIO_ADC_LDO, + ADC_IP_MSK, ADC_IP_EN); snd_soc_component_update_bits(component, AUDIO_ADC_PGA0, PGA_PWD_MSK, PGA_PWD_EN); snd_soc_component_update_bits(component, AUDIO_ADC_ADC0, @@ -80,6 +82,8 @@ static void rk3506_codec_power_off(struct snd_soc_component *component) PGA_PWD_MSK, PGA_PWD_DIS); snd_soc_component_update_bits(component, AUDIO_ADC_ADC0, ADC_PWD_MSK, ADC_PWD_DIS); + snd_soc_component_update_bits(component, AUDIO_ADC_LDO, + ADC_IP_MSK, ADC_IP_DIS); } static void rk3506_codec_adc_enable(struct snd_soc_component *component) @@ -143,7 +147,7 @@ static int rk3506_codec_reset(struct snd_soc_component *component) /* Set parameters */ snd_soc_component_update_bits(component, AUDIO_ADC_LDO, - ADC_IP_MSK | LDO_VSEL_MSK, ADC_IP_EN | LDO_VSEL_1_65V); + LDO_VSEL_MSK, LDO_VSEL_1_65V); snd_soc_component_update_bits(component, AUDIO_ADC_PGA1, PGA_CHOP_SEL_MSK, PGA_CHOP_SEL_200K);