Skip to content
Merged
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
13 changes: 0 additions & 13 deletions src/drivers/dw/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,32 +335,19 @@ static int dw_dma_start(struct dma_chan_data *channel)
static int dw_dma_release(struct dma_chan_data *channel)
{
struct dw_dma_chan_data *dw_chan = dma_chan_get_data(channel);
struct dma *dma = channel->dma;
uint32_t flags;
int ret;

trace_dwdma("dw_dma_release(): dma %d channel %d release",
channel->dma->plat_data.id, channel->index);

irq_local_disable(flags);

/* now we wait for FIFO to be empty */
ret = poll_for_register_delay(dma_base(dma) +
DW_CFG_LOW(channel->index),
DW_CFGL_FIFO_EMPTY,
DW_CFGL_FIFO_EMPTY,
DW_DMA_TIMEOUT);

/* get next lli for proper release */
dw_chan->lli_current = (struct dw_lli *)dw_chan->lli_current->llp;

/* prepare to start */
dw_dma_stop(channel);

if (ret < 0)
trace_dwdma_error("dw_dma_release() error: dma %d channel %d timeout",
dma->plat_data.id, channel->index);

irq_local_enable(flags);

return 0;
Expand Down