diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 314832216..d61445b3a 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1033,7 +1033,6 @@ static int dai_reset(struct comp_dev *dev) /* used to pass standard and bespoke command (with data) to component */ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, int cmd) { - int prev_state = dev->state; int ret; comp_dbg(dev, "dai_comp_trigger_internal(), command = %u", cmd); @@ -1079,11 +1078,9 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, /* only start the DAI if we are not XRUN handling */ if (dd->xrun == 0) { /* recover valid start position */ - if (dev->state == COMP_STATE_ACTIVE) { - ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index); - if (ret < 0) - return ret; - } + ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index); + if (ret < 0) + return ret; /* dma_config needed after stop */ ret = dma_config(dd->chan->dma->z_dev, dd->chan->index, dd->z_config); @@ -1132,21 +1129,11 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, case COMP_TRIGGER_PAUSE: comp_dbg(dev, "dai_comp_trigger_internal(), PAUSE"); #if CONFIG_COMP_DAI_TRIGGER_ORDER_REVERSE - if (prev_state == COMP_STATE_ACTIVE) { - ret = dma_suspend(dd->chan->dma->z_dev, dd->chan->index); - } else { - comp_warn(dev, "dma was stopped earlier"); - ret = 0; - } + ret = dma_suspend(dd->chan->dma->z_dev, dd->chan->index); dai_trigger_op(dd->dai, cmd, dev->direction); #else dai_trigger_op(dd->dai, cmd, dev->direction); - if (prev_state == COMP_STATE_ACTIVE) { - ret = dma_suspend(dd->chan->dma->z_dev, dd->chan->index); - } else { - comp_warn(dev, "dma was stopped earlier"); - ret = 0; - } + ret = dma_suspend(dd->chan->dma->z_dev, dd->chan->index); #endif break; case COMP_TRIGGER_PRE_START: diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index a2477d9e3..80c0c5ac5 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -557,13 +557,10 @@ int host_zephyr_trigger(struct host_data *hd, struct comp_dev *dev, int cmd) break; case COMP_TRIGGER_STOP: case COMP_TRIGGER_XRUN: - if (dev->state == COMP_STATE_ACTIVE) { - ret = dma_stop(hd->chan->dma->z_dev, hd->chan->index); - if (ret < 0) - comp_err(dev, "host_trigger(): dma stop failed: %d", - ret); - } - + ret = dma_stop(hd->chan->dma->z_dev, hd->chan->index); + if (ret < 0) + comp_err(dev, "host_trigger(): dma stop failed: %d", + ret); break; default: break; @@ -1015,8 +1012,7 @@ static int host_position(struct comp_dev *dev, void host_zephyr_reset(struct host_data *hd, uint16_t state) { if (hd->chan) { - if (state == COMP_STATE_ACTIVE) - dma_stop(hd->chan->dma->z_dev, hd->chan->index); + dma_stop(hd->chan->dma->z_dev, hd->chan->index); dma_release_channel(hd->dma->z_dev, hd->chan->index); hd->chan = NULL; } diff --git a/src/ipc/ipc4/dai.c b/src/ipc/ipc4/dai.c index 63cce5774..4d3f871ea 100644 --- a/src/ipc/ipc4/dai.c +++ b/src/ipc/ipc4/dai.c @@ -168,8 +168,7 @@ void dai_dma_release(struct dai_data *dd, struct comp_dev *dev) */ #if CONFIG_ZEPHYR_NATIVE_DRIVERS /* if reset is after pause dma has already been stopped */ - if (dev->state != COMP_STATE_PAUSED) - dma_stop(dd->chan->dma->z_dev, dd->chan->index); + dma_stop(dd->chan->dma->z_dev, dd->chan->index); dma_release_channel(dd->chan->dma->z_dev, dd->chan->index); #else