]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Add capability to perform some transfer with chipselect off
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 7 Sep 2022 14:11:25 +0000 (16:11 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 7 Sep 2022 14:18:48 +0000 (15:18 +0100)
commitcdf04fd138e948f81817cad716fd4a2d58e6d8c2
tree2bd161ccc2de94ad813dfb9cb1549140b0117043
parent11cad4536c79be61036f0f251d56965a8afcdf4d
spi: Add capability to perform some transfer with chipselect off

Some components require a few clock cycles with chipselect off before
or/and after the data transfer done with CS on.

Typically IDT 801034 QUAD PCM CODEC datasheet states "Note *: CCLK
should have one cycle before CS goes low, and two cycles after
CS goes high".

The cycles "before" are implicitely provided by all previous activity
on the SPI bus. But the cycles "after" must be provided in order to
terminate the SPI transfer.

In order to use that kind of component, add a cs_off flag to
spi_transfer struct. When this flag is set, the transfer is performed
with chipselect off. This allows consummer to add a dummy transfer
at the end of the transfer list which is performed with chipselect
OFF, providing the required additional clock cycles.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/434165c46f06d802690208a11e7ea2500e8da4c7.1662558898.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h