summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorGary Zhang <b13634@freescale.com>2012-06-06 16:22:26 +0800
committerGary Zhang <b13634@freescale.com>2012-06-07 09:36:07 +0800
commitc2180cb55d4246fa9b552ad6927fe52e528d98bc (patch)
treeea345d366d1fda5f3361d1c426ec928aa482591e /sound
parentae1f2382e7ed36d6c47836a60bfdfc39d229b74a (diff)
ENGR00212542 SPDIF: move clock operation
Now clock operation occurs in mxc_spdif_trigger(), and because clock operation is forbidden to exist in interrupt context, move disabling clock operation to mxc_spdif_shutdown() Signed-off-by: Gary Zhang <b13634@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/mxc_spdif.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/mxc_spdif.c b/sound/soc/codecs/mxc_spdif.c
index 73b2b2b9ef10..883aa4d26687 100644
--- a/sound/soc/codecs/mxc_spdif.c
+++ b/sound/soc/codecs/mxc_spdif.c
@@ -85,7 +85,7 @@ static void dumpregs(struct mxc_spdif_priv *priv)
{
unsigned int value, i;
- if (!priv->tx_active || !priv->rx_active)
+ if (!priv->tx_active && !priv->rx_active)
clk_enable(priv->plat_data->spdif_core_clk);
for (i = 0 ; i <= 0x38 ; i += 4) {
@@ -101,7 +101,7 @@ static void dumpregs(struct mxc_spdif_priv *priv)
value = readl(spdif_base_addr + i) & 0xffffff;
pr_debug("reg 0x%02x = 0x%06x\n", i, value);
- if (!priv->tx_active || !priv->rx_active)
+ if (!priv->tx_active && !priv->rx_active)
clk_disable(priv->plat_data->spdif_core_clk);
}
#else
@@ -633,7 +633,6 @@ static int mxc_spdif_playback_stop(struct snd_pcm_substream *substream,
regval |= SCR_LOW_POWER;
__raw_writel(regval, SPDIF_REG_SCR + spdif_base_addr);
- clk_disable(plat_data->spdif_clk);
spdif_priv->tx_active = false;
return 0;
@@ -783,7 +782,6 @@ static int mxc_spdif_capture_stop(struct snd_pcm_substream *substream,
regval &= ~(SCR_DMA_RX_EN | SCR_RXFIFO_AUTOSYNC);
__raw_writel(regval, spdif_base_addr + SPDIF_REG_SCR);
- clk_disable(plat_data->spdif_clk);
spdif_priv->rx_active = false;
return 0;
@@ -1158,6 +1156,8 @@ static void mxc_spdif_shutdown(struct snd_pcm_substream *substream,
/* disable spdif_core clock */
clk_disable(plat_data->spdif_core_clk);
+
+ clk_disable(plat_data->spdif_clk);
}
static int mxc_spdif_trigger(struct snd_pcm_substream *substream,