ASoC: fix PXA SSP port resume
authorDaniel Mack <daniel@caiaq.de>
Tue, 2 Feb 2010 10:45:27 +0000 (18:45 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 2 Feb 2010 11:41:53 +0000 (11:41 +0000)
Unconditionally save the register states when suspending and restore
them again at resume time. Register contents were not preserved over
suspend, and hence the driver takes false assumptions about them.

The clock must be enabled to access the register block.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/pxa/pxa-ssp.c

index 3bd7712f029b9024315bc3cc3f8bf5b6f6988235..e69397f40f72e5306216bf17b6d1f5b3780b5a11 100644 (file)
@@ -135,10 +135,11 @@ static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai)
        struct ssp_priv *priv = cpu_dai->private_data;
 
        if (!cpu_dai->active)
-               return 0;
+               clk_enable(priv->dev.ssp->clk);
 
        ssp_save_state(&priv->dev, &priv->state);
        clk_disable(priv->dev.ssp->clk);
+
        return 0;
 }
 
@@ -146,12 +147,13 @@ static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
 {
        struct ssp_priv *priv = cpu_dai->private_data;
 
-       if (!cpu_dai->active)
-               return 0;
-
        clk_enable(priv->dev.ssp->clk);
        ssp_restore_state(&priv->dev, &priv->state);
-       ssp_enable(&priv->dev);
+
+       if (cpu_dai->active)
+               ssp_enable(&priv->dev);
+       else
+               clk_disable(priv->dev.ssp->clk);
 
        return 0;
 }