spi: atmel-quadspi: reject DTR ops
authorPratyush Yadav <p.yadav@ti.com>
Tue, 23 Jun 2020 18:30:16 +0000 (00:00 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 14 Jul 2020 16:29:39 +0000 (17:29 +0100)
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-4-p.yadav@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/atmel-quadspi.c

index cb44d1e169aa457553bfe332625a5b231816c17a..a898755fb41e6d804149a521887a4b83acdeb39f 100644 (file)
@@ -285,6 +285,12 @@ static bool atmel_qspi_supports_op(struct spi_mem *mem,
                op->dummy.nbytes == 0)
                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;
+
        return true;
 }