Skip to content

Commit 398a8a4

Browse files
bastien-curutchetbroonie
authored andcommitted
spi: omap2-mcspi: drive SPI_CLK on transfer_setup()
If the cached contents of the CHCONF register doesn't have the FORCE bit set, the setup() function failed to set the relevant idle state of the SPI_CLK pin. In such case, the SPI_CLK's idle state is reached later with set_cs(), but it's too late for the first SPI transfer which fails since the CS is asserted before the clock reaching its idle state. Add a first write in setup() that always sets the FORCE bit. Keep the current write afterwards to ensure the FORCE bit won't stay in the cached contents of the CHCONF register unless it's intended. Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20250912-omap-spi-fix-v1-1-f925b0d27ede@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 30dbc1c commit 398a8a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/spi/spi-omap2-mcspi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi,
988988
else
989989
l &= ~OMAP2_MCSPI_CHCONF_PHA;
990990

991+
mcspi_write_chconf0(spi, l | OMAP2_MCSPI_CHCONF_FORCE);
991992
mcspi_write_chconf0(spi, l);
992993

993994
cs->mode = spi->mode;

0 commit comments

Comments
 (0)