History

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.

Luke D. Jones committed 1 year ago

Commit f99eb091 parent 22ea7b98 files · +1034 −47Browse files

Showing the changes to include/linux/platform_data (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/platform_data/x86/asus-wmi-leds-ids.h +50 −0
  2. include/linux/platform_data/x86/asus-wmi.h +3 −41
include/linux/platform_data/x86/asus-wmi-leds-ids.h+50−0
@@ -0,0 +1,50 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H
3+#define __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H
4+
5+#include <linux/dmi.h>
6+#include <linux/types.h>
7+
8+/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
9+#if IS_REACHABLE(CONFIG_ASUS_WMI) || IS_REACHABLE(CONFIG_HID_ASUS)
10+static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
11+ {
12+ .matches = {
13+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Zephyrus"),
14+ },
15+ },
16+ {
17+ .matches = {
18+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Strix"),
19+ },
20+ },
21+ {
22+ .matches = {
23+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
24+ },
25+ },
26+ {
27+ .matches = {
28+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
29+ },
30+ },
31+ {
32+ .matches = {
33+ DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
34+ },
35+ },
36+ {
37+ .matches = {
38+ DMI_MATCH(DMI_BOARD_NAME, "GU605M"),
39+ },
40+ },
41+ {
42+ .matches = {
43+ DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
44+ },
45+ },
46+ { },
47+};
48+#endif
49+
50+#endif /* __PLATFORM_DATA_X86_ASUS_WMI_LEDS_IDS_H */
include/linux/platform_data/x86/asus-wmi.h+3−41
@@ -4,7 +4,9 @@ · 3 unmodified lines
44
55 #include <linux/errno.h>
66 #include <linux/types.h>
7−#include <linux/dmi.h>
7+
8+#define ASUS_WMI_MGMT_GUID "97845ED0-4E6D-11DE-8A39-0800200C9A66"
9+#define ASUS_ACPI_UID_ASUSWMI "ASUSWMI"
810
911 /* WMI Methods */
1012 #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, · 180 unmodified lines
191193 }
192194 #endif
193195
194−/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
195−static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
196− {
197− .matches = {
198− DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Zephyrus"),
199− },
200− },
201− {
202− .matches = {
203− DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Strix"),
204− },
205− },
206− {
207− .matches = {
208− DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
209− },
210− },
211− {
212− .matches = {
213− DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
214− },
215− },
216− {
217− .matches = {
218− DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
219− },
220− },
221− {
222− .matches = {
223− DMI_MATCH(DMI_BOARD_NAME, "GU605M"),
224− },
225− },
226− {
227− .matches = {
228− DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
229− },
230− },
231− { },
232−};
233−
234196 #endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */