summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <b02247@freescale.com>2014-07-07 19:03:21 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-01-15 21:17:59 -0600
commit42325f2defd237dbd7dfd2200e0c8da61f1f1bde (patch)
tree4e50722b91449c67bda7085ab902e603be5de4ae /sound
parent2d0cc419474c35dfdec76b0363ff65c15fa103a2 (diff)
ENGR00321941 ASoC: fsl_spdif: fix that can't get the Rx Sample Rate
The SRPC register should be volatile, LOCK bit is set by the hardware. Signed-off-by: Shengjiu Wang <b02247@freescale.com> (cherry picked from commit 35ac9096cbe158962e779fd9bc64aeb74abbc745)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_spdif.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 17b57caf49c9..0e7f37be2b50 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -113,6 +113,8 @@ struct fsl_spdif_priv {
struct clk *dmaclk;
struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx;
+ /* regcache for SRPC */
+ u32 regcache_srpc;
/* The name space will be allocated dynamically */
char name[0];
@@ -1028,6 +1030,7 @@ static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg)
static bool fsl_spdif_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
+ case REG_SPDIF_SRPC:
case REG_SPDIF_SIS:
case REG_SPDIF_SRL:
case REG_SPDIF_SRR:
@@ -1327,6 +1330,9 @@ static int fsl_spdif_suspend(struct device *dev)
{
struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
+ regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC,
+ &spdif_priv->regcache_srpc);
+
regcache_cache_only(spdif_priv->regmap, true);
regcache_mark_dirty(spdif_priv->regmap);
@@ -1338,6 +1344,11 @@ static int fsl_spdif_resume(struct device *dev)
struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
regcache_cache_only(spdif_priv->regmap, false);
+
+ regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SRPC,
+ SRPC_CLKSRC_SEL_MASK | SRPC_GAINSEL_MASK,
+ spdif_priv->regcache_srpc);
+
return regcache_sync(spdif_priv->regmap);
}
#endif /* CONFIG_PM_SLEEP */