[alsa-devel] [PATCH 2/5] ASoC: twl6040: Prevent extra power transitions during resume
Peter Ujfalusi
peter.ujfalusi at ti.com
Fri Jan 11 11:32:32 CET 2013
From: Misael Lopez Cruz <misael.lopez at ti.com>
Prevent unnecessary power state transitions that might occur while
CODEC is resuming if already in target state.
Signed-off-by: Misael Lopez Cruz <misael.lopez at ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
sound/soc/codecs/twl6040.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index ef31ace..b40830c 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1114,8 +1114,10 @@ static int twl6040_suspend(struct snd_soc_codec *codec)
static int twl6040_resume(struct snd_soc_codec *codec)
{
- twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
- twl6040_set_bias_level(codec, codec->dapm.suspend_bias_level);
+ if (codec->dapm.bias_level != codec->dapm.suspend_bias_level) {
+ twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ twl6040_set_bias_level(codec, codec->dapm.suspend_bias_level);
+ }
return 0;
}
--
1.8.1
More information about the Alsa-devel
mailing list