platform/x86: asus-armoury: move existing tunings to asus-armoury module

The fw_attributes_class provides a much cleaner interface to all of the
attributes introduced to asus-wmi. This patch moves all of these extra
attributes over to fw_attributes_class, and shifts the bulk of these
definitions to a new kernel module to reduce the clutter of asus-wmi
with the intention of deprecating the asus-wmi attributes in future.

The work applies only to WMI methods which don't have a clearly defined
place within the sysfs and as a result ended up lumped together in
/sys/devices/platform/asus-nb-wmi/ with no standard API.

Where possible the fw attrs now implement defaults, min, max, scalar,
choices, etc. As en example dgpu_disable becomes:

/sys/class/firmware-attributes/asus-armoury/attributes/dgpu_disable/
├── current_value
├── display_name
├── possible_values
└── type

as do other attributes.

Co-developed-by: Denis Benato <denis.benato@linux.dev>
Signed-off-by: Denis Benato <denis.benato@linux.dev>
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://patch.msgid.link/20251102215319.3126879-3-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Luke D. Jones
2025-11-02 22:53:12 +01:00
committed by Ilpo Järvinen
parent 22ea7b9d96
commit f99eb09809
8 changed files with 1034 additions and 47 deletions

View File

@@ -0,0 +1,50 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H
#define __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H
#include <linux/dmi.h>
#include <linux/types.h>
/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
#if IS_REACHABLE(CONFIG_ASUS_WMI) || IS_REACHABLE(CONFIG_HID_ASUS)
static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Zephyrus"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Strix"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GU605M"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
},
},
{ },
};
#endif
#endif /* __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H */

View File

@@ -4,7 +4,9 @@
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/dmi.h>
#define ASUS_WMI_MGMT_GUID "97845ED0-4E6D-11DE-8A39-0800200C9A66"
#define ASUS_ACPI_UID_ASUSWMI "ASUSWMI"
/* WMI Methods */
#define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */
@@ -191,44 +193,4 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
}
#endif
/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Zephyrus"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Strix"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
},
},
{
.matches = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GU605M"),
},
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
},
},
{ },
};
#endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */