[PATCH v2 0/4] rust: wmi: add ACPI WMI bus abstractions
From: Nick Dowsett via B4 Relay
Date: Fri Nov 27 2026 - 06:03:30 EST
Hi there; new to the LKML here, long time Rustacean and Linux user.
I have implemented this series to add an MVP of Rust abstractions for the
WMI subsystem (`include/linux/wmi.h`) with the bare-minimum
implemented to support an in-tree user, a Clevo laptop keyboard
backlight driver [1].
Note the driver has two other dependencies: Markus Probst's LED
classdev abstractions and basic DMI matching abstractions.
[1] https://lore.kernel.org/all/20261122-clevo-laptop-v1-0-881debf4d4b0@xxxxxxxxx/
This was not directly influenced by Ilya Gladyshev's previous attempt as
I was not aware of it, the key difference here is that I have used the
newer buffer-based interface (no `acpi_object`), and implemented less of
the callbacks initially.
What's covered is driver probe, registration and unregistration, device
id table, and a safe implementation of `wmidev_invoke_method` that
returns an owned RAII buffer.
---
Changes in v2:
- Add inline annotations (Sashiko)
- Add / standardise `// INVARIANT:` documentation (Sashiko).
- Additional comments documenting device construction state, expand
abbreviation in module documentation, and fix typos.
- Rebased onto v7.4-rc4.
- Link to v1: https://patch.msgid.link/20261122-rust-wmi-v1-0-63111d9e824c@xxxxxxxxx
---
Nick Dowsett (4):
rust: wmi: add basic WMI device abstraction
rust: wmi: add DeviceId and wmi_device_table! macro
rust: wmi: add Driver trait, Adapter and implement RegistrationOps
rust: wmi: add Buffer and Device::invoke_method()
MAINTAINERS | 1 +
rust/bindings/bindings_helper.h | 1 +
rust/kernel/lib.rs | 2 +
rust/kernel/wmi.rs | 375 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 379 insertions(+)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261119-rust-wmi-c6b0e0fe97a7
Best regards,
--
Nick Dowsett <nick42d@xxxxxxxxx>