]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00212542 SPDIF: move clock operation
authorGary Zhang <b13634@freescale.com>
Wed, 6 Jun 2012 08:22:26 +0000 (16:22 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:46 +0000 (08:34 +0200)
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>
sound/soc/codecs/mxc_spdif.c

index 73b2b2b9ef101f87a3458b0f4f501374106311fb..883aa4d26687383794527306293243722213c38a 100644 (file)
@@ -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,