summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-qup.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-06-11 13:38:25 +0300
committerMark Brown <broonie@kernel.org>2024-06-11 13:38:25 +0300
commit412a05d6a91c6e3bb69741ddbde01c16c3ff94c5 (patch)
tree28d1604703331033b29d508c2be02ea95d5fa4e6 /drivers/spi/spi-qup.c
parent8a71710bb4797174733a16df2bcb8683fbe7caea (diff)
parente289df82344fecc104ad8326b9ab6da612b9c899 (diff)
downloadlinux-412a05d6a91c6e3bb69741ddbde01c16c3ff94c5.tar.xz
spi: Rework DMA mapped flag
Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>: The first part of the series (patches 1 to 7) is an introduction of a new helper followed by the user conversion. This consolidates the same code and also makes patch 8 (last one) be localised to the SPI core part. The last patch is the main rework to get rid of a recently introduced hack with a dummy SG list and move to the transfer-based DMA mapped flag. That said, the patches 1 to 7 may be applied right away since they have no functional change intended, while the last one needs more testing and reviewing.
Diffstat (limited to 'drivers/spi/spi-qup.c')
-rw-r--r--drivers/spi/spi-qup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 1e335cd961a4..1a2f9cd92b3c 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -5,6 +5,8 @@
#include <linux/clk.h>
#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/dmaengine.h>
#include <linux/err.h>
#include <linux/interconnect.h>
#include <linux/interrupt.h>
@@ -16,8 +18,7 @@
#include <linux/pm_opp.h>
#include <linux/pm_runtime.h>
#include <linux/spi/spi.h>
-#include <linux/dmaengine.h>
-#include <linux/dma-mapping.h>
+#include "internals.h"
#define QUP_CONFIG 0x0000
#define QUP_STATE 0x0004
@@ -709,9 +710,7 @@ static int spi_qup_io_prep(struct spi_device *spi, struct spi_transfer *xfer)
if (controller->n_words <= (controller->in_fifo_sz / sizeof(u32)))
controller->mode = QUP_IO_M_MODE_FIFO;
- else if (spi->controller->can_dma &&
- spi->controller->can_dma(spi->controller, spi, xfer) &&
- spi->controller->cur_msg_mapped)
+ else if (spi_xfer_is_dma_mapped(spi->controller, spi, xfer))
controller->mode = QUP_IO_M_MODE_BAM;
else
controller->mode = QUP_IO_M_MODE_BLOCK;