From: "Félix Piédallu via B4 Relay" <devnull+felix.piedallu.non.se.com@kernel.org>
To: Mark Brown <broonie@kernel.org>,
Louis Chauvet <louis.chauvet@bootlin.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
"Félix Piédallu" <felix.piedallu@non.se.com>,
pascal.eberhard@se.com
Subject: [PATCH 0/2] SPI: omap2-mcspi: Fix SPI CS behaviour around cs_change in SPI transfers
Date: Fri, 06 Jun 2025 15:37:23 +0200 [thread overview]
Message-ID: <20250606-cs_change_fix-v1-0-27191a98a2e5@non.se.com> (raw)
These patches fix the behaviour of the SPI Chip Select of the OMAP2 MCSPI
driver used on TI SoCs.
The omap2-mcspi driver supports the use of multi mode (multichannel in TI
documentation). In this mode, the CS is asserted and deasserted by the
hardware.
The multi mode is disabled for messages when cs_change=0 for all transfers
(e.g when CS is kept asserted between transfers of a same message).
The multi mode also needs to be disabled for messages when cs_change=1 on the
last transfer (e.g when CS is kept asserted after the WHOLE message), and the
message right after.
Currently, that is not the case and it CS is deasserted by hardware when it
shouldn't.
This breaks peripheral drivers that send multiple messages with the CS asserted
in between.
Patch 1 ensures that multi mode is disabled when cs_change=1 on the last
transfer of the message.
Patch 2 ensures that multi mode is disable on a message following one with
cs_change=1 on the last transfer.
This is the case for the TPM TIS SPI driver that uses this logic for flow
control purposes.
Tested on an AM6442 platform with a TPM ST33HTPH2X32AHE4.
Signed-off-by: Félix Piédallu <felix.piedallu@non.se.com>
---
Félix Piédallu (2):
spi: omap2-mcspi: Disable multi mode when CS should be kept asserted after message
spi: omap2-mcspi: Disable multi-mode when the previous message kept CS asserted
drivers/spi/spi-omap2-mcspi.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
---
base-commit: c46b66be7eb595e66e93eda13149e0d4f90924ea
change-id: 20250606-cs_change_fix-bb51ac0f2bcb
Best regards,
--
Félix Piédallu <felix.piedallu@non.se.com>
next reply other threads:[~2025-06-06 13:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 13:37 Félix Piédallu via B4 Relay [this message]
2025-06-06 13:37 ` [PATCH 1/2] spi: omap2-mcspi: Disable multi mode when CS should be kept asserted after message Félix Piédallu via B4 Relay
2025-06-06 13:37 ` [PATCH 2/2] spi: omap2-mcspi: Disable multi-mode when the previous message kept CS asserted Félix Piédallu via B4 Relay
2025-06-09 19:33 ` [PATCH 0/2] SPI: omap2-mcspi: Fix SPI CS behaviour around cs_change in SPI transfers Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250606-cs_change_fix-v1-0-27191a98a2e5@non.se.com \
--to=devnull+felix.piedallu.non.se.com@kernel.org \
--cc=broonie@kernel.org \
--cc=felix.piedallu@non.se.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=pascal.eberhard@se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).