ALSA: atmel_abdac: Add missing clock prepare
authorAlexander Stein <alexanders83@web.de>
Fri, 5 Dec 2014 19:10:07 +0000 (20:10 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Dec 2014 19:36:13 +0000 (20:36 +0100)
Clocks must be prepared before enabling them. Do this in one step.
Replace clk_enable with clk_prepare_enable and clk_disable with
clk_disable_unprepare.

Signed-off-by: Alexander Stein <alexanders83@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/atmel/abdac.c

index 31061e3521d491b7d2a60bba8e66ddc189652bf3..023140504104aecc96a31bdcb5fffe7341d234ef 100644 (file)
@@ -242,7 +242,7 @@ static int atmel_abdac_trigger(struct snd_pcm_substream *substream, int cmd)
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */
        case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
        case SNDRV_PCM_TRIGGER_START:
-               clk_enable(dac->sample_clk);
+               clk_prepare_enable(dac->sample_clk);
                retval = dw_dma_cyclic_start(dac->dma.chan);
                if (retval)
                        goto out;
@@ -254,7 +254,7 @@ static int atmel_abdac_trigger(struct snd_pcm_substream *substream, int cmd)
                dw_dma_cyclic_stop(dac->dma.chan);
                dac_writel(dac, DATA, 0);
                dac_writel(dac, CTRL, 0);
-               clk_disable(dac->sample_clk);
+               clk_disable_unprepare(dac->sample_clk);
                break;
        default:
                retval = -EINVAL;
@@ -429,7 +429,7 @@ static int atmel_abdac_probe(struct platform_device *pdev)
                retval = PTR_ERR(sample_clk);
                goto out_put_pclk;
        }
-       clk_enable(pclk);
+       clk_prepare_enable(pclk);
 
        retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
                              SNDRV_DEFAULT_STR1, THIS_MODULE,
@@ -528,7 +528,7 @@ out_free_card:
        snd_card_free(card);
 out_put_sample_clk:
        clk_put(sample_clk);
-       clk_disable(pclk);
+       clk_disable_unprepare(pclk);
 out_put_pclk:
        clk_put(pclk);
        return retval;
@@ -541,8 +541,8 @@ static int atmel_abdac_suspend(struct device *pdev)
        struct atmel_abdac *dac = card->private_data;
 
        dw_dma_cyclic_stop(dac->dma.chan);
-       clk_disable(dac->sample_clk);
-       clk_disable(dac->pclk);
+       clk_disable_unprepare(dac->sample_clk);
+       clk_disable_unprepare(dac->pclk);
 
        return 0;
 }
@@ -552,8 +552,8 @@ static int atmel_abdac_resume(struct device *pdev)
        struct snd_card *card = dev_get_drvdata(pdev);
        struct atmel_abdac *dac = card->private_data;
 
-       clk_enable(dac->pclk);
-       clk_enable(dac->sample_clk);
+       clk_prepare_enable(dac->pclk);
+       clk_prepare_enable(dac->sample_clk);
        if (test_bit(DMA_READY, &dac->flags))
                dw_dma_cyclic_start(dac->dma.chan);
 
@@ -572,7 +572,7 @@ static int atmel_abdac_remove(struct platform_device *pdev)
        struct atmel_abdac *dac = get_dac(card);
 
        clk_put(dac->sample_clk);
-       clk_disable(dac->pclk);
+       clk_disable_unprepare(dac->pclk);
        clk_put(dac->pclk);
 
        dma_release_channel(dac->dma.chan);