]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dmaengine: stm32-dma3: improve residue granularity
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Fri, 31 May 2024 15:07:09 +0000 (17:07 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 11 Jun 2024 18:25:34 +0000 (23:55 +0530)
commit2088473802ab9641114681bee92ba902bccdc19b
treed5866f865a56cca70046c9425773ae0182562a2f
parentb62a13071cffad03690ee19656248077cb388a14
dmaengine: stm32-dma3: improve residue granularity

Implement own device_tx_status ops to compute the residue with a finer
granularity, up to bytes.
STM32 DMA3 has a bitfield, BNDT, in CxTR1 register which reflects the
number of bytes read from the source.
It also has a bitfield, FIFOL, in CxSR register which reflects the FIFO
level in units of programmed destination data width.
The channel is briefly suspended to get a coherent snapshot of registers.
It is possible to correct the fifo level when packing/unpacking is enabled
with destination increment.

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