ASoC: DaVinci: Fix stream restart error
authorChaithrika U S <chaithrika@ti.com>
Wed, 20 Jan 2010 11:36:33 +0000 (17:06 +0530)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 26 Jan 2010 11:55:54 +0000 (11:55 +0000)
Sometimes after a suspend-resume cycle, the ALSA application
restarts the stream when resume fails and McASP fails to work
as the clock is not enabled. This patch corrects this bug.

Testes on TI DA850/OMAP-L138 EVM.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/davinci/davinci-mcasp.c

index a613bbb..ab6518d 100644 (file)
@@ -768,13 +768,12 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
 
        switch (cmd) {
        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;
                }
-               /* Fall through */
-       case SNDRV_PCM_TRIGGER_START:
-       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
                davinci_mcasp_start(dev, substream->stream);
                break;