mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Cemin <dcemin@nvidia.com>
To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, W_Armin@gmx.de
Cc: mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com,
	xy-jackie@139.com, ikepanhc@gmail.com, i@rong.moe,
	marco_giunta@outlook.it, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, ldemarchi@nvidia.com
Subject: [PATCH v2 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers
Date: Wed, 18 Nov 2026 18:27:16 -0800	[thread overview]
Message-ID: <20261119022719.3089229-1-dcemin@nvidia.com> (raw)
In-Reply-To: <20261113222755.1696567-1-dcemin@nvidia.com>

Lenovo now ships ACPI based arm64 laptops whose firmware exposes the
same ACPI-WMI interfaces as the x86 IdeaPad and Legion machines: the Fn
key event GUID consumed by ideapad-laptop, the hotkey utility GUID used
for the microphone mute LED, and the GameZone, Other Mode and capability
data GUIDs behind the thermal operation modes. Since 884d53763d30
("platform/wmi: Remove dependency on CONFIG_X86") the ACPI-WMI core
builds on arm64, but the Lenovo WMI drivers still live under
drivers/platform/x86, which is gated by X86_PLATFORM_DEVICES.

This series:
  1. moves the architecture independent Lenovo WMI drivers into a new
     drivers/platform/lenovo directory, following drivers/platform/surface;
     ideapad-laptop, thinkpad_acpi, think-lmi and the Yoga tablet drivers
     stay under x86 because they need i8042, port I/O or x86 only devices;
  2. adds a WMI hotkeys driver that owns the Fn key and Fn+Esc event
     GUIDs on every architecture, reports the keys through a sparse
     keymap and offers a notifier chain to drivers with platform
     knowledge;
  3. makes ideapad-laptop drop its WMI event driver and subscribe to
     that notifier instead, keeping its Fn lock LED and DYTC performance
     mode handling.

The series applies on top of Rong Zhang's "platform/x86: ideapad-laptop:
Trigger the EC on YMC events" (20261116-ymc-82yl-v1-0-fac1a2b01a84@rong.moe)
because both touch the ideapad-laptop WMI code and that series
modernizes the lenovo-wmi-events helper.

Patch 2 was tested on a Lenovo Yoga 9 2-in-1 16 (arm64): microphone
mute, airplane mode, the Smart Key, the Smart Connect key and the Fn+Q
performance key report input events. The Fn+Esc GUIDs are not exposed
by that firmware. Patch 3 is compile tested on x86_64 only, I do not
have an x86 IdeaPad; a test on a Yoga 3 or Yoga 700 (Fn+Esc) and on a
machine where ideapad-laptop handles the Fn lock LED or DYTC would be
appreciated.

Changes in v2:
  - dropped the WMI core Kconfig patch, 884d53763d30 covers it (Armin)
  - wmi-hotkeys: notify_new with the wmi_buffer, devm_kzalloc_obj, drvdata
    set before input registration, KEY_PERFORMANCE for 0x3d (Armin)
  - wmi-hotkeys: notifier chain called before the keymap lookup,
    NOTIFY_STOP suppresses the key (Hans, Armin); input device named like
    the ideapad-laptop one so the hwdb mappings keep applying (Hans)
  - wmi-hotkeys: camera lens cover switch events moved here with the
    rest of the Fn key GUID handling
  - the VPC guard patch is replaced by ideapad-laptop subscribing to the
    notifier and dropping its own Fn key WMI driver and keymap entries
  - wmi-hotkeys: the Fn+Esc event GUIDs move here as well, so that
    ideapad-laptop registers no WMI event driver at all (Armin); they
    carry no data and are reported under code 128 as before
  - commit message: 0x48 (Smart Connect) was already KEY_LINK_PHONE in
    ideapad-laptop since ccc8c8481c1f, the keymap follows it (Marco Giunta)
  - collected Mark's and Jackie's Reviewed-by on patch 1

David Cemin (3):
  platform: lenovo: move the architecture independent WMI drivers out of
    x86
  platform: lenovo: add WMI hotkeys driver
  platform/x86: ideapad-laptop: consume the Fn key events from the WMI
    hotkeys driver

 MAINTAINERS                                   |  10 +-
 drivers/platform/Kconfig                      |   2 +
 drivers/platform/Makefile                     |   1 +
 drivers/platform/lenovo/Kconfig               | 101 ++++++++
 drivers/platform/lenovo/Makefile              |  23 ++
 .../platform/{x86 => }/lenovo/wmi-camera.c    |   0
 .../platform/{x86 => }/lenovo/wmi-capdata.c   |   0
 .../platform/{x86 => }/lenovo/wmi-capdata.h   |   0
 .../platform/{x86 => }/lenovo/wmi-events.c    |   0
 .../platform/{x86 => }/lenovo/wmi-events.h    |   0
 .../platform/{x86 => }/lenovo/wmi-gamezone.c  |   0
 .../platform/{x86 => }/lenovo/wmi-helpers.c   |   0
 .../platform/{x86 => }/lenovo/wmi-helpers.h   |   0
 .../{x86 => }/lenovo/wmi-hotkey-utilities.c   |   0
 drivers/platform/lenovo/wmi-hotkeys.c         | 244 ++++++++++++++++++
 drivers/platform/{x86 => }/lenovo/wmi-other.c |   0
 drivers/platform/x86/lenovo/Kconfig           |  68 +----
 drivers/platform/x86/lenovo/Makefile          |   7 -
 drivers/platform/x86/lenovo/ideapad-laptop.c  | 225 +++-------------
 .../platform_data/x86/lenovo-wmi-hotkeys.h    |  28 ++
 20 files changed, 447 insertions(+), 262 deletions(-)
 create mode 100644 drivers/platform/lenovo/Kconfig
 create mode 100644 drivers/platform/lenovo/Makefile
 rename drivers/platform/{x86 => }/lenovo/wmi-camera.c (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-capdata.c (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-capdata.h (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-events.c (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-events.h (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-gamezone.c (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-helpers.c (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-helpers.h (100%)
 rename drivers/platform/{x86 => }/lenovo/wmi-hotkey-utilities.c (100%)
 create mode 100644 drivers/platform/lenovo/wmi-hotkeys.c
 rename drivers/platform/{x86 => }/lenovo/wmi-other.c (100%)
 create mode 100644 include/linux/platform_data/x86/lenovo-wmi-hotkeys.h

-- 
2.56.1


  parent reply	other threads:[~2026-11-19  2:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 22:27 [RFC PATCH " David Cemin
2026-11-13 22:27 ` [RFC PATCH 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-11-15 21:50   ` Mark Pearson
2026-11-16  4:42     ` David Cemin
2026-11-16 16:59       ` Mark Pearson
2026-11-17  2:27     ` Jackie Dong
2026-11-13 22:27 ` [RFC PATCH 2/3] platform: lenovo: add WMI hotkeys driver David Cemin
2026-11-15 16:12   ` Armin Wolf
2026-11-16  4:42     ` David Cemin
2026-11-17  1:39       ` Armin Wolf
2026-11-16 10:55   ` Marco Giunta
2026-11-17  3:27   ` Jackie Dong
2026-11-19  2:29   ` David Cemin
2026-11-13 22:27 ` [RFC PATCH 3/3] platform/x86: ideapad-laptop: do not bind the WMI event devices without the VPC David Cemin
2026-11-15 15:33 ` [RFC PATCH 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers Hans de Goede
2026-11-15 16:02   ` Armin Wolf
2026-11-15 18:02     ` Hans de Goede
2026-11-15 20:10   ` Hans de Goede
2026-11-15 20:12     ` Hans de Goede
2026-11-15 21:48       ` Mark Pearson
2026-11-16  4:42       ` David Cemin
2026-11-19  2:27 ` David Cemin [this message]
2026-11-19  2:27   ` [PATCH v2 1/3] platform: lenovo: move the architecture independent WMI drivers out of x86 David Cemin
2026-11-19  2:27   ` [PATCH v2 2/3] platform: lenovo: add WMI hotkeys driver David Cemin
2026-11-19  2:27   ` [PATCH v2 3/3] platform/x86: ideapad-laptop: consume the Fn key events from the " David Cemin

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=20261119022719.3089229-1-dcemin@nvidia.com \
    --to=dcemin@nvidia.com \
    --cc=W_Armin@gmx.de \
    --cc=derekjohn.clark@gmail.com \
    --cc=hansg@kernel.org \
    --cc=i@rong.moe \
    --cc=ikepanhc@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=ldemarchi@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco_giunta@outlook.it \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=xy-jackie@139.com \
    /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®