Commit a45baa07 authored by Boerge Struempfel's avatar Boerge Struempfel Committed by Mark Brown

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: default avatarBoerge Struempfel <boerge.struempfel@gmail.com>
Link: https://lore.kernel.org/r/20230530141641.1155691-2-boerge.struempfel@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3e39448a
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */ #define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */ #define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */ #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. * All the bits defined above should be covered by SPI_MODE_USER_MASK.
...@@ -37,6 +38,6 @@ ...@@ -37,6 +38,6 @@
* These bits must not overlap. A static assert check should make sure of that. * 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. * 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 */ #endif /* _UAPI_SPI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment