summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-03-19 11:52:04 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 07:22:57 +0200
commit934955968fa611706f3f2f06cdbda856b2813420 (patch)
tree2732b3e0bbce8a65e9d1a7d78a564bedef19a669 /sound/soc
parent2ed9e9e89a3734364c432db9a8e3e5b823f32791 (diff)
ASoC: wm_adsp: Correct handling of compressed streams that restart
commit 639e5eb3c7d67e407f2a71fccd95323751398f6f upstream. Previously support was added to allow streams to be stopped and started again without the DSP being power cycled and this was done by clearing the buffer state in trigger start. Another supported use-case is using the DSP for a trigger event then opening the compressed stream later to receive the audio, unfortunately clearing the buffer state in trigger start destroys the data received from such a trigger. Correct this issue by moving the call to wm_adsp_buffer_clear to be in trigger stop instead. Fixes: 61fc060c40e6 ("ASoC: wm_adsp: Support streams which can start/stop with DSP active") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm_adsp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 1dd291cebe67..8219e8f0630e 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3443,8 +3443,6 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd)
}
}
- wm_adsp_buffer_clear(compr->buf);
-
/* Trigger the IRQ at one fragment of data */
ret = wm_adsp_buffer_write(compr->buf,
HOST_BUFFER_FIELD(high_water_mark),
@@ -3456,6 +3454,7 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd)
}
break;
case SNDRV_PCM_TRIGGER_STOP:
+ wm_adsp_buffer_clear(compr->buf);
break;
default:
ret = -EINVAL;