Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: dma-axi-dmac: Add cyclic transfers in .device_prep_peripheral_dma_vec()

Add support for cyclic transfers by checking the DMA_PREP_REPEAT
flag. If the flag is set, close the loop and clear the flag for the last
segment (the same done for .device_prep_dma_cyclic().

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20260303-axi-dac-cyclic-support-v2-2-0db27b4be95a@analog.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Nuno Sá and committed by
Vinod Koul
ac85913a 5f88899e

+6 -1
+6 -1
drivers/dma/dma-axi-dmac.c
··· 657 657 vecs[i].len, dsg); 658 658 } 659 659 660 - desc->cyclic = false; 660 + desc->cyclic = flags & DMA_PREP_REPEAT; 661 + if (desc->cyclic) { 662 + /* Chain the last descriptor to the first, and remove its "last" flag */ 663 + desc->sg[num_sgs - 1].hw->flags &= ~AXI_DMAC_HW_FLAG_LAST; 664 + desc->sg[num_sgs - 1].hw->next_sg_addr = desc->sg[0].hw_phys; 665 + } 661 666 662 667 return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); 663 668 }