Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: add SPI_RX_CPHA_FLIP mode bit

Some SPI devices latch MOSI bits on one clock phase, but produce valid
MISO bits on the other phase. Add SPI_RX_CPHA_FLIP mode to instruct the
controller driver to flip CPHA for Rx (MISO) only transfers.

Signed-off-by: Baruch Siach <baruch.siach@siklu.com>
Link: https://lore.kernel.org/r/a715ca92713ca02071f33dcca9960a66a03c949a.1649702729.git.baruch@tkos.co.il
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Baruch Siach and committed by
Mark Brown
b617be33 4bbaa857

+2 -1
+2 -1
include/uapi/linux/spi/spi.h
··· 27 27 #define SPI_TX_OCTAL _BITUL(13) /* transmit with 8 wires */ 28 28 #define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */ 29 29 #define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */ 30 + #define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */ 30 31 31 32 /* 32 33 * All the bits defined above should be covered by SPI_MODE_USER_MASK. ··· 37 36 * These bits must not overlap. A static assert check should make sure of that. 38 37 * If adding extra bits, make sure to increase the bit index below as well. 39 38 */ 40 - #define SPI_MODE_USER_MASK (_BITUL(16) - 1) 39 + #define SPI_MODE_USER_MASK (_BITUL(17) - 1) 41 40 42 41 #endif /* _UAPI_SPI_H */