Browse Source

MLK-10213-1: ASoC: fsl_ssi: sound is wrong after suspend/resume

The register SFCSR is volatile, but some bits in it need to be
recovered after suspend/resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
isee-imx_3.14.28.y
Shengjiu Wang 6 years ago
parent
commit
83a61c8270
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      sound/soc/fsl/fsl_ssi.c

+ 13
- 1
sound/soc/fsl/fsl_ssi.c View File

@ -3,7 +3,7 @@
*
* Author: Timur Tabi <timur@freescale.com>
*
* Copyright 2007-2014 Freescale Semiconductor, Inc.
* Copyright 2007-2015 Freescale Semiconductor, Inc.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
@ -266,6 +266,9 @@ struct fsl_ssi_private {
unsigned int baudclk_streams;
unsigned int bitclk_freq;
/*regcache for SFCSR*/
u32 regcache_sfcsr;
/* DMA params */
struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx;
@ -1578,6 +1581,9 @@ static int fsl_ssi_suspend(struct device *dev)
struct fsl_ssi_private *ssi_private = dev_get_drvdata(dev);
struct regmap *regs = ssi_private->regs;
regmap_read(regs, CCSR_SSI_SFCSR,
&ssi_private->regcache_sfcsr);
regcache_cache_only(regs, true);
regcache_mark_dirty(regs);
@ -1590,6 +1596,12 @@ static int fsl_ssi_resume(struct device *dev)
struct regmap *regs = ssi_private->regs;
regcache_cache_only(regs, false);
regmap_update_bits(regs, CCSR_SSI_SFCSR,
CCSR_SSI_SFCSR_RFWM1_MASK | CCSR_SSI_SFCSR_TFWM1_MASK |
CCSR_SSI_SFCSR_RFWM0_MASK | CCSR_SSI_SFCSR_TFWM0_MASK,
ssi_private->regcache_sfcsr);
return regcache_sync(regs);
}
#endif /* CONFIG_PM_SLEEP */


Loading…
Cancel
Save