Commit c23fd751 authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Liam Girdwood

ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level

There is only need to enable/disable once the PLL when the bias is going
between on, prepare, standby and off states.
Signed-off-by: default avatarJarkko Nikula <jhnikula@gmail.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 3484457f
...@@ -1069,7 +1069,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, ...@@ -1069,7 +1069,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
break; break;
case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_PREPARE:
if (aic3x->master) { if (codec->bias_level == SND_SOC_BIAS_STANDBY &&
aic3x->master) {
/* enable pll */ /* enable pll */
reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
aic3x_write(codec, AIC3X_PLL_PROGA_REG, aic3x_write(codec, AIC3X_PLL_PROGA_REG,
...@@ -1077,15 +1078,16 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, ...@@ -1077,15 +1078,16 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,
} }
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
/* fall through and disable pll */ if (codec->bias_level == SND_SOC_BIAS_PREPARE &&
case SND_SOC_BIAS_OFF: aic3x->master) {
if (aic3x->master) {
/* disable pll */ /* disable pll */
reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
aic3x_write(codec, AIC3X_PLL_PROGA_REG, aic3x_write(codec, AIC3X_PLL_PROGA_REG,
reg & ~PLL_ENABLE); reg & ~PLL_ENABLE);
} }
break; break;
case SND_SOC_BIAS_OFF:
break;
} }
codec->bias_level = level; codec->bias_level = level;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment