diff --git a/linux/experiments.patch b/linux/experiments.patch index 00e76c3..e9da11b 100644 --- a/linux/experiments.patch +++ b/linux/experiments.patch @@ -1,7 +1,52 @@ -From 02fa204301911994496dcdf829aee9d79ace7446 Mon Sep 17 00:00:00 2001 +From e075f9eda9a10898a4681b5bd68625a16bf2e6df Mon Sep 17 00:00:00 2001 +From: "Luke D. Jones" +Date: Thu, 25 Jul 2024 10:31:25 +1200 +Subject: [PATCH 01/21] hid-asus: add ROG Ally X prod ID to quirk list + +The new ASUS ROG Ally X functions almost exactly the same as the previous +model, so we can use the same quirks. + +Signed-off-by: Luke D. Jones +Signed-off-by: Jiri Kosina +--- + drivers/hid/hid-asus.c | 3 +++ + drivers/hid/hid-ids.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c +index 37e6d25593c2..a282388b7aa5 100644 +--- a/drivers/hid/hid-asus.c ++++ b/drivers/hid/hid-asus.c +@@ -1248,6 +1248,9 @@ static const struct hid_device_id asus_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY), + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, ++ USB_DEVICE_ID_ASUSTEK_ROG_NKEY_ALLY_X), ++ QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, + USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD), + QUIRK_ROG_CLAYMORE_II_KEYBOARD }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 72d56ee7ce1b..6e3223389080 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -210,6 +210,7 @@ + #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD3 0x1a30 + #define USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR 0x18c6 + #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 + #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 + +-- +2.46.0 + + +From 5ca9dc399ef55803704bb4804c3605505142fb3a Mon Sep 17 00:00:00 2001 From: Jonathan LoBue Date: Sat, 13 Jul 2024 00:12:06 -0700 -Subject: [PATCH 01/20] Fix ROG ALLY X audio +Subject: [PATCH 02/21] Fix ROG ALLY X audio Patch to test fixing TAS2781 amp getting bound properly to i2c for ASUS ROG ALLY X. @@ -10,10 +55,10 @@ for ASUS ROG ALLY X. 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index d022a25635f9..2f080e02f1db 100644 +index 711e29f743a5..0d87b4bfe6ad 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -7492,6 +7492,7 @@ enum { +@@ -7426,6 +7426,7 @@ enum { ALC285_FIXUP_THINKPAD_X1_GEN7, ALC285_FIXUP_THINKPAD_HEADSET_JACK, ALC294_FIXUP_ASUS_ALLY, @@ -21,7 +66,7 @@ index d022a25635f9..2f080e02f1db 100644 ALC294_FIXUP_ASUS_ALLY_PINS, ALC294_FIXUP_ASUS_ALLY_VERBS, ALC294_FIXUP_ASUS_ALLY_SPEAKER, -@@ -8960,6 +8961,12 @@ static const struct hda_fixup alc269_fixups[] = { +@@ -8931,6 +8932,12 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS }, @@ -34,7 +79,7 @@ index d022a25635f9..2f080e02f1db 100644 [ALC294_FIXUP_ASUS_ALLY_PINS] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { -@@ -10411,6 +10418,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { +@@ -10363,6 +10370,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY), @@ -46,10 +91,10 @@ index d022a25635f9..2f080e02f1db 100644 2.46.0 -From 4a040450349ba43449b7026de680bc46240ed51e Mon Sep 17 00:00:00 2001 +From ea25b6d4662ed926d3628c30fb364580ef00443e Mon Sep 17 00:00:00 2001 From: Mohamed Ghanmi Date: Sun, 9 Jun 2024 15:48:49 +0100 -Subject: [PATCH 02/20] platform/x86: asus-wmi: add support for vivobook fan +Subject: [PATCH 03/21] platform/x86: asus-wmi: add support for vivobook fan profiles Add support for vivobook fan profiles wmi call on the ASUS VIVOBOOK @@ -75,7 +120,7 @@ Signed-off-by: Hans de Goede 2 files changed, 71 insertions(+), 50 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index cc735931f97b..00669cf678fb 100644 +index bc9c5db38324..7472d1c19fff 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -97,6 +97,12 @@ module_param(fnlock_default, bool, 0444); @@ -91,7 +136,7 @@ index cc735931f97b..00669cf678fb 100644 #define USB_INTEL_XUSB2PR 0xD0 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 -@@ -286,8 +292,8 @@ struct asus_wmi { +@@ -285,8 +291,8 @@ struct asus_wmi { u32 kbd_rgb_dev; bool kbd_rgb_state_available; @@ -101,7 +146,7 @@ index cc735931f97b..00669cf678fb 100644 bool cpu_fan_curve_available; bool gpu_fan_curve_available; -@@ -3162,7 +3168,7 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) +@@ -3127,7 +3133,7 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) int err, fan_idx; u8 mode = 0; @@ -110,7 +155,7 @@ index cc735931f97b..00669cf678fb 100644 mode = asus->throttle_thermal_policy_mode; /* DEVID_PU_FAN_CURVE is switched for OVERBOOST vs SILENT */ if (mode == 2) -@@ -3369,7 +3375,7 @@ static ssize_t fan_curve_enable_store(struct device *dev, +@@ -3334,7 +3340,7 @@ static ssize_t fan_curve_enable_store(struct device *dev, * For machines with throttle this is the only way to reset fans * to default mode of operation (does not erase curve data). */ @@ -119,7 +164,7 @@ index cc735931f97b..00669cf678fb 100644 err = throttle_thermal_policy_write(asus); if (err) return err; -@@ -3586,8 +3592,8 @@ static const struct attribute_group asus_fan_curve_attr_group = { +@@ -3551,8 +3557,8 @@ static const struct attribute_group asus_fan_curve_attr_group = { __ATTRIBUTE_GROUPS(asus_fan_curve_attr); /* @@ -130,7 +175,7 @@ index cc735931f97b..00669cf678fb 100644 */ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) { -@@ -3628,38 +3634,13 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) +@@ -3593,38 +3599,13 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) } /* Throttle thermal policy ****************************************************/ @@ -172,7 +217,7 @@ index cc735931f97b..00669cf678fb 100644 value, &retval); sysfs_notify(&asus->platform_device->dev.kobj, NULL, -@@ -3689,7 +3670,7 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus) +@@ -3654,7 +3635,7 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus) static int throttle_thermal_policy_set_default(struct asus_wmi *asus) { @@ -181,7 +226,7 @@ index cc735931f97b..00669cf678fb 100644 return 0; asus->throttle_thermal_policy_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; -@@ -3701,7 +3682,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) +@@ -3666,7 +3647,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) u8 new_mode = asus->throttle_thermal_policy_mode + 1; int err; @@ -190,7 +235,7 @@ index cc735931f97b..00669cf678fb 100644 new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; asus->throttle_thermal_policy_mode = new_mode; -@@ -3740,7 +3721,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, +@@ -3705,7 +3686,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, if (result < 0) return result; @@ -199,7 +244,7 @@ index cc735931f97b..00669cf678fb 100644 return -EINVAL; asus->throttle_thermal_policy_mode = new_mode; -@@ -3757,10 +3738,52 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, +@@ -3722,10 +3703,52 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, return count; } @@ -253,7 +298,7 @@ index cc735931f97b..00669cf678fb 100644 static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof, enum platform_profile_option *profile) { -@@ -3768,10 +3791,9 @@ static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof, +@@ -3733,10 +3756,9 @@ static int asus_wmi_platform_profile_get(struct platform_profile_handler *pprof, int tp; asus = container_of(pprof, struct asus_wmi, platform_profile_handler); @@ -265,7 +310,7 @@ index cc735931f97b..00669cf678fb 100644 case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT: *profile = PLATFORM_PROFILE_BALANCED; break; -@@ -3810,7 +3832,7 @@ static int asus_wmi_platform_profile_set(struct platform_profile_handler *pprof, +@@ -3775,7 +3797,7 @@ static int asus_wmi_platform_profile_set(struct platform_profile_handler *pprof, return -EOPNOTSUPP; } @@ -274,7 +319,7 @@ index cc735931f97b..00669cf678fb 100644 return throttle_thermal_policy_write(asus); } -@@ -3823,7 +3845,7 @@ static int platform_profile_setup(struct asus_wmi *asus) +@@ -3788,7 +3810,7 @@ static int platform_profile_setup(struct asus_wmi *asus) * Not an error if a component platform_profile relies on is unavailable * so early return, skipping the setup of platform_profile. */ @@ -283,7 +328,7 @@ index cc735931f97b..00669cf678fb 100644 return 0; dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n"); -@@ -4238,7 +4260,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) +@@ -4203,7 +4225,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) if (code == NOTIFY_KBD_FBM || code == NOTIFY_KBD_TTP) { if (asus->fan_boost_mode_available) fan_boost_mode_switch_next(asus); @@ -292,7 +337,7 @@ index cc735931f97b..00669cf678fb 100644 throttle_thermal_policy_switch_next(asus); return; -@@ -4410,7 +4432,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4375,7 +4397,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_fan_boost_mode.attr) ok = asus->fan_boost_mode_available; else if (attr == &dev_attr_throttle_thermal_policy.attr) @@ -301,7 +346,7 @@ index cc735931f97b..00669cf678fb 100644 else if (attr == &dev_attr_ppt_pl2_sppt.attr) devid = ASUS_WMI_DEVID_PPT_PL2_SPPT; else if (attr == &dev_attr_ppt_pl1_spl.attr) -@@ -4702,16 +4724,15 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4667,16 +4689,15 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2)) asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE2; @@ -323,7 +368,7 @@ index cc735931f97b..00669cf678fb 100644 err = platform_profile_setup(asus); if (err) goto fail_platform_profile_setup; -@@ -4806,7 +4827,6 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4771,7 +4792,6 @@ static int asus_wmi_add(struct platform_device *pdev) fail_input: asus_wmi_sysfs_exit(asus->platform_device); fail_sysfs: @@ -332,10 +377,10 @@ index cc735931f97b..00669cf678fb 100644 fail_platform_profile_setup: if (asus->platform_profile_support) diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index 0aeeae1c1943..5e6f407b2def 100644 +index 3eb5cd6773ad..982a637744ec 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -68,6 +68,7 @@ +@@ -64,6 +64,7 @@ #define ASUS_WMI_DEVID_SCREENPAD_LIGHT 0x00050032 #define ASUS_WMI_DEVID_FAN_BOOST_MODE 0x00110018 #define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075 @@ -347,10 +392,10 @@ index 0aeeae1c1943..5e6f407b2def 100644 2.46.0 -From d5f2b2eecfe5af75fec9d7dd774c9c2c87e7afc7 Mon Sep 17 00:00:00 2001 +From 9e0190ae050b5c363016b2c3b8a751e20ee84d80 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Sat, 13 Jul 2024 19:47:33 +1200 -Subject: [PATCH 03/20] hid-asus: use hid for brightness control on keyboard +Subject: [PATCH 04/21] hid-asus: use hid for brightness control on keyboard On almost all ASUS ROG series laptops the MCU used for the USB keyboard also has a HID packet used for setting the brightness. This is usually @@ -393,10 +438,10 @@ index a282388b7aa5..659cf9c96e26 100644 ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value); hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value); diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 00669cf678fb..35ebb37f68bf 100644 +index 7472d1c19fff..5e4f4d0ad4b7 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -1714,7 +1714,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus) +@@ -1691,7 +1691,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus) goto error; } @@ -407,7 +452,7 @@ index 00669cf678fb..35ebb37f68bf 100644 asus->kbd_led.name = "asus::kbd_backlight"; asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index 5e6f407b2def..b601b245a035 100644 +index 982a637744ec..8e7fc84a8f7d 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -4,6 +4,7 @@ @@ -418,7 +463,7 @@ index 5e6f407b2def..b601b245a035 100644 /* WMI Methods */ #define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */ -@@ -165,4 +166,39 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, +@@ -161,4 +162,39 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, } #endif @@ -462,10 +507,10 @@ index 5e6f407b2def..b601b245a035 100644 2.46.0 -From b80da49a638be0420ef5cc3bb3924c443f5bb654 Mon Sep 17 00:00:00 2001 +From bdd68ddd54da5bba3e8f6a87664b3e8a5b9ed734 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Fri, 7 Jun 2024 15:58:01 +1200 -Subject: [PATCH 04/20] Input: xpad - add support for ASUS ROG RAIKIRI PRO +Subject: [PATCH 05/21] 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. @@ -476,7 +521,7 @@ Signed-off-by: Luke D. Jones 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h -index 781c5aa29859..95a13905e4c5 100644 +index 6e3223389080..bb0f2900c573 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -209,6 +209,7 @@ @@ -491,10 +536,10 @@ index 781c5aa29859..95a13905e4c5 100644 2.46.0 -From 443dd6aabb7fb1ebc96b98ec52334eebd626de54 Mon Sep 17 00:00:00 2001 +From cfd71567751d13c7ac84613c0738ee258a61e6ad Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Tue, 21 May 2024 18:17:17 +1200 -Subject: [PATCH 05/20] platform/x86: asus-wmi: add debug print in more key +Subject: [PATCH 06/21] platform/x86: asus-wmi: add debug print in more key places Add more verbose debug print in the WMI method calls. This helps a lot @@ -507,10 +552,10 @@ Signed-off-by: Luke D. Jones 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 35ebb37f68bf..cc5dc296fb2d 100644 +index 5e4f4d0ad4b7..a589fa567be0 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -341,20 +341,29 @@ static int asus_wmi_evaluate_method3(u32 method_id, +@@ -340,20 +340,29 @@ static int asus_wmi_evaluate_method3(u32 method_id, status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id, &input, &output); @@ -542,7 +587,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 return 0; } -@@ -384,20 +393,29 @@ static int asus_wmi_evaluate_method5(u32 method_id, +@@ -383,20 +392,29 @@ static int asus_wmi_evaluate_method5(u32 method_id, status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id, &input, &output); @@ -574,7 +619,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 return 0; } -@@ -423,8 +441,13 @@ static int asus_wmi_evaluate_method_buf(u32 method_id, +@@ -422,8 +440,13 @@ static int asus_wmi_evaluate_method_buf(u32 method_id, status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, 0, method_id, &input, &output); @@ -589,7 +634,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 obj = (union acpi_object *)output.pointer; -@@ -460,8 +483,11 @@ static int asus_wmi_evaluate_method_buf(u32 method_id, +@@ -459,8 +482,11 @@ static int asus_wmi_evaluate_method_buf(u32 method_id, kfree(obj); @@ -602,7 +647,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 return 0; } -@@ -549,6 +575,7 @@ static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id) +@@ -548,6 +574,7 @@ static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id) { u32 retval; int status = asus_wmi_get_devstate(asus, dev_id, &retval); @@ -610,7 +655,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 return status == 0 && (retval & ASUS_WMI_DSTS_PRESENCE_BIT); } -@@ -3604,18 +3631,27 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) +@@ -3569,18 +3596,27 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) err = fan_curve_check_present(asus, &asus->cpu_fan_curve_available, ASUS_WMI_DEVID_CPU_FAN_CURVE); @@ -641,7 +686,7 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 if (!asus->cpu_fan_curve_available && !asus->gpu_fan_curve_available -@@ -4459,8 +4495,10 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4424,8 +4460,10 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_available_mini_led_mode.attr) ok = asus->mini_led_dev_id != 0; @@ -657,10 +702,10 @@ index 35ebb37f68bf..cc5dc296fb2d 100644 2.46.0 -From 78bae34b84a23165b903283e5e1f63e3eb7f8675 Mon Sep 17 00:00:00 2001 +From 278461a58e4ec68d8ab306be704834625d9b0fcf Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Fri, 24 May 2024 10:54:36 +1200 -Subject: [PATCH 06/20] platform/x86: asus-wmi: don't fail if platform_profile +Subject: [PATCH 07/21] platform/x86: asus-wmi: don't fail if platform_profile already registered On some newer laptops it appears that an AMD driver can register a @@ -678,10 +723,10 @@ Signed-off-by: Luke D. Jones 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index cc5dc296fb2d..f15fcb45e1aa 100644 +index a589fa567be0..9f4e708768bb 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -3897,8 +3897,13 @@ static int platform_profile_setup(struct asus_wmi *asus) +@@ -3862,8 +3862,13 @@ static int platform_profile_setup(struct asus_wmi *asus) asus->platform_profile_handler.choices); err = platform_profile_register(&asus->platform_profile_handler); @@ -696,7 +741,7 @@ index cc5dc296fb2d..f15fcb45e1aa 100644 asus->platform_profile_support = true; return 0; -@@ -4773,7 +4778,7 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4738,7 +4743,7 @@ static int asus_wmi_add(struct platform_device *pdev) goto fail_fan_boost_mode; err = platform_profile_setup(asus); @@ -709,10 +754,10 @@ index cc5dc296fb2d..f15fcb45e1aa 100644 2.46.0 -From 2e10a157d7627322f768be8b85005befc586dddf Mon Sep 17 00:00:00 2001 +From b38e156f23bf3b6d947cbb75e08e573ff348f81b Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Thu, 25 Jul 2024 10:05:59 +1200 -Subject: [PATCH 07/20] platform/x86: asus-wmi: Add quirk for ROG Ally X +Subject: [PATCH 08/21] platform/x86: asus-wmi: Add quirk for ROG Ally X The new ROG Ally X functions the same as the previus model so we can use the same method to ensure the MCU USB devices wake and reconnect @@ -728,10 +773,10 @@ Signed-off-by: Luke D. Jones 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index f15fcb45e1aa..153ed763d8f6 100644 +index 9f4e708768bb..1d1a92395324 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -4751,7 +4751,7 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4716,7 +4716,7 @@ static int asus_wmi_add(struct platform_device *pdev) 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->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE) @@ -741,10 +786,10 @@ index f15fcb45e1aa..153ed763d8f6 100644 if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE)) asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index b601b245a035..7decbe2c2ad7 100644 +index 8e7fc84a8f7d..879b272ee667 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -201,4 +201,19 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = { +@@ -197,4 +197,19 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = { { }, }; @@ -768,10 +813,10 @@ index b601b245a035..7decbe2c2ad7 100644 2.46.0 -From b45f926b36c74c47e97e4f1cdb761631be3f24c3 Mon Sep 17 00:00:00 2001 +From e8319865b537f32b91da8bcf0179bbd5ea1e8cb3 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Thu, 30 May 2024 13:20:11 +1200 -Subject: [PATCH 08/20] platform/x86: asus-armoury: move existing tunings to +Subject: [PATCH 09/21] platform/x86: asus-armoury: move existing tunings to asus-armoury module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1775,10 +1820,10 @@ index 000000000000..8a357fb6e071 + +#endif /* _ASUS_BIOSCFG_H_ */ diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 153ed763d8f6..06b61ce4b92e 100644 +index 1d1a92395324..48f584360f27 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -536,12 +536,58 @@ static int asus_wmi_get_devstate(struct asus_wmi *asus, u32 dev_id, u32 *retval) +@@ -535,12 +535,58 @@ static int asus_wmi_get_devstate(struct asus_wmi *asus, u32 dev_id, u32 *retval) return 0; } @@ -1840,10 +1885,10 @@ index 153ed763d8f6..06b61ce4b92e 100644 /* Helper for special devices with magic return codes */ static int asus_wmi_get_devstate_bits(struct asus_wmi *asus, diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index 7decbe2c2ad7..6282b7b31c4f 100644 +index 879b272ee667..1ce3ac82f297 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -72,6 +72,7 @@ +@@ -68,6 +68,7 @@ #define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO 0x00110019 /* Misc */ @@ -1851,7 +1896,7 @@ index 7decbe2c2ad7..6282b7b31c4f 100644 #define ASUS_WMI_DEVID_PANEL_OD 0x00050019 #define ASUS_WMI_DEVID_CAMERA 0x00060013 #define ASUS_WMI_DEVID_LID_FLIP 0x00060062 -@@ -157,8 +158,18 @@ +@@ -153,8 +154,18 @@ #define ASUS_WMI_DSTS_LIGHTBAR_MASK 0x0000000F #if IS_REACHABLE(CONFIG_ASUS_WMI) @@ -1874,10 +1919,10 @@ index 7decbe2c2ad7..6282b7b31c4f 100644 2.46.0 -From 60cf655929c172762467d12dc6be926c83573f5d Mon Sep 17 00:00:00 2001 +From 9e2dcf7117b2540652894b7cc80c36d75ca90b12 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Sun, 2 Jun 2024 14:32:15 +1200 -Subject: [PATCH 09/20] platform/x86: asus-armoury: add dgpu tgp control +Subject: [PATCH 10/21] platform/x86: asus-armoury: add dgpu tgp control Implement the dgpu TGP control under the asus-armoury module using the fw_attributes class. @@ -1987,10 +2032,10 @@ index 8a357fb6e071..1652c44c3c9f 100644 __ATTR_CURRENT_INT_RO(_attrname, _wmi); \ __ATTR_GROUP_ENUM(_attrname, _fsname, "0;1", _dispname) diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index 6282b7b31c4f..90f256068d98 100644 +index 1ce3ac82f297..d449941bf607 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -133,6 +133,9 @@ +@@ -129,6 +129,9 @@ /* dgpu on/off */ #define ASUS_WMI_DEVID_DGPU 0x00090020 @@ -2004,10 +2049,10 @@ index 6282b7b31c4f..90f256068d98 100644 2.46.0 -From 33606da471306a47ac95dbbab436c4d13c4eaaa7 Mon Sep 17 00:00:00 2001 +From ff4212c3a8be67f5d6fd150aacb04b96bfd14b18 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Sun, 2 Jun 2024 14:44:31 +1200 -Subject: [PATCH 10/20] platform/x86: asus-armoury: add apu-mem control support +Subject: [PATCH 11/21] platform/x86: asus-armoury: add apu-mem control support Implement the APU memory size control under the asus-armoury module using the fw_attributes class. @@ -2155,10 +2200,10 @@ index a374d8a30855..7c52355dc820 100644 { &charge_mode_attr_group, ASUS_WMI_DEVID_CHARGE_MODE }, { &boot_sound_attr_group, ASUS_WMI_DEVID_BOOT_SOUND }, diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index 90f256068d98..cdf07764e75d 100644 +index d449941bf607..d9fcb052f2f4 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -135,6 +135,7 @@ +@@ -131,6 +131,7 @@ #define ASUS_WMI_DEVID_DGPU_BASE_TGP 0x00120099 #define ASUS_WMI_DEVID_DGPU_SET_TGP 0x00120098 @@ -2170,10 +2215,10 @@ index 90f256068d98..cdf07764e75d 100644 2.46.0 -From c4d196e25874df48e2cc64d400aa3f4a5a467686 Mon Sep 17 00:00:00 2001 +From 887087d5434abf167e7e9f8b134b9bb57a9b0815 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Sun, 2 Jun 2024 16:21:32 +1200 -Subject: [PATCH 11/20] platform/x86: asus-armoury: add core count control +Subject: [PATCH 12/21] platform/x86: asus-armoury: add core count control Implement Intel core enablement under the asus-armoury module using the fw_attributes class. @@ -2483,10 +2528,10 @@ index 1652c44c3c9f..78c9278b2e75 100644 * ROG PPT attributes need a little different in setup as they * require rog_tunables members. diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h -index cdf07764e75d..f1b81adbfbec 100644 +index d9fcb052f2f4..1f7db1e677a5 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h -@@ -133,6 +133,10 @@ +@@ -129,6 +129,10 @@ /* dgpu on/off */ #define ASUS_WMI_DEVID_DGPU 0x00090020 @@ -2501,10 +2546,10 @@ index cdf07764e75d..f1b81adbfbec 100644 2.46.0 -From 9d1abafe8ecbf8ec479e1723b43e74478592720a Mon Sep 17 00:00:00 2001 +From b9b548928e9093ee7377787fd570c3996abeee39 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Wed, 14 Aug 2024 20:15:14 +1200 -Subject: [PATCH 12/20] Core mask fix +Subject: [PATCH 13/21] Core mask fix --- drivers/platform/x86/asus-armoury.c | 14 ++++++++++---- @@ -2544,10 +2589,10 @@ index 9aec498096a9..8ed5ad9f8c1a 100644 2.46.0 -From dc8efe05538d1f5bcfb491bbacb4e1811e90b4f9 Mon Sep 17 00:00:00 2001 +From efd0d2c2479e6b50269abdcbeb8a37b1f52886ae Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Mon, 3 Jun 2024 12:04:41 +1200 -Subject: [PATCH 13/20] asus-wmi: deprecate bios features +Subject: [PATCH 14/21] asus-wmi: deprecate bios features With the existence of the asus-bioscfg module the attributes no-longer need to live under the /sys/devices/platform/asus-nb-wmi/ path. @@ -2722,10 +2767,10 @@ index d13c4085c228..01f780d53793 100644 tristate "Asus Notebook WMI Driver" depends on ASUS_WMI diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 06b61ce4b92e..de0a90c59d4b 100644 +index 48f584360f27..ecb60b6a71d7 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -276,11 +276,12 @@ struct asus_wmi { +@@ -275,11 +275,12 @@ struct asus_wmi { u8 fan_boost_mode_mask; u8 fan_boost_mode; @@ -2740,7 +2785,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 u32 ppt_pl2_sppt; u32 ppt_pl1_spl; u32 ppt_apu_sppt; -@@ -288,6 +289,9 @@ struct asus_wmi { +@@ -287,6 +288,9 @@ struct asus_wmi { u32 ppt_fppt; u32 nv_dynamic_boost; u32 nv_temp_target; @@ -2750,7 +2795,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 u32 kbd_rgb_dev; bool kbd_rgb_state_available; -@@ -306,9 +310,6 @@ struct asus_wmi { +@@ -305,9 +309,6 @@ struct asus_wmi { // The RSOC controls the maximum charging percentage. bool battery_rsoc_available; @@ -2760,7 +2805,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 struct hotplug_slot hotplug_slot; struct mutex hotplug_lock; struct mutex wmi_lock; -@@ -322,6 +323,15 @@ struct asus_wmi { +@@ -321,6 +322,15 @@ struct asus_wmi { struct asus_wmi_driver *driver; }; @@ -2776,7 +2821,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 /* WMI ************************************************************************/ static int asus_wmi_evaluate_method3(u32 method_id, -@@ -720,6 +730,7 @@ static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus) +@@ -719,6 +729,7 @@ static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus) } /* Charging mode, 1=Barrel, 2=USB ******************************************/ @@ -2784,7 +2829,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t charge_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -730,12 +741,16 @@ static ssize_t charge_mode_show(struct device *dev, +@@ -729,12 +740,16 @@ static ssize_t charge_mode_show(struct device *dev, if (result < 0) return result; @@ -2801,7 +2846,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t dgpu_disable_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -746,6 +761,8 @@ static ssize_t dgpu_disable_show(struct device *dev, +@@ -745,6 +760,8 @@ static ssize_t dgpu_disable_show(struct device *dev, if (result < 0) return result; @@ -2810,7 +2855,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -799,8 +816,10 @@ static ssize_t dgpu_disable_store(struct device *dev, +@@ -798,8 +815,10 @@ static ssize_t dgpu_disable_store(struct device *dev, return count; } static DEVICE_ATTR_RW(dgpu_disable); @@ -2821,7 +2866,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t egpu_enable_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -811,6 +830,8 @@ static ssize_t egpu_enable_show(struct device *dev, +@@ -810,6 +829,8 @@ static ssize_t egpu_enable_show(struct device *dev, if (result < 0) return result; @@ -2830,7 +2875,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -867,8 +888,10 @@ static ssize_t egpu_enable_store(struct device *dev, +@@ -866,8 +887,10 @@ static ssize_t egpu_enable_store(struct device *dev, return count; } static DEVICE_ATTR_RW(egpu_enable); @@ -2841,7 +2886,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t egpu_connected_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -879,12 +902,16 @@ static ssize_t egpu_connected_show(struct device *dev, +@@ -878,12 +901,16 @@ static ssize_t egpu_connected_show(struct device *dev, if (result < 0) return result; @@ -2858,7 +2903,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t gpu_mux_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -895,6 +922,8 @@ static ssize_t gpu_mux_mode_show(struct device *dev, +@@ -894,6 +921,8 @@ static ssize_t gpu_mux_mode_show(struct device *dev, if (result < 0) return result; @@ -2867,7 +2912,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -953,6 +982,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev, +@@ -952,6 +981,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev, return count; } static DEVICE_ATTR_RW(gpu_mux_mode); @@ -2875,7 +2920,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 /* TUF Laptop Keyboard RGB Modes **********************************************/ static ssize_t kbd_rgb_mode_store(struct device *dev, -@@ -1076,6 +1106,7 @@ static const struct attribute_group *kbd_rgb_mode_groups[] = { +@@ -1075,6 +1105,7 @@ static const struct attribute_group *kbd_rgb_mode_groups[] = { }; /* Tunable: PPT: Intel=PL1, AMD=SPPT *****************************************/ @@ -2883,7 +2928,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t ppt_pl2_sppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -@@ -1114,6 +1145,8 @@ static ssize_t ppt_pl2_sppt_show(struct device *dev, +@@ -1113,6 +1144,8 @@ static ssize_t ppt_pl2_sppt_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2892,7 +2937,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->ppt_pl2_sppt); } static DEVICE_ATTR_RW(ppt_pl2_sppt); -@@ -1156,6 +1189,8 @@ static ssize_t ppt_pl1_spl_show(struct device *dev, +@@ -1155,6 +1188,8 @@ static ssize_t ppt_pl1_spl_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2901,7 +2946,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->ppt_pl1_spl); } static DEVICE_ATTR_RW(ppt_pl1_spl); -@@ -1199,6 +1234,8 @@ static ssize_t ppt_fppt_show(struct device *dev, +@@ -1198,6 +1233,8 @@ static ssize_t ppt_fppt_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2910,7 +2955,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->ppt_fppt); } static DEVICE_ATTR_RW(ppt_fppt); -@@ -1242,6 +1279,8 @@ static ssize_t ppt_apu_sppt_show(struct device *dev, +@@ -1241,6 +1278,8 @@ static ssize_t ppt_apu_sppt_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2919,7 +2964,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->ppt_apu_sppt); } static DEVICE_ATTR_RW(ppt_apu_sppt); -@@ -1285,6 +1324,8 @@ static ssize_t ppt_platform_sppt_show(struct device *dev, +@@ -1284,6 +1323,8 @@ static ssize_t ppt_platform_sppt_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2928,7 +2973,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->ppt_platform_sppt); } static DEVICE_ATTR_RW(ppt_platform_sppt); -@@ -1328,6 +1369,8 @@ static ssize_t nv_dynamic_boost_show(struct device *dev, +@@ -1327,6 +1368,8 @@ static ssize_t nv_dynamic_boost_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2937,7 +2982,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%u\n", asus->nv_dynamic_boost); } static DEVICE_ATTR_RW(nv_dynamic_boost); -@@ -1371,11 +1414,15 @@ static ssize_t nv_temp_target_show(struct device *dev, +@@ -1370,11 +1413,15 @@ static ssize_t nv_temp_target_show(struct device *dev, { struct asus_wmi *asus = dev_get_drvdata(dev); @@ -2953,7 +2998,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t mcu_powersave_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -1386,6 +1433,8 @@ static ssize_t mcu_powersave_show(struct device *dev, +@@ -1385,6 +1432,8 @@ static ssize_t mcu_powersave_show(struct device *dev, if (result < 0) return result; @@ -2962,7 +3007,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -1421,6 +1470,7 @@ static ssize_t mcu_powersave_store(struct device *dev, +@@ -1420,6 +1469,7 @@ static ssize_t mcu_powersave_store(struct device *dev, return count; } static DEVICE_ATTR_RW(mcu_powersave); @@ -2970,7 +3015,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 /* Battery ********************************************************************/ -@@ -2284,6 +2334,7 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus) +@@ -2249,6 +2299,7 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus) } /* Panel Overdrive ************************************************************/ @@ -2978,7 +3023,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t panel_od_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -2294,6 +2345,8 @@ static ssize_t panel_od_show(struct device *dev, +@@ -2259,6 +2310,8 @@ static ssize_t panel_od_show(struct device *dev, if (result < 0) return result; @@ -2987,7 +3032,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -2330,9 +2383,10 @@ static ssize_t panel_od_store(struct device *dev, +@@ -2295,9 +2348,10 @@ static ssize_t panel_od_store(struct device *dev, return count; } static DEVICE_ATTR_RW(panel_od); @@ -2999,7 +3044,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t boot_sound_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -2343,6 +2397,8 @@ static ssize_t boot_sound_show(struct device *dev, +@@ -2308,6 +2362,8 @@ static ssize_t boot_sound_show(struct device *dev, if (result < 0) return result; @@ -3008,7 +3053,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", result); } -@@ -2378,8 +2434,10 @@ static ssize_t boot_sound_store(struct device *dev, +@@ -2343,8 +2399,10 @@ static ssize_t boot_sound_store(struct device *dev, return count; } static DEVICE_ATTR_RW(boot_sound); @@ -3019,7 +3064,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t mini_led_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -2410,6 +2468,8 @@ static ssize_t mini_led_mode_show(struct device *dev, +@@ -2375,6 +2433,8 @@ static ssize_t mini_led_mode_show(struct device *dev, } } @@ -3028,7 +3073,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 return sysfs_emit(buf, "%d\n", value); } -@@ -2480,10 +2540,13 @@ static ssize_t available_mini_led_mode_show(struct device *dev, +@@ -2445,10 +2505,13 @@ static ssize_t available_mini_led_mode_show(struct device *dev, return sysfs_emit(buf, "0 1 2\n"); } @@ -3042,7 +3087,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 /* Quirks *********************************************************************/ -@@ -3782,6 +3845,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) +@@ -3747,6 +3810,7 @@ static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) return 0; } @@ -3050,7 +3095,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 static ssize_t throttle_thermal_policy_show(struct device *dev, struct device_attribute *attr, char *buf) { -@@ -3825,6 +3889,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, +@@ -3790,6 +3854,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, * Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent */ static DEVICE_ATTR_RW(throttle_thermal_policy); @@ -3058,7 +3103,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 /* Platform profile ***********************************************************/ static int asus_wmi_platform_profile_to_vivo(struct asus_wmi *asus, int mode) -@@ -4465,27 +4530,29 @@ static struct attribute *platform_attributes[] = { +@@ -4430,27 +4495,29 @@ static struct attribute *platform_attributes[] = { &dev_attr_camera.attr, &dev_attr_cardr.attr, &dev_attr_touchpad.attr, @@ -3106,7 +3151,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 NULL }; -@@ -4507,7 +4574,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4472,7 +4539,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, devid = ASUS_WMI_DEVID_LID_RESUME; else if (attr == &dev_attr_als_enable.attr) devid = ASUS_WMI_DEVID_ALS_ENABLE; @@ -3119,7 +3164,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 devid = ASUS_WMI_DEVID_CHARGE_MODE; else if (attr == &dev_attr_egpu_enable.attr) ok = asus->egpu_enable_available; -@@ -4545,6 +4616,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4510,6 +4581,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, ok = asus->mini_led_dev_id != 0; else if (attr == &dev_attr_available_mini_led_mode.attr) ok = asus->mini_led_dev_id != 0; @@ -3127,7 +3172,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 if (devid != -1) { ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); -@@ -4785,6 +4857,7 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4750,6 +4822,7 @@ static int asus_wmi_add(struct platform_device *pdev) goto fail_platform; /* ensure defaults for tunables */ @@ -3135,7 +3180,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 asus->ppt_pl2_sppt = 5; asus->ppt_pl1_spl = 5; asus->ppt_apu_sppt = 5; -@@ -4796,8 +4869,6 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4761,8 +4834,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->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); @@ -3144,7 +3189,7 @@ index 06b61ce4b92e..de0a90c59d4b 100644 if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE)) asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE; -@@ -4809,16 +4880,20 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4774,16 +4845,20 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO)) asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO; @@ -3174,10 +3219,10 @@ index 06b61ce4b92e..de0a90c59d4b 100644 2.46.0 -From a89ec6ae6ef2538231946204c33ab2c39e95fa9f Mon Sep 17 00:00:00 2001 +From 198b877e172f56f8ac1433cc9e6257cac219759d Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 14 Aug 2024 12:50:25 -0500 -Subject: [PATCH 14/20] acpi/x86: s2idle: add support for screen off and screen +Subject: [PATCH 15/21] acpi/x86: s2idle: add support for screen off and screen on callbacks All the _DSM methods for the LPS0 method are called back to back @@ -3251,10 +3296,10 @@ index 09f8397bae15..19734b297527 100644 2.46.0 -From ce7ce3b37a87bc721e65dcb38e1e6cd625dca9a7 Mon Sep 17 00:00:00 2001 +From 8ba91ef7bce7d0a7a6dce4859a011a556d129d35 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 14 Aug 2024 20:19:09 -0500 -Subject: [PATCH 15/20] drm: Notify the suspend core when displays are changed +Subject: [PATCH 16/21] drm: Notify the suspend core when displays are changed at suspend This allows notifying the BIOS with the LPS0 _DSM for "Screen off" @@ -3308,10 +3353,10 @@ index fb97b51b38f1..d3ef199c58c1 100644 2.46.0 -From 77dc385ecd93db19836bbf98b7509c1f7cabc0c8 Mon Sep 17 00:00:00 2001 +From 62e7f83ac2625d780452e40a99dda3b5424c86ff Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 14 Aug 2024 20:20:13 -0500 -Subject: [PATCH 16/20] acpi/x86: s2idle: Move screen off/on code into +Subject: [PATCH 17/21] acpi/x86: s2idle: Move screen off/on code into dedicated callbacks This lets the DRM core notify on screen events instead of calling @@ -3435,10 +3480,10 @@ index dd0b40b9bbe8..e7f9748937d6 100644 2.46.0 -From f357e56834aff588e577114f8296194266c9b747 Mon Sep 17 00:00:00 2001 +From 6bbeebe25e1f93f0129b257df5f8ce50c8a6ae18 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Sun, 25 Aug 2024 21:21:32 -0500 -Subject: [PATCH 17/20] acpi/x86: s2idle: Add ability to configure wakeup by AC +Subject: [PATCH 18/21] acpi/x86: s2idle: Add ability to configure wakeup by AC adapter changes Normally systems don't wake up from s2idle when the AC adapter has @@ -3529,10 +3574,10 @@ index e7f9748937d6..9f4281c8ff58 100644 return 0; diff --git a/include/linux/acpi.h b/include/linux/acpi.h -index 0687a442fec7..fc46f7d877d7 100644 +index 28c3fb2bef0d..b1f23c0e1ba4 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h -@@ -1115,6 +1115,7 @@ struct acpi_s2idle_dev_ops { +@@ -1104,6 +1104,7 @@ struct acpi_s2idle_dev_ops { void (*prepare)(void); void (*check)(void); void (*restore)(void); @@ -3544,10 +3589,10 @@ index 0687a442fec7..fc46f7d877d7 100644 2.46.0 -From a2941b9b8200db4044977816bfeb49aa26520fad Mon Sep 17 00:00:00 2001 +From 5d9e45d03c9605964e9b58e4275b753176f950e1 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Mon, 26 Aug 2024 12:49:35 +1200 -Subject: [PATCH 18/20] hid-asus-ally: Add full gamepad support +Subject: [PATCH 19/21] hid-asus-ally: Add full gamepad support This driver adds full support of the ASUS ROG Ally gamepad: @@ -3640,7 +3685,7 @@ index 08446c89eff6..ea0dbe9111c4 100644 tristate "Aureal" help diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile -index e40f1ddebbb7..2b2aa8b6f828 100644 +index ce71b53ea6c5..98b346d8f783 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_HID_APPLE) += hid-apple.o @@ -6578,10 +6623,10 @@ index 659cf9c96e26..528c210f9e8c 100644 2.46.0 -From 212b11c65510b2b122483534e881bb07f2bb5ccd Mon Sep 17 00:00:00 2001 +From f1c151030d94f7a19dfb810e5027feef0e2e1988 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Mon, 26 Aug 2024 12:49:10 +1200 -Subject: [PATCH 19/20] platform/x86: asus-wmi: Refactor Ally CSEE quirks +Subject: [PATCH 20/21] platform/x86: asus-wmi: Refactor Ally CSEE quirks Adjust the CSEE quirk call ordering and time delay. Attempts to fix issues where the MCU isn't provided enough time to complete USB device @@ -6589,11 +6634,11 @@ disconnection or reconnection, particularly in powersave mode. Signed-off-by: Luke D. Jones --- - drivers/platform/x86/asus-wmi.c | 153 +++++++++++++++++--------------- - 1 file changed, 79 insertions(+), 74 deletions(-) + drivers/platform/x86/asus-wmi.c | 118 +++++++++++++++++++++----------- + 1 file changed, 79 insertions(+), 39 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index de0a90c59d4b..c692e9dd2a88 100644 +index ecb60b6a71d7..c692e9dd2a88 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -11,8 +11,11 @@ @@ -6619,15 +6664,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL }; -@@ -244,7 +244,6 @@ struct asus_wmi { - struct led_classdev lightbar_led; - int lightbar_led_wk; - struct led_classdev micmute_led; -- struct led_classdev camera_led; - struct workqueue_struct *led_workqueue; - struct work_struct tpd_led_work; - struct work_struct wlan_led_work; -@@ -261,9 +260,6 @@ struct asus_wmi { +@@ -260,9 +260,6 @@ struct asus_wmi { u32 tablet_switch_dev_id; bool tablet_switch_inverted; @@ -6637,7 +6674,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 enum fan_type fan_type; enum fan_type gpu_fan_type; enum fan_type mid_fan_type; -@@ -323,6 +319,9 @@ struct asus_wmi { +@@ -322,6 +319,9 @@ struct asus_wmi { struct asus_wmi_driver *driver; }; @@ -6647,62 +6684,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 #if IS_ENABLED(CONFIG_ASUS_WMI_BIOS) static void asus_wmi_show_deprecated(void) { -@@ -1776,27 +1775,6 @@ static int micmute_led_set(struct led_classdev *led_cdev, - return err < 0 ? err : 0; - } - --static enum led_brightness camera_led_get(struct led_classdev *led_cdev) --{ -- struct asus_wmi *asus; -- u32 result; -- -- asus = container_of(led_cdev, struct asus_wmi, camera_led); -- asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_CAMERA_LED, &result); -- -- return result & ASUS_WMI_DSTS_BRIGHTNESS_MASK; --} -- --static int camera_led_set(struct led_classdev *led_cdev, -- enum led_brightness brightness) --{ -- int state = brightness != LED_OFF; -- int err; -- -- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_CAMERA_LED, state, NULL); -- return err < 0 ? err : 0; --} -- - static void asus_wmi_led_exit(struct asus_wmi *asus) - { - led_classdev_unregister(&asus->kbd_led); -@@ -1804,7 +1782,6 @@ static void asus_wmi_led_exit(struct asus_wmi *asus) - led_classdev_unregister(&asus->wlan_led); - led_classdev_unregister(&asus->lightbar_led); - led_classdev_unregister(&asus->micmute_led); -- led_classdev_unregister(&asus->camera_led); - - if (asus->led_workqueue) - destroy_workqueue(asus->led_workqueue); -@@ -1897,18 +1874,6 @@ static int asus_wmi_led_init(struct asus_wmi *asus) - goto error; - } - -- if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CAMERA_LED)) { -- asus->camera_led.name = "asus::camera"; -- asus->camera_led.max_brightness = 1; -- asus->camera_led.brightness_get = camera_led_get; -- asus->camera_led.brightness_set_blocking = camera_led_set; -- -- rv = led_classdev_register(&asus->platform_device->dev, -- &asus->camera_led); -- if (rv) -- goto error; -- } -- - error: - if (rv) - asus_wmi_led_exit(asus); -@@ -4856,6 +4821,7 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4821,6 +4821,7 @@ static int asus_wmi_add(struct platform_device *pdev) if (err) goto fail_platform; @@ -6710,7 +6692,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 /* ensure defaults for tunables */ #if IS_ENABLED(CONFIG_ASUS_WMI_BIOS) asus->ppt_pl2_sppt = 5; -@@ -4886,9 +4852,6 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4851,9 +4852,6 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO)) asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO; @@ -6720,7 +6702,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE)) asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE; else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2)) -@@ -5063,34 +5026,6 @@ static int asus_hotk_resume(struct device *device) +@@ -5028,34 +5026,6 @@ static int asus_hotk_resume(struct device *device) return 0; } @@ -6755,7 +6737,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 static int asus_hotk_restore(struct device *device) { struct asus_wmi *asus = dev_get_drvdata(device); -@@ -5131,11 +5066,76 @@ static int asus_hotk_restore(struct device *device) +@@ -5096,11 +5066,76 @@ static int asus_hotk_restore(struct device *device) return 0; } @@ -6833,7 +6815,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 .prepare = asus_hotk_prepare, }; -@@ -5145,7 +5145,7 @@ static int asus_wmi_probe(struct platform_device *pdev) +@@ -5110,7 +5145,7 @@ static int asus_wmi_probe(struct platform_device *pdev) { struct platform_driver *pdrv = to_platform_driver(pdev->dev.driver); struct asus_wmi_driver *wdrv = to_asus_wmi_driver(pdrv); @@ -6842,7 +6824,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) { pr_warn("ASUS Management GUID not found\n"); -@@ -5163,6 +5163,10 @@ static int asus_wmi_probe(struct platform_device *pdev) +@@ -5128,6 +5163,10 @@ static int asus_wmi_probe(struct platform_device *pdev) return ret; } @@ -6853,7 +6835,7 @@ index de0a90c59d4b..c692e9dd2a88 100644 return asus_wmi_add(pdev); } -@@ -5195,6 +5199,7 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver); +@@ -5160,6 +5199,7 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver); void asus_wmi_unregister_driver(struct asus_wmi_driver *driver) { @@ -6865,10 +6847,10 @@ index de0a90c59d4b..c692e9dd2a88 100644 2.46.0 -From 283281aec536ae51edbc1ec62ccbc88fa63c7fb8 Mon Sep 17 00:00:00 2001 +From 8d956381b3cb1e75452ac38997ed8d8fa396120d Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Thu, 29 Aug 2024 08:10:01 +1200 -Subject: [PATCH 20/20] Test: use s2idle wake_on_ac +Subject: [PATCH 21/21] Test: use s2idle wake_on_ac --- drivers/platform/x86/asus-wmi.c | 39 +++++---------------------------- @@ -6949,3 +6931,4 @@ index c692e9dd2a88..cd08409da4f9 100644 static const struct dev_pm_ops asus_pm_ops = { -- 2.46.0 +