]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Add deferred DMA-channels setup support
authorBaikal Electronics <support@baikalelectronics.ru>
Fri, 24 Jun 2022 21:06:23 +0000 (00:06 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 27 Jun 2022 12:24:33 +0000 (13:24 +0100)
commitcf53fdbf1abbe84955ca7636eb9e0cfe262f4aa6
tree82b0585218d4a6baa5ba1c6339081276da8f1f30
parenta5f303fe3e0de9ef3fa4706d684ca437a9dc1d9f
spi: dw: Add deferred DMA-channels setup support

Currently if the source DMA device isn't ready to provide the channels
capable of the SPI DMA transfers, the DW SSI controller will be registered
with no DMA support. It isn't right since all what the driver needs to do
is to postpone the probe procedure until the DMA device is ready. Let's
fix that in the framework of the DWC SSI generic DMA implementation. First
we need to use the dma_request_chan() method instead of the
dma_request_slave_channel() function, because the later one is deprecated
and most importantly doesn't return the failure cause but the
NULL-pointer. Second we need to stop the DW SSI controller probe procedure
if the -EPROBE_DEFER error is returned on the DMA initialization. The
procedure will resume later when the channels are ready to be requested.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220624210623.6383-1-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-core.c
drivers/spi/spi-dw-dma.c