summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-02-24 13:32:20 -0800
committerStefan Agner <stefan.agner@toradex.com>2016-02-25 15:14:00 -0800
commite4f69f468cb002c167ab469dbdbeab623f4aa590 (patch)
tree3f1b7a70e126031e12370926b6074ccdbefed10b
parent8a3e17eb6266bb6cfcd69c4c84686838433163f1 (diff)
ASoC: fsl_sai_ac97: restore register contents for LPSTOP modes
Lowest power modes loose the content of the registers. Use regmap cache to restore the register entries on resume from lowest power modes. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--sound/soc/fsl/fsl_sai_ac97.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_sai_ac97.c b/sound/soc/fsl/fsl_sai_ac97.c
index 624df306e356..34fa8b3a4527 100644
--- a/sound/soc/fsl/fsl_sai_ac97.c
+++ b/sound/soc/fsl/fsl_sai_ac97.c
@@ -577,6 +577,7 @@ static struct regmap_config fsl_sai_regmap_config = {
.readable_reg = fsl_sai_readable_reg,
.volatile_reg = fsl_sai_volatile_reg,
.writeable_reg = fsl_sai_writeable_reg,
+ .cache_type = REGCACHE_FLAT,
};
static struct snd_pcm_hardware snd_sai_ac97_hardware = {
@@ -1239,6 +1240,8 @@ static int fsl_sai_ac97_suspend(struct device *dev)
dmaengine_terminate_all(sai->dma_tx_chan);
dmaengine_terminate_all(sai->dma_rx_chan);
+ regcache_cache_only(sai->regmap, true);
+
return 0;
}
@@ -1246,6 +1249,10 @@ static int fsl_sai_ac97_resume(struct device *dev)
{
struct fsl_sai_ac97 *sai = dev_get_drvdata(dev);
+ regcache_mark_dirty(sai->regmap);
+ regcache_cache_only(sai->regmap, false);
+ regcache_sync(sai->regmap);
+
/* Reset SAI */
fsl_sai_ac97_reset_sai(sai);