platform/x86: alienware-wmi: Refactor LED control methods
authorKurt Borja <kuurtb@gmail.com>
Fri, 7 Feb 2025 15:46:00 +0000 (10:46 -0500)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 10 Feb 2025 10:56:17 +0000 (12:56 +0200)
commit21cc9dee7d0b4d147fc4595f59444212b3aa5300
treee1b4c77a040a4f617adaead09d5c497d35e22e87
parent763c16fb149e12247a733e269e62a459b4b3c76d
platform/x86: alienware-wmi: Refactor LED control methods

Both WMI devices handled by this module specify a distinct interface for
LED control. Previously this module handled this by dynamically adapting
arguments passed to wmi_evaluate_method() based on the `interface`
global variable.

To avoid the use of global variables, and enable the migration to
non-deprecated WMI methods, let the WMI drivers define upd_led and
upd_brightness operations, which completely replace
alienware_update_led() and wmax_brightness().

Also define alienware_wmi_command(), which serves as a wrapper for
wmidev_evaluate_method(). This new method is very similar to
alienware_wmax_command() but is WMI device agnostic.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250207154610.13675-5-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/alienware-wmi.c