ASoC: pxa2xx-i2s: Fix suspend/resume
authorKarl Beldan <karl.beldan@gmail.com>
Wed, 13 May 2009 20:16:59 +0000 (22:16 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 14 May 2009 19:35:32 +0000 (20:35 +0100)
pxa2xx_i2s_resume is :
 - unconditionnaly setting SACR0_ENB
 - unsetting SACR0_ENB in saved SACR0 pxa_i2s.sacr0
fix these.

In pxa2xx_i2s_{resume,suspend}, save/restore registers even
when !dai->active.

Signed-off-by: Karl Beldan <karl.beldan@mobile-devices.fr>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/pxa/pxa2xx-i2s.c

index bc12a09527f3aa51fe1efce46b7c3cc3e47a5b85..4743e262895d9f1068260762ca6c4f64df5dd17d 100644 (file)
@@ -262,9 +262,6 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
 #ifdef CONFIG_PM
 static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
 {
-       if (!dai->active)
-               return 0;
-
        /* store registers */
        pxa_i2s.sacr0 = SACR0;
        pxa_i2s.sacr1 = SACR1;
@@ -279,16 +276,14 @@ static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
 
 static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
 {
-       if (!dai->active)
-               return 0;
-
        pxa_i2s_wait();
 
-       SACR0 = pxa_i2s.sacr0 &= ~SACR0_ENB;
+       SACR0 = pxa_i2s.sacr0 & ~SACR0_ENB;
        SACR1 = pxa_i2s.sacr1;
        SAIMR = pxa_i2s.saimr;
        SADIV = pxa_i2s.sadiv;
-       SACR0 |= SACR0_ENB;
+
+       SACR0 = pxa_i2s.sacr0;
 
        return 0;
 }