Re: [PATCH 1/2 v2] spi: add SPI_MOSI_IDLE_LOW support from device tree

From: Couret Charles-Antoine

Date: Sun Mar 29 2026 - 11:42:34 EST


Le 29/03/26 à 16:25, Marcelo Schmitt a écrit :
Hello Charles-Antoine,

On 03/29, charles-antoine.couret@xxxxxxx wrote:
From: Charles-Antoine Couret <charles-antoine.couret@xxxxxxx>

This flag was introduced but was not added as device tree property which is
limiting the possibility to use this flag on real devices.
I'm not seeing why a device tree property is needed for SPI idle modes. For
idling high, the configuration is requested through spi_setup(). It should
work in similar way for idling low. See spi-summary.rst. If believe a dt
property is needed despite the spi_setup() interface, can you elaborate on why?

Hi Marcelo,

You're right that for a compliant SPI device, this devicetree option is not really relevant and this must be in the driver itself. However, I think the purpose of this mode is itself not designed for compliant SPI devices.

It's not unusual to use Linux SPI subsystem for devices which are not fully compliant with SPI in embedded context and where both options (idle low or idle high) can make sense based on hardware design around the device or the feature that you want. So having this property in device tree is documenting the hardware then giving more flexibility.

For example we used that to communicate with TI DAC161P997 device, where "IDLE low" setting can be used to detect when the device is really powered or not. But this is an optional setting, this option does not affect the rest of the driver.

I can understand this is a corner case and you don't want to support it at all, I thought this can be interesting to provide it anyway. If you want to reject it, I understand.


Thank you for the feedback and have a nice day.

Regards,