Re: [PATCH] spi: tegra114: initialize native chip selects inactive

From: Jon Hunter

Date: Tue Jul 28 2026 - 17:11:45 EST




On 28/07/2026 21:03, Abraham Zukor wrote:
On 28/07/2026 10:34, Jon Hunter wrote:
Exactly. That's my point. Which is the right one? The answer is
probably neither, but whatever is present on the bus.

I think that defaulting to active-low is correct. The Tegra234 SPI
controller hardware defaults to active-low (all bits in CS_POL_INACTIVE
are set) so an active-high device is already asserted before this driver
initializes. I checked the controller drivers under drivers/spi/; they
either default to active-low or preserve the hardware default.

I am a bit reluctant to make this change after 10+ years of this driver being around.

A more complex option is to scan the device tree children, check each
item for whether it uses native chip select (as opposed to GPIO CS) and
check for spi-cs-high. I found no other spi drivers that do this at
probe time, and I don't think it's worth the complexity, but I can send
it as a v2 if needed.

Right. Although this patch is specific to Tegra, I am guessing that other devices could also face similar issues and therefore, it would seem that having a generic facility to scan the devices would be ideal.

Jon

--
nvpublic