summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2020-06-23 20:30:17 +0200
committerMark Brown <broonie@kernel.org>2020-07-14 18:29:40 +0200
commit4728f073bfc66b8b555274ef0d7741d7f5a48947 (patch)
treeca682afb38fe3c8e056d21dc575831e34a6be8c6 /drivers/spi
parentspi: atmel-quadspi: reject DTR ops (diff)
downloadlinux-4728f073bfc66b8b555274ef0d7741d7f5a48947.tar.xz
linux-4728f073bfc66b8b555274ef0d7741d7f5a48947.zip
spi: spi-mtk-nor: reject DTR ops
Double Transfer Rate (DTR) ops are added in spi-mem. But this controller doesn't support DTR transactions. Since we don't use the default supports_op(), which rejects all DTR ops, do that explicitly in our supports_op(). Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20200623183030.26591-5-p.yadav@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-mtk-nor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index d5f393871619..b08d8e9a8ee9 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -211,6 +211,12 @@ static bool mtk_nor_supports_op(struct spi_mem *mem,
if (op->cmd.buswidth != 1)
return false;
+ /* DTR ops not supported. */
+ if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr)
+ return false;
+ if (op->cmd.nbytes != 1)
+ return false;
+
if ((op->addr.nbytes == 3) || (op->addr.nbytes == 4)) {
if ((op->data.dir == SPI_MEM_DATA_IN) && mtk_nor_match_read(op))
return true;