[PATCH v8 0/3] rust: spi: add SPI driver abstractions

From: Shuai Liu

Date: Fri Nov 13 2026 - 20:05:28 EST


Add the Rust abstractions for the SPI driver subsystem, allowing SPI
drivers to be written in Rust.

Changes in v8:
- Rebase onto linux-next (next-20261113); the v7 patches no longer
applied, per Mark Brown's review.
- Send as a fresh thread rather than as a reply to the previous series,
per Mark Brown's review.

Changes in v7:
- Rework device I/O around a `transfer()` primitive that maps onto
spi_sync(), per Mark Brown's review.
- Drop the spi_write()/spi_read() helpers; add
spi_message_init()/spi_message_add_tail() helpers instead.

Shuai Liu (3):
rust: helpers: add SPI helpers
rust: spi: add SPI driver abstractions
samples: rust: add SPI driver sample

rust/bindings/bindings_helper.h | 1 +
rust/helpers/helpers.c | 1 +
rust/helpers/spi.c | 26 ++
rust/kernel/Kconfig.test | 11 +
rust/kernel/lib.rs | 2 +
rust/kernel/spi.rs | 673 ++++++++++++++++++++++++++++++++
samples/rust/Kconfig | 11 +
samples/rust/Makefile | 1 +
samples/rust/rust_driver_spi.rs | 66 ++++
9 files changed, 792 insertions(+)
create mode 100644 rust/helpers/spi.c
create mode 100644 rust/kernel/spi.rs
create mode 100644 samples/rust/rust_driver_spi.rs


Base-commit: 84abb955b1015f216d794566ed3c4fdd4bbd0f14
--
2.43.0