Skip to content

Commit 28c3edc

Browse files
committed
spi: spi-mem: Create a repeated address operation
In octal DTR mode addresses may either be long enough to cover at least two bytes (in which case the existing macro works), or otherwise for single byte addresses, the byte must also be duplicated and sent twice: on each front of the clock. Create a macro for this common case. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 1ebbefb commit 28c3edc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/linux/spi/spi-mem.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
.dtr = true, \
5252
}
5353

54+
#define SPI_MEM_DTR_OP_RPT_ADDR(__val, __buswidth) \
55+
{ \
56+
.nbytes = 2, \
57+
.val = __val | __val << 8, \
58+
.buswidth = __buswidth, \
59+
.dtr = true, \
60+
}
61+
5462
#define SPI_MEM_OP_NO_ADDR { }
5563

5664
#define SPI_MEM_OP_DUMMY(__nbytes, __buswidth) \

0 commit comments

Comments
 (0)