spi: dw: Add DMA directional capability check
authorJoy Chakraborty <joychakr@google.com>
Fri, 12 May 2023 10:47:43 +0000 (10:47 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 15 May 2023 01:46:16 +0000 (10:46 +0900)
commitd1ca1c5297ba9260942c0b3f1171a98a432bdfec
tree3043d9c0cb9360283ed259dd467897667ad43cb7
parentf603a3f083aeb9438865975c28b27be0afaae0c1
spi: dw: Add DMA directional capability check

Check capabilities of DMA controller during init to make sure it is
capable of handling MEM2DEV for tx channel, DEV2MEM for rx channel.

Current DW DMA driver requires both tx and rx channel to be configured
and functional for any kind of transfers to take effect including
half duplex. Hence, check for both tx and rx direction and fail on
unavailbility of either.

* 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-2-joychakr@google.com
Signed-off-by: Mark Brown <broonie@kernel.org
drivers/spi/spi-dw-dma.c