• Joy Chakraborty's avatar
    spi: dw: Add DMA directional capability check · d1ca1c52
    Joy Chakraborty authored
    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
    d1ca1c52
spi-dw-dma.c 17.2 KB