Thread (8 messages) flat view 8 messages, 2 authors, 2021-01-14

Re: SPI not working on 5.10 and 5.11, bisected to 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors")

From: Christophe Leroy <hidden>
Date: 2021-01-14 12:34:57
Also in: linux-spi, lkml


Le 14/01/2021 à 12:59, Mark Brown a écrit :
On Thu, Jan 14, 2021 at 12:27:42PM +0100, Christophe Leroy wrote:
quoted
Today I have in the DTS the CS GPIOs declared as ACTIVE_LOW.
quoted
If I declare them as ACTIVE_HIGH instead, then I also have to set
spi-cs-high property, otherwise of_gpio_flags_quirks() is not happy and
forces the GPIO ACTIVE LOW.
quoted
When I set spi-cs-high property, it sets the SPI_CS_HIGH bit in spi->mode.
OK, so it sounds like you want SPI_CS_HIGH and that is being set
correctly?
quoted
In fsl_spi_chipselect(), we have

	bool pol = spi->mode & SPI_CS_HIGH

Then
	pdata->cs_control(spi, pol);
quoted
So changing the board config is compensated by the above, and at the end it still doesn't work.
This is a driver bug, the driver set_cs() operation should not be
modifying the value it is told to set.
A driver bug ? Or maybe a change forgotten in commit  766c6b63aa04 ("spi: fix client driver 
breakages when using GPIO descriptors") ?

I'm almost sure it was not a bug, it is in line which what is said in the comment removed by the 
above mentionned commit.

I'll send a fix.

Christophe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help