mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 17:12:50 -04:00
spi: spi-mem: Add a packed command operation
Instead of repeating the command opcode twice, some flash devices try to pack command and address bits. In this case, the second opcode byte being sent (LSB) is free to be used. The input data must be ANDed to only provide the relevant bits. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://patch.msgid.link/20260410-winbond-6-19-rc1-oddr-v1-2-2ac4827a3868@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
5e75c1d4d3
commit
f79ee9e4b2
@@ -28,6 +28,14 @@
|
||||
.dtr = true, \
|
||||
}
|
||||
|
||||
#define SPI_MEM_DTR_OP_PACKED_CMD(__opcode, __addr, __buswidth) \
|
||||
{ \
|
||||
.nbytes = 2, \
|
||||
.opcode = __opcode << 8 | __addr, \
|
||||
.buswidth = __buswidth, \
|
||||
.dtr = true, \
|
||||
}
|
||||
|
||||
#define SPI_MEM_OP_ADDR(__nbytes, __val, __buswidth) \
|
||||
{ \
|
||||
.nbytes = __nbytes, \
|
||||
|
||||
Reference in New Issue
Block a user