Skip to contentSkip to conversation

spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller

PATCH Superseded Tudor Ambarus 1 participant 2 messages Apr 6, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller

Use the spi_mem_default_supports_op() core helper in order to take into account the buswidth specified by the user in device tree.

Fixes 0e6aae08e9ae ("spi: Add QuadSPI driver for Atmel SAMA5D2")
---
 drivers/spi/atmel-quadspi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/spi/atmel-quadspi.c +3 -0
index 92d9610df1fd..938017a60c8e 100644
@@ -277,6 +277,9 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op)
 static bool atmel_qspi_supports_op(struct spi_mem *mem,
 				   const struct spi_mem_op *op)
 {
+	if (!spi_mem_default_supports_op(mem, op))
+		return false;
+
 	if (atmel_qspi_find_mode(op) < 0)
 		return false;
 
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH 2/2 spi: atmel-quadspi: Remove duplicated DTR checks

Remove the DTR checks as they are already handled in spi_mem_default_supports_op(). This code removal was intentionally not done in the previous patch that introduced the use of the spi_mem_default_supports_op() core helper and fixed the buswidth adjustment between SPIMEM and the SPI controller, so that the fix can be easily backported to stable kernels.

---
 drivers/spi/atmel-quadspi.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/spi/atmel-quadspi.c +0 -6
index 938017a60c8e..480c0c8c18e4 100644
@@ -288,12 +288,6 @@ 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;
 }
 
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel