]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: spi-mem: Add a no_cs_assertion capability
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 26 Mar 2026 16:47:15 +0000 (17:47 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 4 May 2026 13:07:37 +0000 (15:07 +0200)
commit38fbe4b3f66e5b8e2f2ab8e7ca3d912e1e935fe2
tree42451a373ed7cec7c323cdb2c303aa15c0ad4ae5
parent6f96f2fa152518d93ffeedbea781db50aef7f7dc
spi: spi-mem: Add a no_cs_assertion capability

Some controllers are 'smart', and that's a problem.

For instance, the Cadence quadspi controller is capable of deasserting
the CS automatically whenever a too long period of time without any data
to transfer elapses.

This 'feature' combined with a loaded interconnect with arbitration, a
"long" transfer may be split into smaller DMA transfers. In this case
the controller may allow itself to deassert the CS between chunks.

Deasserting the CS stops any ongoing continuous read. Reasserting it
later to continue the reading will only result in the host getting
garbage.

In this case, the host controller driver has no control over the CS
state, so we cannot reliably enable continuous reads. Flag this
limitation through a spi-mem controller capability.

The inversion in the flag name (starting with 'no_') is voluntary, in
order to avoid the need to set this flag in all controller drivers. Only
the broken controllers shall set this bit, the default being that the
controller masters its CS fully.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
include/linux/spi/spi-mem.h