Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,9 @@ static int dai_comp_trigger_internal(struct comp_dev *dev, int cmd)
/* 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);
Expand Down Expand Up @@ -1101,23 +1099,12 @@ static int dai_comp_trigger_internal(struct comp_dev *dev, int cmd)
dai_trigger_op(dd->dai, cmd, dev->direction);
#else
dai_trigger_op(dd->dai, cmd, dev->direction);
if (dev->state == COMP_STATE_ACTIVE) {
ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index);
} else {
comp_warn(dev, "dma was stopped earlier");
ret = 0;
}
ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index);
#endif
break;
case COMP_TRIGGER_PAUSE:
comp_dbg(dev, "dai_comp_trigger_internal(), PAUSE");
if (dev->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);
break;
case COMP_TRIGGER_PRE_START:
Expand Down
14 changes: 5 additions & 9 deletions src/audio/host-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,10 @@ static int host_trigger(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;
Expand Down Expand Up @@ -1052,8 +1049,7 @@ static int host_reset(struct comp_dev *dev)
comp_dbg(dev, "host_reset()");

if (hd->chan) {
if (dev->state == COMP_STATE_ACTIVE)
dma_stop(hd->chan->dma->z_dev, hd->chan->index);
dma_stop(hd->chan->dma->z_dev, hd->chan->index);

/* remove callback */
notifier_unregister(dev, hd->chan, NOTIFIER_ID_DMA_COPY);
Expand Down
4 changes: 1 addition & 3 deletions src/ipc/ipc4/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ void dai_dma_release(struct comp_dev *dev)
* TODO: refine power management when stream is paused
*/
#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);

/* remove callback */
notifier_unregister(dev, dd->chan, NOTIFIER_ID_DMA_COPY);
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ manifest:

- name: zephyr
repo-path: zephyr
revision: d9c4ec31fc49e7eef3c8c3b0d07827cc04e6efee
revision: 0c0d73721edb808b51a7ab136cfe01d1b2c1f87d
remote: zephyrproject
# Import some projects listed in zephyr/west.yml@revision
#
Expand Down