Re: [PATCH 1/4] platform/x86: clevo-laptop: add minimal WMI driver skeleton and Kbuild plumbing

From: Ilpo Järvinen

Date: Mon Nov 30 2026 - 04:56:46 EST


On Sun, 22 Nov 2026, Nick Dowsett via B4 Relay wrote:

> From: Nick Dowsett <nick42d@xxxxxxxxx>
>
> - Add `drivers/platform/x86/clevo-laptop.rs` with module implementation,
> DMI board check, and Driver registration.

Mostly, don't use bullet lists to describe kernel changes. Only if there's
a small part of the change that clearly is a list bullets may be
warranted. LLMs in particular tend to overuse bullet lists for things
that clearly aren't lists so don't fall into that trap.

And definitely do not to describe algoritms using bullets like you do
in the subsequent patches.

> - Add Kconfig and MAINTAINERS entries and Makefile wiring.

You're expected to add Kconfig and MAINTAINERS so mentioning those seems
useless detail for experienced kernel developers. We can see that you do
from the diff so stating the same adds zero value.

--
i.

> Signed-off-by: Nick Dowsett <nick42d@xxxxxxxxx>
> ---
> MAINTAINERS | 6 +++
> drivers/platform/x86/Kconfig | 17 +++++++++
> drivers/platform/x86/Makefile | 3 ++
> drivers/platform/x86/clevo-laptop.rs | 72 ++++++++++++++++++++++++++++++++++++
> 4 files changed, 98 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 44540a1eb2b8..1130c293e84d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -6566,6 +6566,12 @@ F: scripts/Makefile.clang
> F: scripts/clang-tools/
> K: \b(?i:clang|llvm)\b
>
> +CLEVO LAPTOP DRIVER
> +M: Nick Dowsett <nick42d@xxxxxxxxx>
> +L: platform-driver-x86@xxxxxxxxxxxxxxx
> +S: Maintained
> +F: drivers/platform/x86/clevo-laptop.rs
> +
> CLK API
> M: Russell King <linux@xxxxxxxxxxxxxxx>
> L: linux-clk@xxxxxxxxxxxxxxx
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 9ce384e0475e..18aa4550c9f4 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1059,6 +1059,23 @@ config OXP_EC
>
> source "drivers/platform/x86/tuxedo/Kconfig"
>
> +config CLEVO_LAPTOP
> + tristate "Clevo Laptop Platform Driver"
> + depends on RUST
> + depends on ACPI_WMI=y
> + depends on DMI
> + depends on LEDS_CLASS
> + help
> + This driver provides platform support for Clevo barebones and
> + rebranded laptops (Tuxedo, Metabox, Sager, XMG, etc.).
> + Currently only Clevo NLx0AU boards (e.g. Metabox Edge NL57AU)
> + with a 5-step white keyboard backlight are supported over WMI.
> + It is intended to be extended with additional Clevo models and
> + EC features over time.
> +
> + To compile this driver as a module, choose M here: the module
> + will be called clevo-laptop.
> +
> endif # X86_PLATFORM_DEVICES
>
> config P2SB
> diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
> index 229057234d00..070af05a2064 100644
> --- a/drivers/platform/x86/Makefile
> +++ b/drivers/platform/x86/Makefile
> @@ -158,6 +158,9 @@ obj-$(CONFIG_SILICOM_PLATFORM) += silicom-platform.o
> # TUXEDO
> obj-y += tuxedo/
>
> +# Clevo
> +obj-$(CONFIG_CLEVO_LAPTOP) += clevo-laptop.o
> +
> # Winmate
> obj-$(CONFIG_WINMATE_FM07_KEYS) += winmate-fm07-keys.o
>
> diff --git a/drivers/platform/x86/clevo-laptop.rs b/drivers/platform/x86/clevo-laptop.rs
> new file mode 100644
> index 000000000000..1d862c57b3fe
> --- /dev/null
> +++ b/drivers/platform/x86/clevo-laptop.rs
> @@ -0,0 +1,72 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +//! Clevo Laptop Driver.
> +//!
> +//! Currently supports only the 5-step white keyboard backlight on Clevo
> +//! NLx0AU boards (e.g., Metabox Edge NL57AU).
> +//!
> +//! Copyright (C) 2026 Nick Dowsett <nick42d@xxxxxxxxx>.
> +//!
> +//! Inspired by Tuxedo Computers' drivers.
> +
> +use kernel::{
> + device,
> + dmi,
> + prelude::*,
> + wmi, //
> +};
> +
> +/// # Note
> +///
> +/// This GUID is non-unique (shared by Uniwill for example) and cannot be trusted
> +/// to uniquely identify a Clevo device.
> +const CLEVO_WMI_METHOD_GUID: &CStr = c"ABBC0F6D-8EA1-11D1-00A0-C90629100000";
> +/// DMI board name allowlist, restricted to tested boards since the WMI GUID is not
> +/// unique.
> +const SUPPORTED_BOARDS: &[&CStr] = &[c"NLx0AU"];
> +
> +module! {
> + type: ClevoLaptopModule,
> + name: "clevo-laptop",
> + authors: ["Nick Dowsett <nick42d@xxxxxxxxx>"],
> + description: "Clevo Laptop Driver (Keyboard Backlight)",
> + license: "GPL",
> +}
> +
> +/// RAII guard for Clevo Laptop Module holding all subsystem drivers e.g WMI.
> +#[pin_data]
> +struct ClevoLaptopModule {
> + #[pin]
> + _wmi_driver: wmi::Registration<WmiDriver>,
> +}
> +
> +impl kernel::InPlaceModule for ClevoLaptopModule {
> + fn init(module: &'static ThisModule) -> impl PinInit<Self, Error> {
> + pin_init::pin_init_scope(move || {
> + if dmi::get_system_info(dmi::Field::BoardName)
> + .is_none_or(|board| !SUPPORTED_BOARDS.contains(&board))
> + {
> + return Err(ENODEV);
> + }
> + Ok(try_pin_init!(Self {
> + _wmi_driver <- wmi::Registration::new(c"clevo-laptop", module),
> + }))
> + })
> + }
> +}
> +
> +/// RAII guard for Clevo WMI driver holding all subsystem devices e.g LED device.
> +#[pin_data]
> +struct WmiDriver {}
> +
> +kernel::wmi_device_table!(WMI_TABLE, [wmi::DeviceId::new(CLEVO_WMI_METHOD_GUID)]);
> +
> +impl wmi::Driver for WmiDriver {
> + type Data<'bound> = WmiDriver;
> + const ID_TABLE: wmi::IdTable = &WMI_TABLE;
> + fn probe<'bound>(
> + _dev: &'bound wmi::Device<device::Core<'_>>,
> + ) -> impl PinInit<Self::Data<'bound>, Error> + 'bound {
> + try_pin_init!(WmiDriver {})
> + }
> +}
>
>