aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShengjiu Wang <b02247@freescale.com>2014-07-07 07:03:21 -0400
committerShengjiu Wang <b02247@freescale.com>2014-07-09 04:06:10 -0400
commit9500361d12307778e640f4d094c7b1b7e54f0c12 (patch)
tree8ec83d0a2c2a1c0b5227f8771b78e0d0babfcfc5
parentb06e80f43d0fa24aaaa6e340ef18a7cb8955a317 (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>
-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 868ee2ca547e..a261f151f7ed 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -88,6 +88,8 @@ struct fsl_spdif_priv {
88 struct clk *dmaclk; 88 struct clk *dmaclk;
89 struct snd_dmaengine_dai_dma_data dma_params_tx; 89 struct snd_dmaengine_dai_dma_data dma_params_tx;
90 struct snd_dmaengine_dai_dma_data dma_params_rx; 90 struct snd_dmaengine_dai_dma_data dma_params_rx;
91 /* regcache for SRPC */
92 u32 regcache_srpc;
91 93
92 /* The name space will be allocated dynamically */ 94 /* The name space will be allocated dynamically */
93 char name[0]; 95 char name[0];
@@ -986,6 +988,7 @@ static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg)
986static bool fsl_spdif_volatile_reg(struct device *dev, unsigned int reg) 988static bool fsl_spdif_volatile_reg(struct device *dev, unsigned int reg)
987{ 989{
988 switch (reg) { 990 switch (reg) {
991 case REG_SPDIF_SRPC:
989 case REG_SPDIF_SIS: 992 case REG_SPDIF_SIS:
990 case REG_SPDIF_SRL: 993 case REG_SPDIF_SRL:
991 case REG_SPDIF_SRR: 994 case REG_SPDIF_SRR:
@@ -1304,6 +1307,9 @@ static int fsl_spdif_suspend(struct device *dev)
1304{ 1307{
1305 struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); 1308 struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
1306 1309
1310 regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC,
1311 &spdif_priv->regcache_srpc);
1312
1307 regcache_cache_only(spdif_priv->regmap, true); 1313 regcache_cache_only(spdif_priv->regmap, true);
1308 regcache_mark_dirty(spdif_priv->regmap); 1314 regcache_mark_dirty(spdif_priv->regmap);
1309 1315
@@ -1315,6 +1321,11 @@ static int fsl_spdif_resume(struct device *dev)
1315 struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); 1321 struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
1316 1322
1317 regcache_cache_only(spdif_priv->regmap, false); 1323 regcache_cache_only(spdif_priv->regmap, false);
1324
1325 regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SRPC,
1326 SRPC_CLKSRC_SEL_MASK | SRPC_GAINSEL_MASK,
1327 spdif_priv->regcache_srpc);
1328
1318 return regcache_sync(spdif_priv->regmap); 1329 return regcache_sync(spdif_priv->regmap);
1319} 1330}
1320#endif /* CONFIG_PM_SLEEP */ 1331#endif /* CONFIG_PM_SLEEP */