]> git.baikalelectronics.ru Git - kernel.git/commit
spi: sync up initial chipselect state
authorDavid Bauer <mail@david-bauer.net>
Fri, 16 Apr 2021 19:59:56 +0000 (21:59 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 19 Apr 2021 13:18:45 +0000 (14:18 +0100)
commit9f4d3bb32121af94be8e831fc4ef94ed5f6dfe2f
tree8af2fcc68fc238cafa45a31b364ad41eb33a7456
parentc0bf93f57382ebbf151789730768fef3de60e19b
spi: sync up initial chipselect state

When initially probing the SPI slave device, the call for disabling an
SPI device without the SPI_CS_HIGH flag is not applied, as the
condition for checking whether or not the state to be applied equals the
one currently set evaluates to true.

This however might not necessarily be the case, as the chipselect might
be active.

Add a force flag to spi_set_cs which allows to override this
early exit condition. Set it to false everywhere except when called
from spi_setup to sync up the initial CS state.

Fixes commit e257b8e50459 ("spi: Avoid setting the chip select if we don't
need to")

Signed-off-by: David Bauer <mail@david-bauer.net>
Link: https://lore.kernel.org/r/20210416195956.121811-1-mail@david-bauer.net
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c