ASoC: samsung: dma: Implement audio stream pause/resume interfaces
authorHuang Chao <chao7.huang@samsung.com>
Fri, 13 Jun 2014 05:58:31 +0000 (13:58 +0800)
committerInki Dae <inki.dae@samsung.com>
Thu, 3 Jul 2014 00:54:36 +0000 (09:54 +0900)
This patch implements the pause/resume operations for audio stream
when users are playback the music, which will call the correlative
pause/resume callbacks from samsung dma operations set.

Change-Id: I151a9b48152dab52b9b618c54af4200fecd3fd8a
Signed-off-by: Huang Chao <chao7.huang@samsung.com>
sound/soc/samsung/dma.c

index 6e2b2b4..b0bdf51 100644 (file)
@@ -263,6 +263,16 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd)
                prtd->params->ops->stop(prtd->params->ch);
                break;
 
+       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+               prtd->state &= ~ST_RUNNING;
+               prtd->params->ops->pause(prtd->params->ch);
+               break;
+
+       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+               prtd->state |= ST_RUNNING;
+               prtd->params->ops->resume(prtd->params->ch);
+               break;
+
        default:
                ret = -EINVAL;
                break;