Skip to content

Commit 0196932

Browse files
miquelraynalbroonie
authored andcommitted
spi: spi-mem: Make the DTR command operation macro more suitable
In order to introduce DTR support in SPI NAND, a number of macros had to be created in the spi-mem layer. One of them remained unused at this point, SPI_MEM_DTR_OP_CMD. Being in the process of introducing octal DTR support now, experience shows that as-is the macro is not useful. In order to be really useful in octal DTR mode, the command opcode (one byte) must always be transmitted on the 8 data lines on both the rising and falling edge of the clock. Align the macro with the real needs by duplicating the opcode in the buffer and doubling its size. Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://patch.msgid.link/20260109-winbond-v6-17-rc1-oddr-v2-1-1fff6a2ddb80@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0f61b18 commit 0196932

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

include/linux/spi/spi-mem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
.opcode = __opcode, \
2121
}
2222

23-
#define SPI_MEM_DTR_OP_CMD(__opcode, __buswidth) \
23+
#define SPI_MEM_DTR_OP_RPT_CMD(__opcode, __buswidth) \
2424
{ \
25-
.nbytes = 1, \
26-
.opcode = __opcode, \
25+
.nbytes = 2, \
26+
.opcode = __opcode | __opcode << 8, \
2727
.buswidth = __buswidth, \
2828
.dtr = true, \
2929
}

0 commit comments

Comments
 (0)