dmaengine: stm32-dma: introduce stm32_dma_sg_inc to manage chan->next_sg
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Thu, 5 May 2022 11:56:08 +0000 (13:56 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 19 May 2022 18:13:40 +0000 (23:43 +0530)
commitdb60a63eb6850fce081c1a22e7318e5d37f4dcf5
tree999c033d98ac915864dc6b494e1394d430e3eec7
parentd0b360e3c164be7ccc8eb2bfc341287959e27040
dmaengine: stm32-dma: introduce stm32_dma_sg_inc to manage chan->next_sg

chan->next_sg is used to know which transfer will start after the ongoing
one. It is incremented for each new transfer, either on transfer start for
non-cyclic transfers, or on transfer complete interrupt for cyclic
transfers.
For cyclic transfer, when the last item is reached, chan->next_sg must be
reinitialized to the first item.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220505115611.38845-2-amelie.delaunay@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-dma.c