spi: dw: Add DMA address widths capability check
authorJoy Chakraborty <joychakr@google.com>
Fri, 12 May 2023 10:47:44 +0000 (10:47 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 15 May 2023 01:46:17 +0000 (10:46 +0900)
commit020a3947e7f18e790cc72785281755f8c49e11d4
tree820a48a67b87bc4fa8b434b531568f958ee39d8b
parentd1ca1c5297ba9260942c0b3f1171a98a432bdfec
spi: dw: Add DMA address widths capability check

Store address width capabilities of DMA controller during init and check
the same per transfer to make sure the bits/word requirement can be met.

Current DW DMA driver requires both tx and rx channel to be configured
and functional hence a subset of both tx and rx channel address width
capability is checked with the width requirement(n_bytes) for a
transfer.

* tested on Baikal-T1 based system with DW SPI-looped back interface
transferring a chunk of data with DFS:8,12,16.

Signed-off-by: Joy Chakraborty <joychakr@google.com
Reviewed-by: Serge Semin <fancer.lancer@gmail.com
Tested-by: Serge Semin <fancer.lancer@gmail.com
Link: https://lore.kernel.org/r/20230512104746.1797865-3-joychakr@google.com
Signed-off-by: Mark Brown <broonie@kernel.org
drivers/spi/spi-dw-dma.c
drivers/spi/spi-dw.h