diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-03-01 12:38:59 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-03-01 12:38:59 +0100 |
commit | 6679ee1870f7ccdd48e2e5c57919240b8f19a6dc (patch) | |
tree | 225ed7efcc0bb7e3c90233576c6106538e17a275 /sound/soc/davinci/davinci-mcasp.c | |
parent | Merge branch 'topic/hda' into for-linus (diff) | |
parent | Merge branch 'for-2.6.34' of git://opensource.wolfsonmicro.com/linux-2.6-asoc... (diff) | |
download | linux-6679ee1870f7ccdd48e2e5c57919240b8f19a6dc.tar.xz linux-6679ee1870f7ccdd48e2e5c57919240b8f19a6dc.zip |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 0a302e1080d9..ab6518d86f18 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -767,14 +767,26 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, int ret = 0; switch (cmd) { - case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (!dev->clk_active) { + clk_enable(dev->clk); + dev->clk_active = 1; + } davinci_mcasp_start(dev, substream->stream); break; - case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: + davinci_mcasp_stop(dev, substream->stream); + if (dev->clk_active) { + clk_disable(dev->clk); + dev->clk_active = 0; + } + + break; + + case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: davinci_mcasp_stop(dev, substream->stream); break; @@ -866,6 +878,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) } clk_enable(dev->clk); + dev->clk_active = 1; dev->base = (void __iomem *)IO_ADDRESS(mem->start); dev->op_mode = pdata->op_mode; |