Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,12 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd)
break;
case COMP_TRIGGER_XRUN:
dd->xrun = 1;
/* fall through */
/* stop the DAI unconditionally */
dai_trigger(dd->dai, COMP_TRIGGER_STOP, dev->params.direction);
ret = dma_stop(dd->dma, dd->chan);
if (ret < 0)
return ret;
break;
case COMP_TRIGGER_PAUSE:
case COMP_TRIGGER_STOP:
wait_init(&dd->complete);
Expand Down
21 changes: 16 additions & 5 deletions src/drivers/dw-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,19 +484,30 @@ static int dw_dma_pause(struct dma *dma, int channel)
static int dw_dma_stop(struct dma *dma, int channel)
{
struct dma_pdata *p = dma_get_drvdata(dma);
int ret = 0;
int ret = 0;
int i = 0;
struct dw_lli2 *lli;
uint32_t flags;

spin_lock_irq(&dma->lock, flags);

trace_dma("DDi");

/* is channel stii active ? */
if ((dw_read(dma, DW_DMA_CHAN_EN) & (0x1 << channel))) {
trace_dma_error("ea0");
trace_error_value(channel);
dw_write(dma, DW_DMA_CHAN_EN, CHAN_DISABLE(channel));

#if DW_USE_HW_LLI
for (i = 0; i < p->chan[channel].desc_count; i++) {
lli = p->chan[channel].lli;
lli->ctrl_hi &= ~DW_CTLH_DONE(1);
lli++;
}

dcache_writeback_region(p->chan[channel].lli,
sizeof(struct dw_lli2) * p->chan[channel].desc_count);
#endif

dw_write(dma, DW_CLEAR_BLOCK, 0x1 << channel);

p->chan[channel].status = COMP_STATE_PREPARE;

spin_unlock_irq(&dma->lock, flags);
Expand Down