From e687b0b1c591e88c2e8afaf80c23978e7227c2b5 Mon Sep 17 00:00:00 2001 From: Huang Chao Date: Fri, 13 Jun 2014 13:58:31 +0800 Subject: [PATCH] ASoC: samsung: dma: Implement audio stream pause/resume interfaces 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 --- sound/soc/samsung/dma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 6e2b2b4..b0bdf51 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -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; -- 2.7.4