diff options
author | Adrian Alonso <aalonso@freescale.com> | 2012-05-14 18:02:35 -0500 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:37:21 +0800 |
commit | 537aa89f14c9590240c72fa1cc5da51ff493ea0e (patch) | |
tree | ac0611e3231d70e540c0fae2d2ed40472ca9589c /sound | |
parent | 2fe0c192127b8bde1bb7dfd4720b10dad4a50caa (diff) |
ENGR00178459 mxc_spdif: fix read access for debug info
* Fix read register access for debug info
* Read from spdif registers with a disabled
spdif core clock leads to kernel hang.
* Avoid it by enabling/diabling core clk.
Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/mxc_spdif.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/codecs/mxc_spdif.c b/sound/soc/codecs/mxc_spdif.c index 29a5636cb978..26b0af1bdca2 100644 --- a/sound/soc/codecs/mxc_spdif.c +++ b/sound/soc/codecs/mxc_spdif.c @@ -81,10 +81,13 @@ struct spdif_mixer_control mxc_spdif_control; static unsigned long spdif_base_addr; #if MXC_SPDIF_DEBUG -static void dumpregs(void) +static void dumpregs(struct mxc_spdif_priv *priv) { unsigned int value, i; + if (!priv->tx_active || !priv->rx_active) + clk_enable(priv->plat_data->spdif_core_clk); + for (i = 0 ; i <= 0x38 ; i += 4) { value = readl(spdif_base_addr + i) & 0xffffff; pr_debug("reg 0x%02x = 0x%06x\n", i, value); @@ -97,9 +100,12 @@ static void dumpregs(void) i = 0x50; value = readl(spdif_base_addr + i) & 0xffffff; pr_debug("reg 0x%02x = 0x%06x\n", i, value); + + if (!priv->tx_active || !priv->rx_active) + clk_disable(priv->plat_data->spdif_core_clk); } #else -static void dumpregs(void) {} +static void dumpregs(struct mxc_spdif_priv *priv) {} #endif /* define each spdif interrupt handlers */ @@ -588,7 +594,7 @@ static int mxc_spdif_playback_prepare(struct snd_pcm_substream *substream, regval |= SCR_DMA_TX_EN; __raw_writel(regval, SPDIF_REG_SCR + spdif_base_addr); - dumpregs(); + dumpregs(spdif_priv); return 0; } @@ -603,7 +609,7 @@ static int mxc_spdif_playback_shutdown(struct snd_pcm_substream *substream, if (!plat_data->spdif_tx) return -EINVAL; - dumpregs(); + dumpregs(spdif_priv); pr_debug("SIS: 0x%08x\n", __raw_readl(spdif_base_addr + SPDIF_REG_SIS)); spdif_intr_status(); @@ -1286,7 +1292,7 @@ static int __devinit mxc_spdif_probe(struct platform_device *pdev) goto card_err; } - dumpregs(); + dumpregs(spdif_priv); return 0; |