diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-09-10 14:23:29 +0300 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-09-11 09:03:20 +0100 |
commit | c23fd751dc2953263be5989ca537fdee14dee46e (patch) | |
tree | 5a0ff082594493ca0a296257b971758fcdd298e7 /sound/soc/codecs/tlv320aic3x.c | |
parent | 3484457fc5fcdb650e03d375f1f6e66db93d6109 (diff) | |
download | blackbird-op-linux-c23fd751dc2953263be5989ca537fdee14dee46e.tar.gz blackbird-op-linux-c23fd751dc2953263be5989ca537fdee14dee46e.zip |
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: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index b3175860bcb4..94dc707d9022 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -1069,7 +1069,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, case SND_SOC_BIAS_ON: break; case SND_SOC_BIAS_PREPARE: - if (aic3x->master) { + if (codec->bias_level == SND_SOC_BIAS_STANDBY && + aic3x->master) { /* enable pll */ reg = aic3x_read_reg_cache(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, } break; case SND_SOC_BIAS_STANDBY: - /* fall through and disable pll */ - case SND_SOC_BIAS_OFF: - if (aic3x->master) { + if (codec->bias_level == SND_SOC_BIAS_PREPARE && + aic3x->master) { /* disable pll */ reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); } break; + case SND_SOC_BIAS_OFF: + break; } codec->bias_level = level; |