]> www.infradead.org Git - users/jedix/linux-maple.git/commit
spi: microchip-core: defer asserting chip select until just before write to TX FIFO
authorSteve Wilkins <steve.wilkins@raymarine.com>
Mon, 15 Jul 2024 11:13:53 +0000 (12:13 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 15 Jul 2024 18:08:16 +0000 (19:08 +0100)
commit22fd98c107c792e35db7abe45298bc3a29bf4723
tree7577777dd366a3dc9ebb70acedfd6be8d73ea119
parent502a582b8dd897d9282db47c0911d5320ef2e6b9
spi: microchip-core: defer asserting chip select until just before write to TX FIFO

Setting up many of the registers for a new SPI transfer requires the
SPI controller to be disabled after set_cs() has been called to assert
the chip select line. However, disabling the controller results in the
SCLK and MOSI output pins being tristate, which can cause clock
transitions to be seen by a slave device whilst SS is active. To fix
this, the CS is only set to inactive inline, whilst setting it active
is deferred until all registers are set up and the any controller
disables have been completed.

Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")
Signed-off-by: Steve Wilkins <steve.wilkins@raymarine.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240715-sanitizer-recant-dd96b7a97048@wendy
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-microchip-core.c