ASoC: wm_adsp: Correct handling of compressed streams that restart
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 19 Mar 2019 11:52:04 +0000 (11:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:21:52 +0000 (07:21 +0200)
commit7d3f7107079b2e0480e8f3868f81608f7d8b7feb
treed7b2ccb03157754703871e9d97c68086d5ceb533
parent3b958d5e69729a98528c4efe82ccdd8174519736
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>
sound/soc/codecs/wm_adsp.c