From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796032600; b=318VYFaCoz0EiQ0CfvMegA+A7hH1P1BIl3Ofs1kaVqmDrO8Vth9n0OnZ0d2M3hqnltH2 mCfzPOSFl4+FLxBhQ4ygrA5VRziFtAUbb6iuM+9JYjrLwo0hPlY+T2nqBnPdwhYjxmTst FzkgptfwB/qLTpYo4g/+T+/YtehR+bY7cIWbkp8X8y1asL/WxceJR9Ei2FopgQM3Kgxas 16o8LVoDYSIiPRMuI5RcfC+dEn0kKN5XKZRJmb2raddiD5iBc6o4AqJ/RYFuEwm5ruLZE PQJQKSbq/8yl3H69FPAjNBuNDds9WY/+o+j97i/QYNcB3QFY9h4O9IkeYfJFhI2zW/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796032600; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:Date:To:cc: Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type; bh=FAGuZ0jEfIJlhK/pSPHjeggQfKgtdqInC7urfqwcDn8=; b=ArDV4NqS4oGJ/itdnuQ8GN8fQZQPfvvcy5CuP5SHEhtao1RnYOxCWqsNlgFjkdZicgxM CmTW64pke5odspvann2wLlrQUudTfR4549dAXBOxfHDdXQdleO+R0xENOyE53vtMbIuFS LrrgsnnHqU0W9jYveWE9JDQ+MdVyiLDae0NI9B4bipSo0fx8u6wO6ukprT2bjWEI0lbrN V/QEgSk8WTacGemTpLJGI9TMwCgQYjAhg5FRZ72nv0RowNO2bXSe0P4hExR6nhA7GXm+u AXlv/byCJmvdXfg0L0hSJh4BJeBzZ6OQQ//Py6lakE0znDb45rAsfz9jvxl1rpLRgfg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=kyaibpoi; arc=none smtp.remote-ip=192.198.163.14 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 059EC606A320; Mon, 30 Nov 2026 09:56:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 059EC606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=kyaibpoi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796032601; x=1827568601; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=FAGuZ0jEfIJlhK/pSPHjeggQfKgtdqInC7urfqwcDn8=; b=kyaibpoiwdvgZ0AnSkMajPcTv8YPLlDpZaoZNabGpbvWqkBxMTQvOhZY kzem4P9lv+EeLRfBB0J2UxABg9lutMf+5izjKHzxNiHhCGAkHW9AFkOqo N+bOszQTMkJCpLEToyZPOXOQmTknSOBBQl/eie4El1SroO/vm0gpQ/Ujm CNPeU1jiFrLw1zTqVP/DUo3Tt65BuQDgx4+3XYf/sIukTYrk4KjEGWWF9 hg6tyTd2TEqnm+BiXQ4iE8gl8myHqyr0994W3xBZaiZ7xNcECBJD80OS+ 3+t8rV5tO+Gx+C/Dg696111oGgU2LygFflHMIHvDvVIg+E3LcVTwAhh3n w==; X-CSE-ConnectionGUID: r3PVpUuUSwmRmG/bodQ3uQ== X-CSE-MsgGUID: oZWkq+NBQ9KzGXka6N8b3Q== X-IronPort-AV: E=McAfee;i="6800,10657,11981"; a="4819534" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4819534" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 01:56:39 -0800 X-CSE-ConnectionGUID: hwpniLVsRm6+fwDmsffP6A== X-CSE-MsgGUID: nlEyfsN/QgG/kmL81UNasg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="13201581" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.112]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 01:56:33 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Mon, 30 Nov 2026 11:56:30 +0200 (EET) To: Nick Dowsett cc: Hans de Goede , Miguel Ojeda , Boqun Feng , Gary Guo , =?ISO-8859-15?Q?Bj=F6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?ISO-8859-15?Q?Onur_=D6zkan?= , Armin Wolf , Werner Sembach , LKML , platform-driver-x86@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 1/4] platform/x86: clevo-laptop: add minimal WMI driver skeleton and Kbuild plumbing In-Reply-To: <20261122-clevo-laptop-v1-1-881debf4d4b0@gmail.com> Message-ID: <96a85228-50fc-1670-63f4-4234c7bf9177@linux.intel.com> References: <20261122-clevo-laptop-v1-0-881debf4d4b0@gmail.com> <20261122-clevo-laptop-v1-1-881debf4d4b0@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Sun, 22 Nov 2026, Nick Dowsett via B4 Relay wrote: > From: Nick Dowsett > > - 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 > --- > 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 > +L: platform-driver-x86@vger.kernel.org > +S: Maintained > +F: drivers/platform/x86/clevo-laptop.rs > + > CLK API > M: Russell King > L: linux-clk@vger.kernel.org > 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 . > +//! > +//! 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 "], > + 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, > +} > + > +impl kernel::InPlaceModule for ClevoLaptopModule { > + fn init(module: &'static ThisModule) -> impl PinInit { > + 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>, > + ) -> impl PinInit, Error> + 'bound { > + try_pin_init!(WmiDriver {}) > + } > +} > >