History

spi: Add SPI_NO_TX/RX support

Transmit/receive only is a valid SPI mode. For example, the MOSI/TX line might be missing from an ADC while for a DAC the MISO/RX line may be optional. This patch adds these two new modes: SPI_NO_TX and SPI_NO_RX. This way, the drivers will be able to identify if any of these two lines is missing and to adjust the transfers accordingly.

Dragos Bogdan committed 5 years ago

Commit d9626081 parent f7005143 files · +47 −5Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/spi/spi.h+10−0
@@ -28,4 +28,14 @@ · 27 unmodified lines
28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
30 30
31/*
32 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
33 * The SPI_MODE_USER_MASK has the SPI_MODE_KERNEL_MASK counterpart in
34 * 'include/linux/spi/spi.h'. The bits defined here are from bit 0 upwards
35 * while in SPI_MODE_KERNEL_MASK they are from the other end downwards.
36 * These bits must not overlap. A static assert check should make sure of that.
37 * If adding extra bits, make sure to increase the bit index below as well.
38 */
39#define SPI_MODE_USER_MASK (_BITUL(16) - 1)
40
31#endif /* _UAPI_SPI_H */41#endif /* _UAPI_SPI_H */