mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Dowsett via B4 Relay <devnull+nick42d.gmail.com@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>, "Armin Wolf" <W_Armin@gmx.de>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	 platform-driver-x86@vger.kernel.org,
	Nick Dowsett <nick42d@gmail.com>
Subject: [PATCH v2 0/4] rust: wmi: add ACPI WMI bus abstractions
Date: Fri, 27 Nov 2026 19:02:48 +0800	[thread overview]
Message-ID: <20261127-rust-wmi-v2-0-5bfafabd6a6e@gmail.com> (raw)

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@gmail.com/

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@gmail.com

---
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@gmail.com>



             reply	other threads:[~2026-11-27 11:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 11:02 Nick Dowsett via B4 Relay [this message]
2026-11-27 11:02 ` [PATCH v2 1/4] rust: wmi: add basic WMI device abstraction Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 2/4] rust: wmi: add DeviceId and wmi_device_table! macro Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 3/4] rust: wmi: add Driver trait, Adapter and implement RegistrationOps Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 4/4] rust: wmi: add Buffer and Device::invoke_method() Nick Dowsett via B4 Relay

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=20261127-rust-wmi-v2-0-5bfafabd6a6e@gmail.com \
    --to=devnull+nick42d.gmail.com@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nick42d@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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

all inboxes | Powered by JetHome®