aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2012-09-01 04:38:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-06 06:55:59 -0400
commit57b2d68863f281737d8596cb3d76d89d9cc54fd8 (patch)
tree106d78a1ed789c43c30d38f3fef876ac75c0acc6
parent37f45cc54cb03cac4a6b865b32bc705bb0cb1d29 (diff)
ASoC: samsung dma - Don't indicate support for pause/resume.
The pause and resume operations indicate that the stream can be un-paused/resumed from the exact location they were paused/suspended. This is not true for this driver, the pause and suspend triggers share the same code path with stop, they flush all pending DMA transfers. This drops all pending samples. The pause_release/resume triggers are the same as start, except that prepare won't be called beforehand, nothing will be enqueued to the DMA engine and nothing will happen (no audio). Removing the pause flag will let apps know that it isn't supported. Removing the resume flag will cause user space to call prepare and start instead of resume, so audio will continue playing when the system wakes up. Before removing the pause and resume flags, I tested this on an exynos 5250, using 'aplay -i'. Pause/un-pause leads to silence followed by a write error. Suspend/resume testing led to the same result. Removing the two flags fixes suspend/resume (since snd_pcm_prepare is called again). And leads to a proper reporting of pause not supported. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
-rw-r--r--sound/soc/samsung/dma.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index f3ebc38c10fe..b70964ea448c 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -34,9 +34,7 @@ static const struct snd_pcm_hardware dma_hardware = {
34 .info = SNDRV_PCM_INFO_INTERLEAVED | 34 .info = SNDRV_PCM_INFO_INTERLEAVED |
35 SNDRV_PCM_INFO_BLOCK_TRANSFER | 35 SNDRV_PCM_INFO_BLOCK_TRANSFER |
36 SNDRV_PCM_INFO_MMAP | 36 SNDRV_PCM_INFO_MMAP |
37 SNDRV_PCM_INFO_MMAP_VALID | 37 SNDRV_PCM_INFO_MMAP_VALID,
38 SNDRV_PCM_INFO_PAUSE |
39 SNDRV_PCM_INFO_RESUME,
40 .formats = SNDRV_PCM_FMTBIT_S16_LE | 38 .formats = SNDRV_PCM_FMTBIT_S16_LE |
41 SNDRV_PCM_FMTBIT_U16_LE | 39 SNDRV_PCM_FMTBIT_U16_LE |
42 SNDRV_PCM_FMTBIT_U8 | 40 SNDRV_PCM_FMTBIT_U8 |
@@ -248,15 +246,11 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd)
248 246
249 switch (cmd) { 247 switch (cmd) {
250 case SNDRV_PCM_TRIGGER_START: 248 case SNDRV_PCM_TRIGGER_START:
251 case SNDRV_PCM_TRIGGER_RESUME:
252 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
253 prtd->state |= ST_RUNNING; 249 prtd->state |= ST_RUNNING;
254 prtd->params->ops->trigger(prtd->params->ch); 250 prtd->params->ops->trigger(prtd->params->ch);
255 break; 251 break;
256 252
257 case SNDRV_PCM_TRIGGER_STOP: 253 case SNDRV_PCM_TRIGGER_STOP:
258 case SNDRV_PCM_TRIGGER_SUSPEND:
259 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
260 prtd->state &= ~ST_RUNNING; 254 prtd->state &= ~ST_RUNNING;
261 prtd->params->ops->stop(prtd->params->ch); 255 prtd->params->ops->stop(prtd->params->ch);
262 break; 256 break;