summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2018-10-10 10:32:48 +0000
committerMark Brown <broonie@kernel.org>2018-10-12 18:54:02 +0200
commit133eb8e38b02c6c63a039523fca12737009a6686 (patch)
treeefda200882eb8119236ddad94f2193316222f7e4 /drivers/spi
parent5ba5a3730639caddf42af11c60f3f3d99d9a5f00 (diff)
downloadlinux-133eb8e38b02c6c63a039523fca12737009a6686.tar.bz2
spi: imx: use PIO mode if size is small
Use PIO mode instead if size is smaller than fifo size, since dma may be less efficient. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-imx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 037abbb852a4..dd1ce12aa386 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -224,6 +224,9 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
if (spi_imx->slave_mode)
return false;
+ if (transfer->len < spi_imx->devtype_data->fifo_size)
+ return false;
+
spi_imx->dynamic_burst = 0;
return true;