public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op()
@ 2023-02-20  5:42 Dhruva Gole
  2023-02-27 10:22 ` Pratyush Yadav
  0 siblings, 1 reply; 2+ messages in thread
From: Dhruva Gole @ 2023-02-20  5:42 UTC (permalink / raw)
  To: Jagan Teki, u-boot
  Cc: Vignesh Raghavendra, Vaishnav Achath, Dhruva Gole, Pratyush Yadav,
	Pratyush Yadav

This should have been op->data.buswidth instead as we check for octal
bus width for the data related ops
Also add explanation for why there is checks for 8D even data bytes

Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---

Address Pratyush Yadav's comments from here:
https://lore.kernel.org/u-boot/20221106224617.2ievqx37mcvqntdr@yadavpratyush.com/

 drivers/spi/spi-mem.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 8e8995fc537f..57a36f31a5d3 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -181,8 +181,12 @@ bool spi_mem_dtr_supports_op(struct spi_slave *slave,
 	if (op->dummy.nbytes && op->dummy.buswidth == 8 && op->dummy.nbytes % 2)
 		return false;
 
+	/*
+	 * Transactions of odd length do not make sense for 8D-8D-8D mode
+	 * because a byte is transferred in just half a cycle.
+	 */
 	if (op->data.dir != SPI_MEM_NO_DATA &&
-	    op->dummy.buswidth == 8 && op->data.nbytes % 2)
+	    op->data.buswidth == 8 && op->data.nbytes % 2)
 		return false;
 
 	return spi_mem_check_buswidth(slave, op);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-27 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20  5:42 [PATCH] spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op() Dhruva Gole
2023-02-27 10:22 ` Pratyush Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox