From f8126f09e4037e281119fa52ba9cedd2edf03f95 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Fri, 2 Mar 2018 15:17:31 +0800 Subject: [PATCH] cnl: dma: fix playback failed at second time Stop dma at the end of playback, or next time dma is not available for playback --- src/drivers/dw-dma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c index be19e127e..15d608cfc 100644 --- a/src/drivers/dw-dma.c +++ b/src/drivers/dw-dma.c @@ -1103,6 +1103,12 @@ static void dw_dma_irq_handler(void *data) p->chan[i].cb(p->chan[i].cb_data, DMA_IRQ_TYPE_BLOCK, &next); } + + if (next.size == DMA_RELOAD_END) { + trace_dma("LSo"); + /* disable channel, finished */ + dw_write(dma, DW_DMA_CHAN_EN, CHAN_DISABLE(i)); + } #endif /* end of a transfer */ if ((status_tfr & mask) &&