dmaengine: axi-dmac: Discover length alignment requirement
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 27 May 2019 06:55:17 +0000 (09:55 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 27 May 2019 07:06:08 +0000 (12:36 +0530)
commita5b20600a67a9b78a63e8d5b0c59327ddf636064
tree7284d796ca41be16c806e15a4ac2432947a14c28
parentd27ac2e02bf256d4e824e7c1e1e1afa2b96cefcc
dmaengine: axi-dmac: Discover length alignment requirement

Starting with version 4.1.a the AXI-DMAC is capable of reporting the
required length alignment.

The LSBs that are required to be set for alignment will always read back as
set from the transfer length register. It is not possible to clear them by
writing a 0. This means the driver can discover the length alignment
requirement by writing 0 to that register and reading back the value.

Since the DMA will support length alignment requirements that are different
from the address alignment requirement track both of them independently.

For older versions of the peripheral assume that the length alignment
requirement is equal to the address alignment requirement.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dma-axi-dmac.c