]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10213-2: ASoC: dmaengine: Merge trigger RESUME to START and SUSPEND to STOP
authorShengjiu Wang <shengjiu.wang@freescale.com>
Mon, 9 Feb 2015 10:21:27 +0000 (18:21 +0800)
committerShengjiu Wang <shengjiu.wang@freescale.com>
Tue, 10 Feb 2015 03:09:17 +0000 (11:09 +0800)
Merged from 2a17c1bbcd83a9d9f6d07bc0545742a59a043ae4

The SDMA driver doesn't support DMA_PAUSE and DMA_RESUME commands.
So this patch use TRIGGER_START for TRIGGER_RESUME and TRIGGER_SUSPEND
for TRIGGER_STOP as a work around so that Audio can normally stop
and restart its corresponding DMA channels.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
sound/core/pcm_dmaengine.c

index fe527cff3e2b2877cee2f6dac1de1a5db49eec43..1b1683253b062c6622784c53981b2291eca375e2 100644 (file)
@@ -5,7 +5,7 @@
  *  Based on:
  *     imx-pcm-dma-mx2.c, Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
  *     mxs-pcm.c, Copyright (C) 2011 Freescale Semiconductor, Inc.
- *     imx-pcm-dma.c, Copyright (C) 2014 Freescale Semiconductor, Inc.
+ *     imx-pcm-dma.c, Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
  *     ep93xx-pcm.c, Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
  *                   Copyright (C) 2006 Applied Data Systems
  *
@@ -183,20 +183,16 @@ int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
+       case SNDRV_PCM_TRIGGER_RESUME:
+       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
                ret = dmaengine_pcm_prepare_and_submit(substream);
                if (ret)
                        return ret;
                dma_async_issue_pending(prtd->dma_chan);
                break;
-       case SNDRV_PCM_TRIGGER_RESUME:
-       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-               dmaengine_resume(prtd->dma_chan);
-               break;
+       case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               dmaengine_pause(prtd->dma_chan);
-               break;
-       case SNDRV_PCM_TRIGGER_STOP:
                dmaengine_terminate_all(prtd->dma_chan);
                break;
        default: