Re: [RFC PATCH 0/3] platform: lenovo: architecture independent home for the Lenovo WMI drivers
From: Hans de Goede
Date: Sun Nov 15 2026 - 15:10:42 EST
On 15-Nov-26 16:33, Hans de Goede wrote:
<snip>
>> b. Should the Fn key event handling stay a separate small driver, or
>> be factored out of ideapad-laptop so x86 and arm64 share one path?
>> ideapad-laptop handles the event only when its VPC platform driver
>> is bound, and the arm64 machines expose none of the VPC interface
>> it is built on (no _CFG, VPCR/VPCW, DYTC or HALS/SALS), so making
>> it the single driver means gating most of its probe. Two smaller
>> options: lift ideapad-laptop's own Fn key wmi_driver and keymap
>> into this file and let ideapad-laptop register for the events it
>> still wants (Fn lock LED, DYTC cycle), or the hid-asus/asus-wmi
>> shape where a companion WMI module exports the event to a
>> subsystem driver. The keymap in patch 2 duplicates entries of
>> ideapad-laptop's table on purpose until that is decided.
>
> IIRC the ideapad-laptop driver is a bit of a mess atm, so factoring
> a common handling for the the Fn key events out of this and sharing
> that sounds like a nice cleanup.
>
> I see that patch 2/3 uses the new wmi-driver/-bus infra which is
> nice and clean.
>
> So maybe just keep your existing stand-alone driver for both x86_64 +
> arm64 and drop the WMI event handling from ideapad-laptop.
>
> I guess this may hit some problems where WMI event handlig is used
> in ideapad-laptops integrating with some VPC functionality.
>
> For that purpose I think that the new
> drivers/platform/lenovo/wmi-hotkeys.c could maybe expose some
> notifier and call that for events it does not handle itself
> and then ideapad-laptop can depend on some function to register
> a listener on that notifier (1) and register a notifier handler
> staying out of WMI handling itself.
>
> No idea if this is feasible / how clean the end result will be,
> just brainstorming and saying yes to doing some refactoring of
> the somewhat messy ideapad-laptop code.
>
> Note that https://github.com/systemd/systemd/blob/main/hwdb.d/60-keyboard.hwdb
> has some mappings for "Ideapad extra buttons" input devices
> (+ DMI match), so if any of the buttons remapped there end up
> under the new WMI driver then that should probably give its
> input device the same name, to make sure those mappings still
> apply.
Also see this just posted ideapad-laptop series which does
something similar for handling YMC events:
https://lore.kernel.org/platform-driver-x86/20261116-ymc-82yl-v1-0-fac1a2b01a84@xxxxxxxx/
Regards,
Hans
> 1) +Kconfig dep, which will also avoid regressions by wrong
> Kconfig