Skip to content

Commit

Permalink
ASoC: fix PXA SSP port resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Mack authored and Mark Brown committed Feb 2, 2010
1 parent 59cdd9b commit 026384d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sound/soc/pxa/pxa-ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,25 @@ 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;
}

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;
}
Expand Down

0 comments on commit 026384d

Please sign in to comment.