aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFélix Piédallu <[email protected]>2025-06-06 13:37:24 +0000
committerMark Brown <[email protected]>2025-06-08 22:29:51 +0000
commita5bf5272295d3f058adeee025d2a0b6625f8ba7b (patch)
tree2420b01307c02864cce9e3e6d95ec1f0080e2068
parentLinux 6.16-rc1 (diff)
downloadkernel-a5bf5272295d3f058adeee025d2a0b6625f8ba7b.tar.gz
kernel-a5bf5272295d3f058adeee025d2a0b6625f8ba7b.zip
spi: omap2-mcspi: Disable multi mode when CS should be kept asserted after message
When the last transfer of a SPI message has the cs_change flag, the CS is kept asserted after the message. Multi-mode can't respect this as CS is deasserted by the hardware at the end of the message. Disable multi-mode when not applicable to the current message. Fixes: d153ff4056cb ("spi: omap2-mcspi: Add support for MULTI-mode") Signed-off-by: Félix Piédallu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-omap2-mcspi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 29c616e2c408..e834fb42fd4b 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1287,9 +1287,15 @@ static int omap2_mcspi_prepare_message(struct spi_controller *ctlr,
mcspi->use_multi_mode = false;
}
- /* Check if transfer asks to change the CS status after the transfer */
- if (!tr->cs_change)
- mcspi->use_multi_mode = false;
+ if (list_is_last(&tr->transfer_list, &msg->transfers)) {
+ /* Check if transfer asks to keep the CS status after the whole message */
+ if (tr->cs_change)
+ mcspi->use_multi_mode = false;
+ } else {
+ /* Check if transfer asks to change the CS status after the transfer */
+ if (!tr->cs_change)
+ mcspi->use_multi_mode = false;
+ }
/*
* If at least one message is not compatible, switch back to single mode