aboutsummaryrefslogtreecommitdiff
path: root/include/uapi/linux/spi
diff options
context:
space:
mode:
authorGravatar Boerge Struempfel <boerge.struempfel@gmail.com> 2023-05-30 16:16:37 +0200
committerGravatar Mark Brown <broonie@kernel.org> 2023-05-30 15:20:08 +0100
commita45baa079e2a6b7a5516354c6ff08702232384f5 (patch)
treea7e5c86a5032b656ea342004fd3483ef5457e7c3 /include/uapi/linux/spi
parentspi: Switch i2c drivers back to use .probe() (diff)
downloadlinux-a45baa079e2a6b7a5516354c6ff08702232384f5.tar.gz
linux-a45baa079e2a6b7a5516354c6ff08702232384f5.tar.bz2
linux-a45baa079e2a6b7a5516354c6ff08702232384f5.zip
spi: add SPI_MOSI_IDLE_LOW mode bit
Some spi controller switch the mosi line to high, whenever they are idle. This may not be desired in all use cases. For example neopixel leds can get confused and flicker due to misinterpreting the idle state. Therefore, we introduce a new spi-mode bit, with which the idle behaviour can be overwritten on a per device basis. Signed-off-by: Boerge Struempfel <boerge.struempfel@gmail.com> Link: https://lore.kernel.org/r/20230530141641.1155691-2-boerge.struempfel@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/uapi/linux/spi')
-rw-r--r--include/uapi/linux/spi/spi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/uapi/linux/spi/spi.h b/include/uapi/linux/spi/spi.h
index 9d5f58059703..ca56e477d161 100644
--- a/include/uapi/linux/spi/spi.h
+++ b/include/uapi/linux/spi/spi.h
@@ -28,6 +28,7 @@
#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */
+#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave mosi line low when idle */
/*
* All the bits defined above should be covered by SPI_MODE_USER_MASK.
@@ -37,6 +38,6 @@
* These bits must not overlap. A static assert check should make sure of that.
* If adding extra bits, make sure to increase the bit index below as well.
*/
-#define SPI_MODE_USER_MASK (_BITUL(17) - 1)
+#define SPI_MODE_USER_MASK (_BITUL(18) - 1)
#endif /* _UAPI_SPI_H */