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)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 06:16:06 +0000 (15:16 +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;