ASoC: samsung: Correct I2S DAI suspend/resume ops
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 4 Jul 2014 14:05:45 +0000 (16:05 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 4 Jul 2014 19:29:27 +0000 (20:29 +0100)
We should save/restore relevant I2S registers regardless of
the dai->active flag, otherwise some settings are being lost
after system suspend/resume cycle. E.g. I2S slave mode set only
during dai initialization is not preserved and the device ends
up in master mode after system resume.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
sound/soc/samsung/i2s.c

index 2ac76fa3e742e6fcd5dbacf094a2a38244345564..5f9b255a8b38a5880c2ed6aff297609cc5c5c0b3 100644 (file)
@@ -920,11 +920,9 @@ static int i2s_suspend(struct snd_soc_dai *dai)
 {
        struct i2s_dai *i2s = to_info(dai);
 
-       if (dai->active) {
-               i2s->suspend_i2smod = readl(i2s->addr + I2SMOD);
-               i2s->suspend_i2scon = readl(i2s->addr + I2SCON);
-               i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR);
-       }
+       i2s->suspend_i2smod = readl(i2s->addr + I2SMOD);
+       i2s->suspend_i2scon = readl(i2s->addr + I2SCON);
+       i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR);
 
        return 0;
 }
@@ -933,11 +931,9 @@ static int i2s_resume(struct snd_soc_dai *dai)
 {
        struct i2s_dai *i2s = to_info(dai);
 
-       if (dai->active) {
-               writel(i2s->suspend_i2scon, i2s->addr + I2SCON);
-               writel(i2s->suspend_i2smod, i2s->addr + I2SMOD);
-               writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR);
-       }
+       writel(i2s->suspend_i2scon, i2s->addr + I2SCON);
+       writel(i2s->suspend_i2smod, i2s->addr + I2SMOD);
+       writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR);
 
        return 0;
 }