drivers: audio: Don't stop cxd56 when stopped

Avoid trying to stop the driver when already stopped.

Signed-off-by: Tobias Johansson <tobias.johansson@sony.com>
This commit is contained in:
Tobias Johansson 2021-11-17 14:16:56 +01:00 committed by Xiang Xiao
parent e9e15689d0
commit 6735cf412e

View File

@ -1291,8 +1291,9 @@ static void _process_audio_with_src(cxd56_dmahandle_t hdl, uint16_t err_code)
{
/* Notify end of data */
if (dev->state != CXD56_DEV_STATE_PAUSED
&& dq_count(&dev->down_pendq) == 0)
if (dev->state != CXD56_DEV_STATE_PAUSED &&
dev->state != CXD56_DEV_STATE_STOPPED &&
dq_count(&dev->down_pendq) == 0)
{
msg.msg_id = AUDIO_MSG_STOP;
msg.u.data = 0;
@ -1393,7 +1394,8 @@ static void _process_audio(cxd56_dmahandle_t hdl, uint16_t err_code)
{
/* Notify end of data */
if (dev->state != CXD56_DEV_STATE_PAUSED)
if (dev->state != CXD56_DEV_STATE_PAUSED &&
dev->state != CXD56_DEV_STATE_STOPPED)
{
audinfo("DMA_TRANS up_pendq=%d \n",
dq_count(&dev->up_pendq));