Skip to content

Commit f104114

Browse files
committed
dai-zephyr: call dma_stop() also if previous state is COMP_STATE_PAUSED
To ensure DMA is stopped in all cases, we need to call dma_stop() also when the previous state is PAUSED. With Zephyr commit ec9d94e06d4a ("dma: Document expected behavior of start/stop") the dma interface semantics were clarified. Build on this and call dma_stop() in all cases and make the code simpler to follow. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 567cafa commit f104114

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/audio/dai-zephyr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,9 +1102,8 @@ static int dai_comp_trigger_internal(struct comp_dev *dev, int cmd)
11021102
dai_trigger_op(dd->dai, cmd, dev->direction);
11031103
#else
11041104
dai_trigger_op(dd->dai, cmd, dev->direction);
1105-
if (prev_state == COMP_STATE_ACTIVE) {
1106-
ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index);
1107-
} else {
1105+
ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index);
1106+
if (ret) {
11081107
comp_warn(dev, "dma was stopped earlier");
11091108
ret = 0;
11101109
}

0 commit comments

Comments
 (0)