ALSA: atmel_abdac: Add missing clock prepare

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>
This commit is contained in:
Alexander Stein 2014-12-05 20:10:07 +01:00 committed by Takashi Iwai
parent 1132015b16
commit 0481845401
1 changed files with 9 additions and 9 deletions

View 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_PAUSE_RELEASE: /* fall through */
case SNDRV_PCM_TRIGGER_RESUME: /* fall through */ case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
clk_enable(dac->sample_clk); clk_prepare_enable(dac->sample_clk);
retval = dw_dma_cyclic_start(dac->dma.chan); retval = dw_dma_cyclic_start(dac->dma.chan);
if (retval) if (retval)
goto out; 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); dw_dma_cyclic_stop(dac->dma.chan);
dac_writel(dac, DATA, 0); dac_writel(dac, DATA, 0);
dac_writel(dac, CTRL, 0); dac_writel(dac, CTRL, 0);
clk_disable(dac->sample_clk); clk_disable_unprepare(dac->sample_clk);
break; break;
default: default:
retval = -EINVAL; retval = -EINVAL;
@ -429,7 +429,7 @@ static int atmel_abdac_probe(struct platform_device *pdev)
retval = PTR_ERR(sample_clk); retval = PTR_ERR(sample_clk);
goto out_put_pclk; goto out_put_pclk;
} }
clk_enable(pclk); clk_prepare_enable(pclk);
retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
SNDRV_DEFAULT_STR1, THIS_MODULE, SNDRV_DEFAULT_STR1, THIS_MODULE,
@ -528,7 +528,7 @@ static int atmel_abdac_probe(struct platform_device *pdev)
snd_card_free(card); snd_card_free(card);
out_put_sample_clk: out_put_sample_clk:
clk_put(sample_clk); clk_put(sample_clk);
clk_disable(pclk); clk_disable_unprepare(pclk);
out_put_pclk: out_put_pclk:
clk_put(pclk); clk_put(pclk);
return retval; return retval;
@ -541,8 +541,8 @@ static int atmel_abdac_suspend(struct device *pdev)
struct atmel_abdac *dac = card->private_data; struct atmel_abdac *dac = card->private_data;
dw_dma_cyclic_stop(dac->dma.chan); dw_dma_cyclic_stop(dac->dma.chan);
clk_disable(dac->sample_clk); clk_disable_unprepare(dac->sample_clk);
clk_disable(dac->pclk); clk_disable_unprepare(dac->pclk);
return 0; return 0;
} }
@ -552,8 +552,8 @@ static int atmel_abdac_resume(struct device *pdev)
struct snd_card *card = dev_get_drvdata(pdev); struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_abdac *dac = card->private_data; struct atmel_abdac *dac = card->private_data;
clk_enable(dac->pclk); clk_prepare_enable(dac->pclk);
clk_enable(dac->sample_clk); clk_prepare_enable(dac->sample_clk);
if (test_bit(DMA_READY, &dac->flags)) if (test_bit(DMA_READY, &dac->flags))
dw_dma_cyclic_start(dac->dma.chan); 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); struct atmel_abdac *dac = get_dac(card);
clk_put(dac->sample_clk); clk_put(dac->sample_clk);
clk_disable(dac->pclk); clk_disable_unprepare(dac->pclk);
clk_put(dac->pclk); clk_put(dac->pclk);
dma_release_channel(dac->dma.chan); dma_release_channel(dac->dma.chan);