Update patches/asus2.patch

This commit is contained in:
ferreo 2025-01-20 16:46:51 +01:00
parent d3c6237444
commit 8473c734e4

View File

@ -1,36 +1,7 @@
From 318ba1ff9a044051536a4e4938b8e38a6ffe9bac Mon Sep 17 00:00:00 2001 From 701954edb42b4dcf79f52a74cfcda69ff54a5c20 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 7 Jun 2024 15:58:01 +1200
Subject: [PATCH 01/28] Input: xpad - add support for ASUS ROG RAIKIRI PRO
Add the VID/PID for ASUS ROG RAIKIRI PRO to
xpad_device and the VID to xpad_table.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-ids.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 0f23be98c56e..1b92729bd378 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -210,6 +210,7 @@
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30
#define USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR 0x18c6
+#define USB_DEVICE_ID_ASUSTEK_ROG_RAIKIRI_PAD 0x1abb
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY 0x1abe
#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY_X 0x1b4c
#define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b
--
2.47.1
From 75ffd91fb4a2da8683a438f0ea23a2fe20dd97ca Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 24 May 2024 10:54:36 +1200 Date: Fri, 24 May 2024 10:54:36 +1200
Subject: [PATCH 02/28] platform/x86: asus-wmi: don't fail if platform_profile Subject: [PATCH 02/29] platform/x86: asus-wmi: don't fail if platform_profile
already registered already registered
On some newer laptops it appears that an AMD driver can register a On some newer laptops it appears that an AMD driver can register a
@ -48,10 +19,10 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 1101e5b2488e..293ecd228a5a 100644 index 8bd187e8b47f..2a13466efaa9 100644
--- a/drivers/platform/x86/asus-wmi.c --- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c
@@ -4769,7 +4769,7 @@ static int asus_wmi_add(struct platform_device *pdev) @@ -4747,7 +4747,7 @@ static int asus_wmi_add(struct platform_device *pdev)
goto fail_fan_boost_mode; goto fail_fan_boost_mode;
err = platform_profile_setup(asus); err = platform_profile_setup(asus);
@ -64,10 +35,10 @@ index 1101e5b2488e..293ecd228a5a 100644
2.47.1 2.47.1
From f1d69dd5412a06634a19db8daa0329d9ff585452 Mon Sep 17 00:00:00 2001 From d33e3b4f8bd485888236355f7d0975d91a9110d0 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 1 Sep 2024 14:30:37 +1200 Date: Sun, 1 Sep 2024 14:30:37 +1200
Subject: [PATCH 03/28] platform/x86: asus-wmi: Refactor Ally suspend/resume Subject: [PATCH 03/29] platform/x86: asus-wmi: Refactor Ally suspend/resume
The CSEE method from ACPI is now called only on module load. This fixes The CSEE method from ACPI is now called only on module load. This fixes
an issues with USB device loss on Ally 1 after reboot. an issues with USB device loss on Ally 1 after reboot.
@ -89,7 +60,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
1 file changed, 48 insertions(+), 38 deletions(-) 1 file changed, 48 insertions(+), 38 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 293ecd228a5a..acd0ec1d9aae 100644 index 2a13466efaa9..eed807dfcb6c 100644
--- a/drivers/platform/x86/asus-wmi.c --- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c
@@ -142,16 +142,20 @@ module_param(fnlock_default, bool, 0444); @@ -142,16 +142,20 @@ module_param(fnlock_default, bool, 0444);
@ -136,7 +107,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
/* WMI ************************************************************************/ /* WMI ************************************************************************/
static int asus_wmi_evaluate_method3(u32 method_id, static int asus_wmi_evaluate_method3(u32 method_id,
@@ -4729,6 +4732,17 @@ static int asus_wmi_add(struct platform_device *pdev) @@ -4707,6 +4710,17 @@ static int asus_wmi_add(struct platform_device *pdev)
if (err) if (err)
goto fail_platform; goto fail_platform;
@ -154,7 +125,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
/* ensure defaults for tunables */ /* ensure defaults for tunables */
asus->ppt_pl2_sppt = 5; asus->ppt_pl2_sppt = 5;
asus->ppt_pl1_spl = 5; asus->ppt_pl1_spl = 5;
@@ -4741,8 +4755,6 @@ static int asus_wmi_add(struct platform_device *pdev) @@ -4719,8 +4733,6 @@ static int asus_wmi_add(struct platform_device *pdev)
asus->egpu_enable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU); asus->egpu_enable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU);
asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU); asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU);
asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE); asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE);
@ -163,7 +134,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE)) if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE))
asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE; asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE;
@@ -4933,34 +4945,6 @@ static int asus_hotk_resume(struct device *device) @@ -4911,34 +4923,6 @@ static int asus_hotk_resume(struct device *device)
return 0; return 0;
} }
@ -198,7 +169,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
static int asus_hotk_restore(struct device *device) static int asus_hotk_restore(struct device *device)
{ {
struct asus_wmi *asus = dev_get_drvdata(device); struct asus_wmi *asus = dev_get_drvdata(device);
@@ -5001,11 +4985,32 @@ static int asus_hotk_restore(struct device *device) @@ -4979,11 +4963,32 @@ static int asus_hotk_restore(struct device *device)
return 0; return 0;
} }
@ -232,7 +203,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
.prepare = asus_hotk_prepare, .prepare = asus_hotk_prepare,
}; };
@@ -5033,6 +5038,10 @@ static int asus_wmi_probe(struct platform_device *pdev) @@ -5011,6 +5016,10 @@ static int asus_wmi_probe(struct platform_device *pdev)
return ret; return ret;
} }
@ -243,7 +214,7 @@ index 293ecd228a5a..acd0ec1d9aae 100644
return asus_wmi_add(pdev); return asus_wmi_add(pdev);
} }
@@ -5065,6 +5074,7 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver); @@ -5043,6 +5052,7 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver);
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver) void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
{ {
@ -255,10 +226,10 @@ index 293ecd228a5a..acd0ec1d9aae 100644
2.47.1 2.47.1
From a1141dd063ffac579de9dce1e33695dc1be6fc57 Mon Sep 17 00:00:00 2001 From 88042da6e79ac54e52c84f3b4e0239fdfa25335d Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 22 Sep 2024 21:40:46 +1200 Date: Sun, 22 Sep 2024 21:40:46 +1200
Subject: [PATCH 04/28] platform/x86: asus-wmi: export symbols used for Subject: [PATCH 04/29] platform/x86: asus-wmi: export symbols used for
read/write WMI read/write WMI
Export some rather helpful read/write WMI symbols using a namespace. Export some rather helpful read/write WMI symbols using a namespace.
@ -274,7 +245,7 @@ Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
2 files changed, 51 insertions(+), 3 deletions(-) 2 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index acd0ec1d9aae..6da2c7715a9f 100644 index eed807dfcb6c..93bbc2421366 100644
--- a/drivers/platform/x86/asus-wmi.c --- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c
@@ -388,7 +388,7 @@ int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval) @@ -388,7 +388,7 @@ int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval)
@ -282,7 +253,7 @@ index acd0ec1d9aae..6da2c7715a9f 100644
return asus_wmi_evaluate_method3(method_id, arg0, arg1, 0, retval); return asus_wmi_evaluate_method3(method_id, arg0, arg1, 0, retval);
} }
-EXPORT_SYMBOL_GPL(asus_wmi_evaluate_method); -EXPORT_SYMBOL_GPL(asus_wmi_evaluate_method);
+EXPORT_SYMBOL_NS_GPL(asus_wmi_evaluate_method, ASUS_WMI); +EXPORT_SYMBOL_NS_GPL(asus_wmi_evaluate_method, "ASUS_WMI");
static int asus_wmi_evaluate_method5(u32 method_id, static int asus_wmi_evaluate_method5(u32 method_id,
u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 *retval) u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 *retval)
@ -314,7 +285,7 @@ index acd0ec1d9aae..6da2c7715a9f 100644
+ +
+ return 0; + return 0;
+} +}
+EXPORT_SYMBOL_NS_GPL(asus_wmi_get_devstate_dsts, ASUS_WMI); +EXPORT_SYMBOL_NS_GPL(asus_wmi_get_devstate_dsts, "ASUS_WMI");
+ +
+/** +/**
+ * asus_wmi_set_devstate() - Set the WMI function state. + * asus_wmi_set_devstate() - Set the WMI function state.
@ -335,7 +306,7 @@ index acd0ec1d9aae..6da2c7715a9f 100644
return asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS, dev_id, return asus_wmi_evaluate_method(ASUS_WMI_METHODID_DEVS, dev_id,
ctrl_param, retval); ctrl_param, retval);
} }
+EXPORT_SYMBOL_NS_GPL(asus_wmi_set_devstate, ASUS_WMI); +EXPORT_SYMBOL_NS_GPL(asus_wmi_set_devstate, "ASUS_WMI");
/* Helper for special devices with magic return codes */ /* Helper for special devices with magic return codes */
static int asus_wmi_get_devstate_bits(struct asus_wmi *asus, static int asus_wmi_get_devstate_bits(struct asus_wmi *asus,
@ -366,10 +337,10 @@ index 365e119bebaa..6ea4dedfb85e 100644
2.47.1 2.47.1
From 7f65084989651f074bb3ff6ad440fd651d4a47bf Mon Sep 17 00:00:00 2001 From 88a3a655ded776243761ebf0912a9a83bfa7fe52 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 21 Sep 2024 16:04:58 +1200 Date: Sat, 21 Sep 2024 16:04:58 +1200
Subject: [PATCH 05/28] hid-asus: Add MODULE_IMPORT_NS(ASUS_WMI) Subject: [PATCH 05/29] hid-asus: Add MODULE_IMPORT_NS(ASUS_WMI)
A small change to asus_wmi_evaluate_method() was introduced during A small change to asus_wmi_evaluate_method() was introduced during
asus-armoury driver development to put the exports behind a namespace. asus-armoury driver development to put the exports behind a namespace.
@ -383,23 +354,23 @@ Acked-by: Jiri Kosina <jkosina@suse.com>
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index a4b47319ad8e..9540e3e19cce 100644 index 506c6f377e7d..e6030e013939 100644
--- a/drivers/hid/hid-asus.c --- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c
@@ -1301,4 +1301,5 @@ static struct hid_driver asus_driver = { @@ -1301,4 +1301,5 @@ static struct hid_driver asus_driver = {
}; };
module_hid_driver(asus_driver); module_hid_driver(asus_driver);
+MODULE_IMPORT_NS(ASUS_WMI); +MODULE_IMPORT_NS("ASUS_WMI");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
-- --
2.47.1 2.47.1
From 755e9eca472fb56ae53c2df8bde024e21ddc991c Mon Sep 17 00:00:00 2001 From ffa88b3d61d2ecf4760cf613cf0c736090d8010c Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 22 Sep 2024 21:39:43 +1200 Date: Sun, 22 Sep 2024 21:39:43 +1200
Subject: [PATCH 06/28] platform/x86: asus-armoury: move existing tunings to Subject: [PATCH 06/29] platform/x86: asus-armoury: move existing tunings to
asus-armoury module asus-armoury module
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
@ -443,10 +414,10 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
create mode 100644 drivers/platform/x86/asus-armoury.h create mode 100644 drivers/platform/x86/asus-armoury.h
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 3875abba5a79..80ec8b45022d 100644 index 0258dd879d64..294364cc7478 100644
--- a/drivers/platform/x86/Kconfig --- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig
@@ -265,6 +265,18 @@ config ASUS_WIRELESS @@ -267,6 +267,18 @@ config ASUS_WIRELESS
If you choose to compile this driver as a module the module will be If you choose to compile this driver as a module the module will be
called asus-wireless. called asus-wireless.
@ -479,7 +450,7 @@ index e1b142947067..fe3e7e7dede8 100644
obj-$(CONFIG_ASUS_TF103C_DOCK) += asus-tf103c-dock.o obj-$(CONFIG_ASUS_TF103C_DOCK) += asus-tf103c-dock.o
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
new file mode 100644 new file mode 100644
index 000000000000..0dd0af6c97e4 index 000000000000..e6b64418f77b
--- /dev/null --- /dev/null
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -0,0 +1,573 @@ @@ -0,0 +1,573 @@
@ -1051,7 +1022,7 @@ index 000000000000..0dd0af6c97e4
+module_init(asus_fw_init); +module_init(asus_fw_init);
+module_exit(asus_fw_exit); +module_exit(asus_fw_exit);
+ +
+MODULE_IMPORT_NS(ASUS_WMI); +MODULE_IMPORT_NS("ASUS_WMI");
+MODULE_AUTHOR("Luke Jones <luke@ljones.dev>"); +MODULE_AUTHOR("Luke Jones <luke@ljones.dev>");
+MODULE_DESCRIPTION("ASUS BIOS Configuration Driver"); +MODULE_DESCRIPTION("ASUS BIOS Configuration Driver");
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
@ -1210,7 +1181,7 @@ index 000000000000..b00d829c9da0
+ +
+#endif /* _ASUS_BIOSCFG_H_ */ +#endif /* _ASUS_BIOSCFG_H_ */
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6da2c7715a9f..525629097b9f 100644 index 93bbc2421366..ff8f0f47696c 100644
--- a/drivers/platform/x86/asus-wmi.c --- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c
@@ -55,8 +55,6 @@ module_param(fnlock_default, bool, 0444); @@ -55,8 +55,6 @@ module_param(fnlock_default, bool, 0444);
@ -1249,10 +1220,10 @@ index 6ea4dedfb85e..21313e1eb6c9 100644
2.47.1 2.47.1
From 7d28e4b7e77a31accd21c9886cea99af28dd4038 Mon Sep 17 00:00:00 2001 From a987017d8c7e5445f521ea683f1686bf80ce5f26 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 19 Sep 2024 17:23:35 +1200 Date: Thu, 19 Sep 2024 17:23:35 +1200
Subject: [PATCH 07/28] platform/x86: asus-armoury: add panel_hd_mode attribute Subject: [PATCH 07/29] platform/x86: asus-armoury: add panel_hd_mode attribute
Add panel_hd_mode to toggle the panel mode between single and high Add panel_hd_mode to toggle the panel mode between single and high
definition modes. definition modes.
@ -1265,7 +1236,7 @@ Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
2 files changed, 6 insertions(+), 1 deletion(-) 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 0dd0af6c97e4..e6bfb98420dd 100644 index e6b64418f77b..b8b9440e0c31 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -107,7 +107,8 @@ static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot); @@ -107,7 +107,8 @@ static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot);
@ -1311,10 +1282,10 @@ index 21313e1eb6c9..a6064995c2cc 100644
2.47.1 2.47.1
From 9065f2a2b500e211cd0893304b44d2a238e1b971 Mon Sep 17 00:00:00 2001 From abd20481883aba301d432eb3f9431c61aefec535 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 19 Sep 2024 17:19:37 +1200 Date: Thu, 19 Sep 2024 17:19:37 +1200
Subject: [PATCH 08/28] platform/x86: asus-armoury: add the ppt_* and nv_* Subject: [PATCH 08/29] platform/x86: asus-armoury: add the ppt_* and nv_*
tuning knobs tuning knobs
Adds the ppt_* and nv_* tuning knobs that are available via WMI methods Adds the ppt_* and nv_* tuning knobs that are available via WMI methods
@ -1323,12 +1294,12 @@ and adds proper min/max levels plus defaults.
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
--- ---
drivers/platform/x86/asus-armoury.c | 135 ++++++++++++++++++++++++++++ drivers/platform/x86/asus-armoury.c | 134 ++++++++++++++++++++++++++++
drivers/platform/x86/asus-armoury.h | 65 ++++++++++++++ drivers/platform/x86/asus-armoury.h | 65 ++++++++++++++
2 files changed, 200 insertions(+) 2 files changed, 199 insertions(+)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index e6bfb98420dd..18b911040e57 100644 index b8b9440e0c31..9e9c57cc742f 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -52,12 +52,40 @@ @@ -52,12 +52,40 @@
@ -1347,9 +1318,9 @@ index e6bfb98420dd..18b911040e57 100644
+ +
+ u32 ppt_pl1_spl; // cpu + u32 ppt_pl1_spl; // cpu
+ u32 ppt_pl2_sppt; // cpu + u32 ppt_pl2_sppt; // cpu
+ u32 ppt_pl3_fppt; // cpu
+ u32 ppt_apu_sppt; // plat + u32 ppt_apu_sppt; // plat
+ u32 ppt_platform_sppt; // plat + u32 ppt_platform_sppt; // plat
+ u32 ppt_fppt; // cpu
+ +
+ u32 nv_boost_default; + u32 nv_boost_default;
+ u32 nv_boost_min; + u32 nv_boost_min;
@ -1380,14 +1351,14 @@ index e6bfb98420dd..18b911040e57 100644
+ cpu_min, cpu_max, 1, "Set the CPU slow package limit"); + cpu_min, cpu_max, 1, "Set the CPU slow package limit");
+ATTR_GROUP_ROG_TUNABLE(ppt_pl2_sppt, "ppt_pl2_sppt", ASUS_WMI_DEVID_PPT_PL2_SPPT, cpu_default, +ATTR_GROUP_ROG_TUNABLE(ppt_pl2_sppt, "ppt_pl2_sppt", ASUS_WMI_DEVID_PPT_PL2_SPPT, cpu_default,
+ cpu_min, cpu_max, 1, "Set the CPU fast package limit"); + cpu_min, cpu_max, 1, "Set the CPU fast package limit");
+ATTR_GROUP_ROG_TUNABLE(ppt_pl3_fppt, "ppt_pl3_fppt", ASUS_WMI_DEVID_PPT_FPPT, cpu_default, cpu_min,
+ cpu_max, 1, "Set the CPU slow package limit");
+ATTR_GROUP_ROG_TUNABLE(ppt_apu_sppt, "ppt_apu_sppt", ASUS_WMI_DEVID_PPT_APU_SPPT, +ATTR_GROUP_ROG_TUNABLE(ppt_apu_sppt, "ppt_apu_sppt", ASUS_WMI_DEVID_PPT_APU_SPPT,
+ platform_default, platform_min, platform_max, 1, + platform_default, platform_min, platform_max, 1,
+ "Set the CPU slow package limit"); + "Set the CPU slow package limit");
+ATTR_GROUP_ROG_TUNABLE(ppt_platform_sppt, "ppt_platform_sppt", ASUS_WMI_DEVID_PPT_PLAT_SPPT, +ATTR_GROUP_ROG_TUNABLE(ppt_platform_sppt, "ppt_platform_sppt", ASUS_WMI_DEVID_PPT_PLAT_SPPT,
+ platform_default, platform_min, platform_max, 1, + platform_default, platform_min, platform_max, 1,
+ "Set the CPU slow package limit"); + "Set the CPU slow package limit");
+ATTR_GROUP_ROG_TUNABLE(ppt_fppt, "ppt_fppt", ASUS_WMI_DEVID_PPT_FPPT, cpu_default, cpu_min,
+ cpu_max, 1, "Set the CPU slow package limit");
+ATTR_GROUP_ROG_TUNABLE(nv_dynamic_boost, "nv_dynamic_boost", ASUS_WMI_DEVID_NV_DYN_BOOST, +ATTR_GROUP_ROG_TUNABLE(nv_dynamic_boost, "nv_dynamic_boost", ASUS_WMI_DEVID_NV_DYN_BOOST,
+ nv_boost_default, nv_boost_min, nv_boost_max, 1, + nv_boost_default, nv_boost_min, nv_boost_max, 1,
+ "Set the Nvidia dynamic boost limit"); + "Set the Nvidia dynamic boost limit");
@ -1404,16 +1375,16 @@ index e6bfb98420dd..18b911040e57 100644
+ { &ppt_pl1_spl_attr_group, ASUS_WMI_DEVID_PPT_PL1_SPL }, + { &ppt_pl1_spl_attr_group, ASUS_WMI_DEVID_PPT_PL1_SPL },
+ { &ppt_pl2_sppt_attr_group, ASUS_WMI_DEVID_PPT_PL2_SPPT }, + { &ppt_pl2_sppt_attr_group, ASUS_WMI_DEVID_PPT_PL2_SPPT },
+ { &ppt_pl3_fppt_attr_group, ASUS_WMI_DEVID_PPT_FPPT },
+ { &ppt_apu_sppt_attr_group, ASUS_WMI_DEVID_PPT_APU_SPPT }, + { &ppt_apu_sppt_attr_group, ASUS_WMI_DEVID_PPT_APU_SPPT },
+ { &ppt_platform_sppt_attr_group, ASUS_WMI_DEVID_PPT_PLAT_SPPT }, + { &ppt_platform_sppt_attr_group, ASUS_WMI_DEVID_PPT_PLAT_SPPT },
+ { &ppt_fppt_attr_group, ASUS_WMI_DEVID_PPT_FPPT },
+ { &nv_dynamic_boost_attr_group, ASUS_WMI_DEVID_NV_DYN_BOOST }, + { &nv_dynamic_boost_attr_group, ASUS_WMI_DEVID_NV_DYN_BOOST },
+ { &nv_temp_target_attr_group, ASUS_WMI_DEVID_NV_THERM_TARGET }, + { &nv_temp_target_attr_group, ASUS_WMI_DEVID_NV_THERM_TARGET },
+ +
{ &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE }, { &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE },
{ &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND }, { &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND },
{ &mcu_powersave_attr_group, ASUS_WMI_DEVID_MCU_POWERSAVE }, { &mcu_powersave_attr_group, ASUS_WMI_DEVID_MCU_POWERSAVE },
@@ -532,6 +587,80 @@ static int asus_fw_attr_add(void) @@ -532,6 +587,79 @@ static int asus_fw_attr_add(void)
/* Init / exit ****************************************************************/ /* Init / exit ****************************************************************/
@ -1475,10 +1446,9 @@ index e6bfb98420dd..18b911040e57 100644
+ +
+ rog->ppt_pl1_spl = cpu_default; + rog->ppt_pl1_spl = cpu_default;
+ rog->ppt_pl2_sppt = cpu_default; + rog->ppt_pl2_sppt = cpu_default;
+ rog->ppt_pl3_fppt = cpu_default;
+ rog->ppt_apu_sppt = cpu_default; + rog->ppt_apu_sppt = cpu_default;
+
+ rog->ppt_platform_sppt = platform_default; + rog->ppt_platform_sppt = platform_default;
+ rog->ppt_fppt = cpu_default;
+ +
+ rog->nv_boost_default = NVIDIA_BOOST_MAX; + rog->nv_boost_default = NVIDIA_BOOST_MAX;
+ rog->nv_boost_min = NVIDIA_BOOST_MIN; + rog->nv_boost_min = NVIDIA_BOOST_MIN;
@ -1494,7 +1464,7 @@ index e6bfb98420dd..18b911040e57 100644
static int __init asus_fw_init(void) static int __init asus_fw_init(void)
{ {
char *wmi_uid; char *wmi_uid;
@@ -548,6 +677,12 @@ static int __init asus_fw_init(void) @@ -548,6 +676,12 @@ static int __init asus_fw_init(void)
if (!strcmp(wmi_uid, ASUS_ACPI_UID_ASUSWMI)) if (!strcmp(wmi_uid, ASUS_ACPI_UID_ASUSWMI))
return -ENODEV; return -ENODEV;
@ -1592,10 +1562,10 @@ index b00d829c9da0..91ec6f4cb149 100644
2.47.1 2.47.1
From 885251ddad44ce0fa49de6b8e6796009df60421f Mon Sep 17 00:00:00 2001 From 961fd02b999977441e0f621b335a42048665949f Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 2 Jun 2024 14:32:15 +1200 Date: Sun, 2 Jun 2024 14:32:15 +1200
Subject: [PATCH 09/28] platform/x86: asus-armoury: add dgpu tgp control Subject: [PATCH 09/29] platform/x86: asus-armoury: add dgpu tgp control
Implement the dgpu TGP control under the asus-armoury module using the Implement the dgpu TGP control under the asus-armoury module using the
fw_attributes class. fw_attributes class.
@ -1609,7 +1579,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
3 files changed, 42 insertions(+) 3 files changed, 42 insertions(+)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 18b911040e57..10ab258855c4 100644 index 9e9c57cc742f..5d7e4643813e 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -45,6 +45,9 @@ @@ -45,6 +45,9 @@
@ -1648,7 +1618,7 @@ index 18b911040e57..10ab258855c4 100644
ATTR_GROUP_ENUM_INT_RO(charge_mode, "charge_mode", ASUS_WMI_DEVID_CHARGE_MODE, "0;1;2", ATTR_GROUP_ENUM_INT_RO(charge_mode, "charge_mode", ASUS_WMI_DEVID_CHARGE_MODE, "0;1;2",
"Show the current mode of charging"); "Show the current mode of charging");
@@ -485,6 +499,8 @@ static const struct asus_attr_group armoury_attr_groups[] = { @@ -485,6 +499,8 @@ static const struct asus_attr_group armoury_attr_groups[] = {
{ &ppt_fppt_attr_group, ASUS_WMI_DEVID_PPT_FPPT }, { &ppt_platform_sppt_attr_group, ASUS_WMI_DEVID_PPT_PLAT_SPPT },
{ &nv_dynamic_boost_attr_group, ASUS_WMI_DEVID_NV_DYN_BOOST }, { &nv_dynamic_boost_attr_group, ASUS_WMI_DEVID_NV_DYN_BOOST },
{ &nv_temp_target_attr_group, ASUS_WMI_DEVID_NV_THERM_TARGET }, { &nv_temp_target_attr_group, ASUS_WMI_DEVID_NV_THERM_TARGET },
+ { &dgpu_base_tgp_attr_group, ASUS_WMI_DEVID_DGPU_BASE_TGP }, + { &dgpu_base_tgp_attr_group, ASUS_WMI_DEVID_DGPU_BASE_TGP },
@ -1656,7 +1626,7 @@ index 18b911040e57..10ab258855c4 100644
{ &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE }, { &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE },
{ &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND }, { &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND },
@@ -659,6 +675,11 @@ static void init_rog_tunables(struct rog_tunables *rog) @@ -658,6 +674,11 @@ static void init_rog_tunables(struct rog_tunables *rog)
rog->nv_temp_min = NVIDIA_TEMP_MIN; rog->nv_temp_min = NVIDIA_TEMP_MIN;
rog->nv_temp_max = NVIDIA_TEMP_MAX; rog->nv_temp_max = NVIDIA_TEMP_MAX;
rog->nv_temp_target = NVIDIA_TEMP_MIN; rog->nv_temp_target = NVIDIA_TEMP_MIN;
@ -1722,10 +1692,10 @@ index a6064995c2cc..8c755799eb60 100644
2.47.1 2.47.1
From ccea3439731ded372f9b71c3542d5eebc878ce2b Mon Sep 17 00:00:00 2001 From 6e39a84d8a15975a08a4d91cc0561079c7b86c3d Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 2 Jun 2024 14:44:31 +1200 Date: Sun, 2 Jun 2024 14:44:31 +1200
Subject: [PATCH 10/28] platform/x86: asus-armoury: add apu-mem control support Subject: [PATCH 10/29] platform/x86: asus-armoury: add apu-mem control support
Implement the APU memory size control under the asus-armoury module using Implement the APU memory size control under the asus-armoury module using
the fw_attributes class. the fw_attributes class.
@ -1741,7 +1711,7 @@ Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
2 files changed, 115 insertions(+) 2 files changed, 115 insertions(+)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 10ab258855c4..271dadc4c75d 100644 index 5d7e4643813e..386f4236f5f8 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -446,6 +446,119 @@ static ssize_t egpu_enable_current_value_store(struct kobject *kobj, struct kobj @@ -446,6 +446,119 @@ static ssize_t egpu_enable_current_value_store(struct kobject *kobj, struct kobj
@ -1888,10 +1858,10 @@ index 8c755799eb60..88bf250dc8ca 100644
2.47.1 2.47.1
From 1508da1b03bedecbe0a991bece7c1797b14fe055 Mon Sep 17 00:00:00 2001 From fd1f1c947e97fe066986d82aea4986990764ccc8 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 18 Sep 2024 21:19:12 +1200 Date: Wed, 18 Sep 2024 21:19:12 +1200
Subject: [PATCH 11/28] platform/x86: asus-armoury: add core count control Subject: [PATCH 11/29] platform/x86: asus-armoury: add core count control
Implement Intel core enablement under the asus-armoury module using the Implement Intel core enablement under the asus-armoury module using the
fw_attributes class. fw_attributes class.
@ -1908,7 +1878,7 @@ Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
3 files changed, 258 insertions(+) 3 files changed, 258 insertions(+)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 271dadc4c75d..69e79446c411 100644 index 386f4236f5f8..f09811d76b45 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -40,6 +40,24 @@ @@ -40,6 +40,24 @@
@ -2164,7 +2134,7 @@ index 271dadc4c75d..69e79446c411 100644
{ &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE }, { &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE },
{ &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND }, { &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND },
@@ -817,6 +1035,14 @@ static int __init asus_fw_init(void) @@ -816,6 +1034,14 @@ static int __init asus_fw_init(void)
return -ENOMEM; return -ENOMEM;
init_rog_tunables(asus_armoury.rog_tunables); init_rog_tunables(asus_armoury.rog_tunables);
@ -2237,10 +2207,10 @@ index 88bf250dc8ca..cc21e4272460 100644
2.47.1 2.47.1
From ed252adfb6011ca67f98bd47bb8842a7f2be2ee0 Mon Sep 17 00:00:00 2001 From 95ee3427398d33b92d44e36c7986e4155fa93095 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 3 Jun 2024 12:04:41 +1200 Date: Mon, 3 Jun 2024 12:04:41 +1200
Subject: [PATCH 12/28] platform/x86: asus-wmi: deprecate bios features Subject: [PATCH 12/29] platform/x86: asus-wmi: deprecate bios features
With the existence of the asus-armoury module the attributes no-longer With the existence of the asus-armoury module the attributes no-longer
need to live under the /sys/devices/platform/asus-nb-wmi/ path. need to live under the /sys/devices/platform/asus-nb-wmi/ path.
@ -2397,10 +2367,10 @@ index 28144371a0f1..765d50b0d9df 100644
* 0 - False, * 0 - False,
* 1 - True * 1 - True
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 80ec8b45022d..d0fc68d93f48 100644 index 294364cc7478..b160173a530e 100644
--- a/drivers/platform/x86/Kconfig --- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig
@@ -299,6 +299,15 @@ config ASUS_WMI @@ -301,6 +301,15 @@ config ASUS_WMI
To compile this driver as a module, choose M here: the module will To compile this driver as a module, choose M here: the module will
be called asus-wmi. be called asus-wmi.
@ -2417,7 +2387,7 @@ index 80ec8b45022d..d0fc68d93f48 100644
tristate "Asus Notebook WMI Driver" tristate "Asus Notebook WMI Driver"
depends on ASUS_WMI depends on ASUS_WMI
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 525629097b9f..d4981e08f44f 100644 index ff8f0f47696c..6bd89cd0acdf 100644
--- a/drivers/platform/x86/asus-wmi.c --- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c
@@ -286,11 +286,12 @@ struct asus_wmi { @@ -286,11 +286,12 @@ struct asus_wmi {
@ -2737,15 +2707,15 @@ index 525629097b9f..d4981e08f44f 100644
/* Quirks *********************************************************************/ /* Quirks *********************************************************************/
@@ -3807,6 +3870,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) @@ -3785,6 +3848,7 @@ static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
return 0; return throttle_thermal_policy_write(asus);
} }
+#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS) +#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
static ssize_t throttle_thermal_policy_show(struct device *dev, static ssize_t throttle_thermal_policy_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
@@ -3850,6 +3914,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, @@ -3828,6 +3892,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
* Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent * Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent
*/ */
static DEVICE_ATTR_RW(throttle_thermal_policy); static DEVICE_ATTR_RW(throttle_thermal_policy);
@ -2753,7 +2723,7 @@ index 525629097b9f..d4981e08f44f 100644
/* Platform profile ***********************************************************/ /* Platform profile ***********************************************************/
static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof, static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof,
@@ -4447,27 +4512,29 @@ static struct attribute *platform_attributes[] = { @@ -4425,27 +4490,29 @@ static struct attribute *platform_attributes[] = {
&dev_attr_camera.attr, &dev_attr_camera.attr,
&dev_attr_cardr.attr, &dev_attr_cardr.attr,
&dev_attr_touchpad.attr, &dev_attr_touchpad.attr,
@ -2801,7 +2771,7 @@ index 525629097b9f..d4981e08f44f 100644
NULL NULL
}; };
@@ -4489,7 +4556,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, @@ -4467,7 +4534,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
devid = ASUS_WMI_DEVID_LID_RESUME; devid = ASUS_WMI_DEVID_LID_RESUME;
else if (attr == &dev_attr_als_enable.attr) else if (attr == &dev_attr_als_enable.attr)
devid = ASUS_WMI_DEVID_ALS_ENABLE; devid = ASUS_WMI_DEVID_ALS_ENABLE;
@ -2814,7 +2784,7 @@ index 525629097b9f..d4981e08f44f 100644
devid = ASUS_WMI_DEVID_CHARGE_MODE; devid = ASUS_WMI_DEVID_CHARGE_MODE;
else if (attr == &dev_attr_egpu_enable.attr) else if (attr == &dev_attr_egpu_enable.attr)
ok = asus->egpu_enable_available; ok = asus->egpu_enable_available;
@@ -4527,6 +4598,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, @@ -4505,6 +4576,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
ok = asus->mini_led_dev_id != 0; ok = asus->mini_led_dev_id != 0;
else if (attr == &dev_attr_available_mini_led_mode.attr) else if (attr == &dev_attr_available_mini_led_mode.attr)
ok = asus->mini_led_dev_id != 0; ok = asus->mini_led_dev_id != 0;
@ -2822,7 +2792,7 @@ index 525629097b9f..d4981e08f44f 100644
if (devid != -1) { if (devid != -1) {
ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
@@ -4778,6 +4850,7 @@ static int asus_wmi_add(struct platform_device *pdev) @@ -4756,6 +4828,7 @@ static int asus_wmi_add(struct platform_device *pdev)
} }
/* ensure defaults for tunables */ /* ensure defaults for tunables */
@ -2830,7 +2800,7 @@ index 525629097b9f..d4981e08f44f 100644
asus->ppt_pl2_sppt = 5; asus->ppt_pl2_sppt = 5;
asus->ppt_pl1_spl = 5; asus->ppt_pl1_spl = 5;
asus->ppt_apu_sppt = 5; asus->ppt_apu_sppt = 5;
@@ -4799,17 +4872,18 @@ static int asus_wmi_add(struct platform_device *pdev) @@ -4777,17 +4850,18 @@ static int asus_wmi_add(struct platform_device *pdev)
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX; asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX;
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO)) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO))
asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO; asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO;
@ -2858,40 +2828,10 @@ index 525629097b9f..d4981e08f44f 100644
2.47.1 2.47.1
From c353db0dd524535c9e123529c90e99ed3d25fb49 Mon Sep 17 00:00:00 2001 From ab778daeb11f674e02e49ddb867610da892449e0 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 10 Oct 2024 09:52:45 +1300
Subject: [PATCH 13/28] ALSA: hda/realtek: fixup ASUS GA605W
The GA605W laptop has almost the exact same codec setup as the GA403
and so the same quirks apply to it.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
sound/pci/hda/patch_realtek.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 192fc75b51e6..d88fc0ca893d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -10604,6 +10604,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
+ SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
+ SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
--
2.47.1
From e44288e88b8fa2f4f2e33522e0b2666b467b31aa Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 26 Aug 2024 12:49:35 +1200 Date: Mon, 26 Aug 2024 12:49:35 +1200
Subject: [PATCH 14/28] hid-asus-ally: Add joystick LED ring support Subject: [PATCH 13/29] hid-asus-ally: Add joystick LED ring support
Adds basic support for the joystick RGB LED rings as a multicolour LED Adds basic support for the joystick RGB LED rings as a multicolour LED
device with 4 LEDs. device with 4 LEDs.
@ -2908,7 +2848,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev>
create mode 100644 drivers/hid/hid-asus-ally.h create mode 100644 drivers/hid/hid-asus-ally.h
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index f8a56d631242..d477df3a3f35 100644 index 4d2a89d65b65..89357822c27b 100644
--- a/drivers/hid/Kconfig --- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig
@@ -164,6 +164,15 @@ config HID_ASUS @@ -164,6 +164,15 @@ config HID_ASUS
@ -2928,7 +2868,7 @@ index f8a56d631242..d477df3a3f35 100644
tristate "Aureal" tristate "Aureal"
help help
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 496dab54c73a..5fa65e1e1e3b 100644 index 24de45f3677d..f338c9eb4600 100644
--- a/drivers/hid/Makefile --- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile +++ b/drivers/hid/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_HID_APPLE) += hid-apple.o @@ -31,6 +31,7 @@ obj-$(CONFIG_HID_APPLE) += hid-apple.o
@ -3615,7 +3555,7 @@ index 000000000000..eb8617c80c2a
+ xpad_cmd_len_adz = 0x02, + xpad_cmd_len_adz = 0x02,
+}; +};
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 9540e3e19cce..7c5269cd4d76 100644 index e6030e013939..ef18f721e2ff 100644
--- a/drivers/hid/hid-asus.c --- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c
@@ -52,6 +52,10 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); @@ -52,6 +52,10 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
@ -3672,10 +3612,10 @@ index 9540e3e19cce..7c5269cd4d76 100644
2.47.1 2.47.1
From caab298317491b6b6b8a7a9000116e114cd860b6 Mon Sep 17 00:00:00 2001 From c1fa1ae4de0cc611b264f3452fd24fe3cca0a2b8 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 2 Oct 2024 23:32:46 +1300 Date: Wed, 2 Oct 2024 23:32:46 +1300
Subject: [PATCH 15/28] hid-asus-ally: initial Ally-X gamepad Subject: [PATCH 14/29] hid-asus-ally: initial Ally-X gamepad
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -4159,10 +4099,10 @@ index eb8617c80c2a..458d02996bca 100644
2.47.1 2.47.1
From 13ccb06fd0af8663cc3d54699fd1caccb983a5a0 Mon Sep 17 00:00:00 2001 From 9ba17e350f65373bd366c8465bb8f26d98d4a405 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 2 Oct 2024 23:51:36 +1300 Date: Wed, 2 Oct 2024 23:51:36 +1300
Subject: [PATCH 16/28] hid-asus-ally: initial gamepad configuration Subject: [PATCH 15/29] hid-asus-ally: initial gamepad configuration
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -4571,10 +4511,10 @@ index 458d02996bca..2b298ad4da0e 100644
2.47.1 2.47.1
From e55ed327e70cd92738bf5b63efd92bb88f82c7bc Mon Sep 17 00:00:00 2001 From 84b34f27d809c52e7d220f30d4cc20fe0b64a332 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 14:58:33 +1300 Date: Sat, 5 Oct 2024 14:58:33 +1300
Subject: [PATCH 17/28] hid-asus-ally: add button remap attributes Subject: [PATCH 16/29] hid-asus-ally: add button remap attributes
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5283,10 +5223,10 @@ index 2b298ad4da0e..f985cbd698c3 100644
2.47.1 2.47.1
From 3a019f986fbec2ab488303f992fbe40389d26524 Mon Sep 17 00:00:00 2001 From 2f3abc431a0d61a3b391f050929a8bd2ff22fbf3 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Fri, 25 Oct 2024 08:56:54 +0200 Date: Fri, 25 Oct 2024 08:56:54 +0200
Subject: [PATCH 18/28] hid-asus-ally: add gamepad mode selection Subject: [PATCH 17/29] hid-asus-ally: add gamepad mode selection
--- ---
drivers/hid/hid-asus-ally.c | 73 +++++++++++++++++++++++++++++++++++++ drivers/hid/hid-asus-ally.c | 73 +++++++++++++++++++++++++++++++++++++
@ -5404,10 +5344,10 @@ index f985cbd698c3..f7e21be50d8e 100644
2.47.1 2.47.1
From fe383c22dd2899f08b03f8040af07d2163647c39 Mon Sep 17 00:00:00 2001 From 061aa0f79b14ea7ac01a0703132f2717506297d8 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 15:40:09 +1300 Date: Sat, 5 Oct 2024 15:40:09 +1300
Subject: [PATCH 19/28] hid-asus-ally: Turbo settings for buttons Subject: [PATCH 18/29] hid-asus-ally: Turbo settings for buttons
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5604,10 +5544,10 @@ index f7e21be50d8e..63a3b5caa71c 100644
2.47.1 2.47.1
From 5dd0a575d36ce31154d93e76193b91cda0888137 Mon Sep 17 00:00:00 2001 From 34494abc5037b770f9f7c4cf2d3c7ff3d972b5a2 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 20:46:00 +1300 Date: Sat, 5 Oct 2024 20:46:00 +1300
Subject: [PATCH 20/28] hid-asus-ally: add vibration intensity settings Subject: [PATCH 19/29] hid-asus-ally: add vibration intensity settings
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5775,10 +5715,10 @@ index 63a3b5caa71c..6ac79ad3c5f2 100644
2.47.1 2.47.1
From b060d13d6fdd1f7bf488d72fa705517fc0fd1545 Mon Sep 17 00:00:00 2001 From f925a380b924029b0009db07a05a1ded5d21afdf Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 21:32:41 +1300 Date: Sat, 5 Oct 2024 21:32:41 +1300
Subject: [PATCH 21/28] hid-asus-ally: add JS deadzones Subject: [PATCH 20/29] hid-asus-ally: add JS deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -5984,10 +5924,10 @@ index 6ac79ad3c5f2..3dc14a5226f3 100644
2.47.1 2.47.1
From 0e1e99bd457064942e9023bb823b56a14892be0f Mon Sep 17 00:00:00 2001 From 9cf3fa400f89e0f0845907544cde3c4abe11b0d3 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sat, 5 Oct 2024 21:37:27 +1300 Date: Sat, 5 Oct 2024 21:37:27 +1300
Subject: [PATCH 22/28] hid-asus-ally: add trigger deadzones Subject: [PATCH 21/29] hid-asus-ally: add trigger deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6101,10 +6041,10 @@ index 3dc14a5226f3..32ed5caa3759 100644
2.47.1 2.47.1
From e60cb0bb587e7b6c549353000a2fd0eff019aaef Mon Sep 17 00:00:00 2001 From 33d060c292e0be3c1f73c983494c33e252ae6496 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 6 Oct 2024 19:49:24 +1300 Date: Sun, 6 Oct 2024 19:49:24 +1300
Subject: [PATCH 23/28] hid-asus-ally: add anti-deadzones Subject: [PATCH 22/29] hid-asus-ally: add anti-deadzones
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6286,10 +6226,10 @@ index 32ed5caa3759..69f59592dd50 100644
2.47.1 2.47.1
From f3d319113cf5e4b203476d329b6a1d30a555752f Mon Sep 17 00:00:00 2001 From 67683991b856661858d72befcf50e1af469d34f3 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Sun, 6 Oct 2024 21:22:40 +1300 Date: Sun, 6 Oct 2024 21:22:40 +1300
Subject: [PATCH 24/28] hid-asus-ally: add JS response curves Subject: [PATCH 23/29] hid-asus-ally: add JS response curves
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6526,10 +6466,10 @@ index 69f59592dd50..c83817589082 100644
2.47.1 2.47.1
From e63cb120c18461beca50d4890fd92141a7b6f001 Mon Sep 17 00:00:00 2001 From b492b11b9d1a233423d8b38b0f49712d7f8ca00a Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Thu, 10 Oct 2024 11:15:36 +1300 Date: Thu, 10 Oct 2024 11:15:36 +1300
Subject: [PATCH 25/28] hid-asus-ally: add calibrations (wip) Subject: [PATCH 24/29] hid-asus-ally: add calibrations (wip)
Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Luke D. Jones <luke@ljones.dev>
--- ---
@ -6674,10 +6614,10 @@ index 9f9a7516b774..5a8458e232d3 100644
2.47.1 2.47.1
From a112e37e12870d8ca40da77d24e4e4de056e9d11 Mon Sep 17 00:00:00 2001 From be811003d716d94cc0465313677ed275d18911d7 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev> From: "Luke D. Jones" <luke@ljones.dev>
Date: Wed, 6 Nov 2024 00:27:03 +0300 Date: Wed, 6 Nov 2024 00:27:03 +0300
Subject: [PATCH 26/28] debug by default Subject: [PATCH 25/29] debug by default
--- ---
drivers/hid/hid-asus-ally.c | 2 ++ drivers/hid/hid-asus-ally.c | 2 ++
@ -6698,7 +6638,7 @@ index 5a8458e232d3..d59316001f50 100644
#define FEATURE_REPORT_ID 0x0d #define FEATURE_REPORT_ID 0x0d
#define FEATURE_ROG_ALLY_REPORT_ID 0x5a #define FEATURE_ROG_ALLY_REPORT_ID 0x5a
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 69e79446c411..fb4ae804521d 100644 index f09811d76b45..4dac91d02278 100644
--- a/drivers/platform/x86/asus-armoury.c --- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c
@@ -27,6 +27,8 @@ @@ -27,6 +27,8 @@
@ -6713,125 +6653,3 @@ index 69e79446c411..fb4ae804521d 100644
-- --
2.47.1 2.47.1
From de3341e021d14f75ae701dc6463036ef84e37024 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev>
Date: Tue, 17 Dec 2024 09:31:08 +1300
Subject: [PATCH 27/28] Tmp: add GA605W & H7606W to AMD-PMF quirks.
This will not be submitted upstream as the entire
quirk system is being removed in 6.14 kernel.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/platform/x86/amd/pmf/pmf-quirks.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/platform/x86/amd/pmf/pmf-quirks.c b/drivers/platform/x86/amd/pmf/pmf-quirks.c
index 7cde5733b9ca..02b9d0b49092 100644
--- a/drivers/platform/x86/amd/pmf/pmf-quirks.c
+++ b/drivers/platform/x86/amd/pmf/pmf-quirks.c
@@ -29,6 +29,22 @@ static const struct dmi_system_id fwbug_list[] = {
},
.driver_data = &quirk_no_sps_bug,
},
+ {
+ .ident = "ROG Zephyrus G16",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "GA605W"),
+ },
+ .driver_data = &quirk_no_sps_bug,
+ },
+ {
+ .ident = "ProArt P16",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "H7606W"),
+ },
+ .driver_data = &quirk_no_sps_bug,
+ },
{
.ident = "ROG Ally X",
.matches = {
--
2.47.1
From 66a01bb83e65e9b78731507954eed6e2a7f3b767 Mon Sep 17 00:00:00 2001
From: "Luke D. Jones" <luke@ljones.dev>
Date: Mon, 6 Jan 2025 11:22:43 +1300
Subject: [PATCH 28/28] hid-asus: Disable OOBE mode on the ProArt P16
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 29 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h | 5 ++++
2 files changed, 34 insertions(+)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 7c5269cd4d76..c077d8817004 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -437,6 +437,26 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
return ret;
}
+static int asus_kbd_disable_oobe(struct hid_device *hdev)
+{
+ const u8 init[][6] = {
+ // Use size of largest array for array dimension
+ { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 },
+ { FEATURE_KBD_REPORT_ID, 0xBA, 0xC5, 0xC4 },
+ { FEATURE_KBD_REPORT_ID, 0xD0, 0x8F, 0x01 },
+ { FEATURE_KBD_REPORT_ID, 0xD0, 0x85, 0xFF }
+ };
+ int ret;
+
+ for (size_t i = 0; i < ARRAY_SIZE(init); i++) {
+ ret = asus_kbd_set_report(hdev, init[i], sizeof(init[i]));
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
static void asus_schedule_work(struct asus_kbd_leds *led)
{
unsigned long flags;
@@ -539,6 +559,15 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
if (ret < 0)
return ret;
+
+ if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
+ hid_info(hdev, "Laptop requires disabling the OOBE mode for LED use");
+ ret = asus_kbd_disable_oobe(hdev);
+ if (ret < 0)
+ return ret;
+ else
+ hid_info(hdev, "Disabled OOBE mode");
+ }
} else {
/* Initialize keyboard */
ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index cc21e4272460..c427b6c20d3f 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -206,6 +206,11 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
},
},
+ {
+ .matches = {
+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
+ },
+ },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA403U"),
--
2.47.1