Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level
@ 2010-09-10 11:23 Jarkko Nikula
  2010-09-10 11:23 ` [PATCH 2/4] ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_level Jarkko Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jarkko Nikula @ 2010-09-10 11:23 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood

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>
---
 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 b317586..94dc707 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;
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-09-11  8:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 11:23 [PATCH 1/4] ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level Jarkko Nikula
2010-09-10 11:23 ` [PATCH 2/4] ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_level Jarkko Nikula
2010-09-10 11:47   ` Mark Brown
2010-09-10 12:18     ` Jarkko Nikula
2010-09-10 11:23 ` [PATCH 3/4] ASoC: tlv320aic3x: Use regulator notifiers for optimizing the cache sync Jarkko Nikula
2010-09-10 11:58   ` Mark Brown
2010-09-10 12:33     ` Jarkko Nikula
2010-09-10 11:23 ` [PATCH 4/4] ASoC: tlv320aic3x: Let the codec hit SND_SOC_BIAS_OFF when idle Jarkko Nikula
2010-09-10 12:00   ` Mark Brown
2010-09-10 12:42     ` Jarkko Nikula
2010-09-10 11:36 ` [PATCH 1/4] ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level Mark Brown
2010-09-11  8:04   ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox