mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
665ebe926e
commit
02fb05a598
1 changed files with 6 additions and 0 deletions
|
@ -182,6 +182,7 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
|
||||||
int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||||
{
|
{
|
||||||
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
|
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
|
||||||
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -196,6 +197,11 @@ int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||||
dmaengine_resume(prtd->dma_chan);
|
dmaengine_resume(prtd->dma_chan);
|
||||||
break;
|
break;
|
||||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||||
|
if (runtime->info & SNDRV_PCM_INFO_PAUSE)
|
||||||
|
dmaengine_pause(prtd->dma_chan);
|
||||||
|
else
|
||||||
|
dmaengine_terminate_all(prtd->dma_chan);
|
||||||
|
break;
|
||||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||||
dmaengine_pause(prtd->dma_chan);
|
dmaengine_pause(prtd->dma_chan);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue