summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>2020-09-20 14:23:19 +0300
committerMark Brown <broonie@kernel.org>2020-09-29 16:37:12 +0100
commitb86fed121fe6bf5bcac1c258472791ca352f47cf (patch)
tree61002c6db9b1951e1e25ced6e23a1bcf97f23c08 /drivers
parent7a4d61f1dc94871154b2d06d671a5c20aea16ff2 (diff)
downloadlinux-stable-b86fed121fe6bf5bcac1c258472791ca352f47cf.tar.gz
linux-stable-b86fed121fe6bf5bcac1c258472791ca352f47cf.tar.bz2
linux-stable-b86fed121fe6bf5bcac1c258472791ca352f47cf.zip
spi: dw-dma: Detach DMA transfer into a dedicated method
In order to add an alternative method of DMA-based SPI transfer first we need to detach the currently available one from the common code. Here we move the normal DMA-based SPI transfer execution functionality into a dedicated method. It will be utilized if either the DMA engine supports an unlimited number SG entries or Tx-only SPI transfer is requested. But currently just use it for any SPI transfer. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Link: https://lore.kernel.org/r/20200920112322.24585-9-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-dw-dma.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index 9f70818acce6..f2baefcae9ae 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -441,7 +441,8 @@ static int dw_spi_dma_setup(struct dw_spi *dws, struct spi_transfer *xfer)
return 0;
}
-static int dw_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer)
+static int dw_spi_dma_transfer_all(struct dw_spi *dws,
+ struct spi_transfer *xfer)
{
int ret;
@@ -462,7 +463,14 @@ static int dw_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer)
dma_async_issue_pending(dws->txchan);
- ret = dw_spi_dma_wait(dws, xfer);
+ return dw_spi_dma_wait(dws, xfer);
+}
+
+static int dw_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer)
+{
+ int ret;
+
+ ret = dw_spi_dma_transfer_all(dws, xfer);
if (ret)
return ret;