]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: aspeed: Add support for non-spi-mem devices
authorChin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Tue, 20 Jan 2026 12:30:05 +0000 (20:30 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 27 Jan 2026 12:46:23 +0000 (12:46 +0000)
commit04f7516ab70f7b82aae1d2830af2ee6f17f3fe98
tree9ca1861e7f316ef719d8c434072bc2a47c392d43
parent53f826ff5e0e3ecb279862ca7cce1491b94bb017
spi: aspeed: Add support for non-spi-mem devices

The ASPEED FMC/SPI controller may be shared by spi-mem devices and
other SPI peripherals that do not use the spi-mem framework.

The driver currently assumes spi-mem semantics for all devices,
while the controller also supports direct user mode access commonly
used by non-spi-mem devices. This mismatch can result in incorrect
behavior when different types of devices share the same controller.

Therefore, a user mode based path for non-spi-mem devices is added
by implementing the transfer_one() callback and wiring up
prepare_message() and unprepare_message() so controller state is
initialized and restored for user mode transfers. This allows
non-spi-mem devices to operate correctly alongside spi-mem devices
on a shared controller.

This patch has been tested on:
- AST2700 EVB + Infineon and ST SPI TPM device.
- AST2x00 EVB + spidev_test utility and the output waveforms are
  verified with logic analyzer.
- AST2x00 EVB + SPI NOR flash read/write regression.

Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Link: https://patch.msgid.link/20260120123005.1392071-3-chin-ting_kuo@aspeedtech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-aspeed-smc.c