]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dmaengine: axi-dmac: Add support for interleaved cyclic transfers
authorDragos Bogdan <dragos.bogdan@analog.com>
Thu, 16 May 2019 07:04:43 +0000 (10:04 +0300)
committerVinod Koul <vkoul@kernel.org>
Tue, 21 May 2019 05:06:05 +0000 (10:36 +0530)
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 <dragos.bogdan@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dma-axi-dmac.c

index f32fdf21edbda677aaad70814b4a5ee63792610e..4d2cae0bebb57b80cd8dda7b6b97d61f7991c2d2 100644 (file)
@@ -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);
 }