diff options
| author | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-01-09 20:18:00 +0300 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-01-29 22:21:38 +0300 |
| commit | 28c3edc43cb9ab6ebe43439d48a662a095409b03 (patch) | |
| tree | 97396c95e8b4fe1f659ef1f6c996243b83c0e2de /include/linux | |
| parent | 1ebbefb73ceba9c913ea42f44db1fe8e4d73cbc0 (diff) | |
| download | linux-28c3edc43cb9ab6ebe43439d48a662a095409b03.tar.xz | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/spi/spi-mem.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index e4db0924898c..5774e554c0f0 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -51,6 +51,14 @@ .dtr = true, \ } +#define SPI_MEM_DTR_OP_RPT_ADDR(__val, __buswidth) \ + { \ + .nbytes = 2, \ + .val = __val | __val << 8, \ + .buswidth = __buswidth, \ + .dtr = true, \ + } + #define SPI_MEM_OP_NO_ADDR { } #define SPI_MEM_OP_DUMMY(__nbytes, __buswidth) \ |
