Skip to content

Commit

Permalink
dmaengine: axi-dmac: Add support for interleaved cyclic transfers
Browse files Browse the repository at this point in the history
The DMAC HDL core supports interleaved & cyclic transfers.
An example use-case for this mode is when the controller is used as a
video DMA.

This change sets the `cyclic` field to true, so that when the IRQ comes and
the `axi_dmac_transfer_done()` callback is called (from the interrupt
handler) the proper `vchan_cyclic_callback()` is called. This way the
DMAEngine framework will process data correctly for interleaved + cyclic
transfers.

This doesn't fix anything. It's an enhancement to the driver.

Signed-off-by: Dragos Bogdan <[email protected]>
Signed-off-by: Alexandru Ardelean <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
dbogdan authored and vinodkoul committed May 21, 2019
1 parent e405439 commit 8add6cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/dma/dma-axi-dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,9 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_interleaved(
desc->sg[0].y_len = 1;
}

if (flags & DMA_CYCLIC)
desc->cyclic = true;

return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
}

Expand Down

0 comments on commit 8add6cc

Please sign in to comment.