]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Fix incorrect cs_setup delay handling
authorHector Martin <marcan@marcan.st>
Fri, 10 Dec 2021 17:05:34 +0000 (02:05 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 13 Dec 2021 19:35:45 +0000 (19:35 +0000)
commit64dc6405a73de0fba1b4468eab0df0602957120b
tree0b42f0705f54ecf3491c700cf5f25c6032382506
parente809752ac63de1012af1837a619329b1b2235f28
spi: Fix incorrect cs_setup delay handling

Move the cs_setup delay to the end of spi_set_cs.

From include/linux/spi/spi.h:

 * @cs_setup: delay to be introduced by the controller after CS is
   asserted

The cs_setup delay needs to happen *after* CS is asserted, that is, at
the end of spi_set_cs, not at the beginning. Otherwise we're just
delaying before the SPI transaction starts at all, which isn't very
useful.

No drivers use this right now, but that is likely to change soon with an
upcoming Apple SPI HID transport driver.

Fixes: 32c0737ee44d ("spi: implement SW control for CS times")
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20211210170534.177139-1-marcan@marcan.st
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c