public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] spi: sun6i: Fix chip select handling around autosuspend
@ 2026-04-23 17:39 Kevin Mehall
  2026-04-23 17:40 ` [PATCH v2 1/2] spi: sun6i: Honor CS setup delay on the first transfer with native CS Kevin Mehall
  2026-04-23 17:40 ` [PATCH v2 2/2] spi: sun6i: Set SPI mode in prepare_message Kevin Mehall
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Mehall @ 2026-04-23 17:39 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Mirko Vogt, Ralf Schlatterbeck, linux-spi, linux-arm-kernel,
	linux-sunxi, linux-kernel

Move the initialization of the SUN6I_TFR_CTL_REG bits out of
sun6i_spi_transfer_one() into earlier callbacks to fix two bugs:

 - With a native chip select, the setup_delay is not correctly applied to
   the first transfer after autosuspend.
 - With a GPIO chip select, the CS is asserted before SCK is driven to the
   correct initial level per the SPI mode. When the mode is set, it can
   cause an extra SCK transition with CS low and corrupt the transfer.
 
Changes since the previous single patch:
 - Move the line that sets `SUN6I_TFR_CTL_CS_MANUAL` into
  `sun6i_spi_set_cs()` rather than into `sun6i_spi_prepare_message()`.
  This change is now a separate commit.

Kevin Mehall (2):
  spi: sun6i: Honor CS setup delay on the first transfer with native CS
  spi: sun6i: Set SPI mode in prepare_message

 drivers/spi/spi-sun6i.c | 74 +++++++++++++++++++++++++----------------
 1 file changed, 45 insertions(+), 29 deletions(-)


base-commit: 028ef9c96e96197026887c0f092424679298aae8
-- 
2.53.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-23 18:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 17:39 [PATCH v2 0/2] spi: sun6i: Fix chip select handling around autosuspend Kevin Mehall
2026-04-23 17:40 ` [PATCH v2 1/2] spi: sun6i: Honor CS setup delay on the first transfer with native CS Kevin Mehall
2026-04-23 18:40   ` Kevin Mehall
2026-04-23 18:50     ` Mark Brown
2026-04-23 17:40 ` [PATCH v2 2/2] spi: sun6i: Set SPI mode in prepare_message Kevin Mehall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox