aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2014-05-19 05:23:53 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-19 05:31:24 -0400
commit02fb05a598e9393382f55132a36aff84f4d76ad5 (patch)
tree0283125bda8f59641d339c480256b0322607205d /sound
parent665ebe926e7b714369b5329d48745bfef17db512 (diff)
ALSA: pcm_dmaengine: Add check during device suspend
Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause() unconditinally during device suspend. In case where DMA controller doesn't support PAUSE/RESUME functionality, this call is not able to stop the DMA controller. In this scenario, audio playback doesn't resume after device resume. Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes the issue. It has been tested with audio playback on Samsung platform having PL330 DMA controller which doesn't support PAUSE/RESUME. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_dmaengine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index 94d08733cb38..76cbb9ec953a 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -182,6 +182,7 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
182int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd) 182int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
183{ 183{
184 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); 184 struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
185 struct snd_pcm_runtime *runtime = substream->runtime;
185 int ret; 186 int ret;
186 187
187 switch (cmd) { 188 switch (cmd) {
@@ -196,6 +197,11 @@ int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
196 dmaengine_resume(prtd->dma_chan); 197 dmaengine_resume(prtd->dma_chan);
197 break; 198 break;
198 case SNDRV_PCM_TRIGGER_SUSPEND: 199 case SNDRV_PCM_TRIGGER_SUSPEND:
200 if (runtime->info & SNDRV_PCM_INFO_PAUSE)
201 dmaengine_pause(prtd->dma_chan);
202 else
203 dmaengine_terminate_all(prtd->dma_chan);
204 break;
199 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 205 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
200 dmaengine_pause(prtd->dma_chan); 206 dmaengine_pause(prtd->dma_chan);
201 break; 207 break;