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 cb44d1e..a898755 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;
 }