diff options
author | Taijian | 2024-04-18 11:44:21 +0200 |
---|---|---|
committer | Taijian | 2024-04-18 11:44:21 +0200 |
commit | 2ffb1a70f45b6d9824aef8d0f590ac3a4883bbcc (patch) | |
tree | 398634f6fe7f2b62250b1a205e1651853c81ed01 | |
parent | e728b239612f70609e26b0ccd8fd5851cbda7af8 (diff) | |
download | aur-2ffb1a70f45b6d9824aef8d0f590ac3a4883bbcc.tar.gz |
update upstream patches
-rw-r--r-- | .SRCINFO | 40 | ||||
-rw-r--r-- | 0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch | 266 | ||||
-rw-r--r-- | 0001-v4-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch (renamed from 0001-v2-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch) | 110 | ||||
-rw-r--r-- | 0002-v4-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch (renamed from 0002-v2-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch) | 40 | ||||
-rw-r--r-- | 0003-v4-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch (renamed from 0003-v2-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch) | 34 | ||||
-rw-r--r-- | 0004-v4-platform-x86-asus-wmi-support-toggling-POST-sound.patch (renamed from 0004-v2-platform-x86-asus-wmi-support-toggling-POST-sound.patch) | 20 | ||||
-rw-r--r-- | 0005-v4-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch (renamed from 0005-v2-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch) | 45 | ||||
-rw-r--r-- | 0006-v4-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch (renamed from 0006-v2-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch) | 25 | ||||
-rw-r--r-- | 0007-v4-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch (renamed from 0007-v2-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch) | 17 | ||||
-rw-r--r-- | 0008-v4-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch (renamed from 0008-v2-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch) | 30 | ||||
-rw-r--r-- | 0009-v4-platform-x86-asus-wmi-add-clean-up-structs.patch (renamed from 0009-v2-platform-x86-asus-wmi-add-clean-up-structs.patch) | 23 | ||||
-rw-r--r-- | PKGBUILD | 43 |
12 files changed, 493 insertions, 200 deletions
@@ -1,7 +1,7 @@ pkgbase = linux-g14 pkgdesc = Linux-g14 pkgver = 6.8.7.arch1 - pkgrel = 1 + pkgrel = 2 url = https://gitlab.com/dragonn/linux-g14.git arch = x86_64 license = GPL-2.0-only @@ -36,16 +36,17 @@ pkgbase = linux-g14 source = 0040-workaround_hardware_decoding_amdgpu.patch source = 0001-platform-x86-asus-wmi-Support-2023-ROG-X16-tablet-mo.patch source = amd-tablet-sfh.patch - source = 0001-v2-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch - source = 0002-v2-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch - source = 0003-v2-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch - source = 0004-v2-platform-x86-asus-wmi-support-toggling-POST-sound.patch - source = 0005-v2-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch - source = 0006-v2-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch - source = 0007-v2-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch - source = 0008-v2-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch - source = 0009-v2-platform-x86-asus-wmi-add-clean-up-structs.patch + source = 0001-v4-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch + source = 0002-v4-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch + source = 0003-v4-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch + source = 0004-v4-platform-x86-asus-wmi-support-toggling-POST-sound.patch + source = 0005-v4-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch + source = 0006-v4-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch + source = 0007-v4-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch + source = 0008-v4-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch + source = 0009-v4-platform-x86-asus-wmi-add-clean-up-structs.patch source = 0001-HID-asus-fix-more-n-key-report-descriptors-if-n-key-.patch + source = 0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch source = 0002-HID-asus-make-asus_kbd_init-generic-remove-rog_nkey_.patch source = 0003-HID-asus-add-ROG-Ally-N-Key-ID-and-keycodes.patch source = 0004-HID-asus-add-ROG-Z13-lightbar.patch @@ -73,16 +74,17 @@ pkgbase = linux-g14 sha256sums = e41198b29cee4de7a5132d8df606f48c2d0f9c9076fe4230b00a33c7e0b22c71 sha256sums = 1edb362a762c8858374027e30ff58ae0014e117fdc05cc7db6da50f80e7aab87 sha256sums = 508f90cbe81a9a145cc540703470f1e6b5d21c7a7b9166d2ce6e56b401262b04 - sha256sums = 06375fa2bcc6fefd8d57c0d8a13b5af02d08318f3721c58fc0354970656f3b64 - sha256sums = f64fbf3b7e817edd7267612531d5aba3d17b727d5151b5b9e620d616797cf3da - sha256sums = 270fe67b07e8138be848958e9fa28ee8fecffd2e146ea68444c5200a9b09c2ed - sha256sums = 1b53d1914fb0186585125fcd9db2367697e4c265bfd38378aa0f59cc4e0fb46d - sha256sums = 9a5c4f2cc956933abcb9e1bd652dfad382108dd1f22844d6e5c393861a9ba35d - sha256sums = 951fe0da7b7939665ffc5094a0d39641d4c73395c264237e082d8c54b2927dfb - sha256sums = 66c25f11f3fc2cc0db9a3392400f072f1c3ac9408328128f075a9260f4eb01ef - sha256sums = d31ba415c2b65e3485d74f0268f1020dc49f31a6fe3316cf6c74a0690e96c81f - sha256sums = 47ad6e0781f1df1f6a6d35b8f20c2bf9dbd7e8e0b92a332cb88145755afba77c + sha256sums = feaf5f5fb62e25e2369f92f77e8327dcd4cb4cf4bc6d0c91d9c7bc40c0f4de46 + sha256sums = b9866121c69ce22b4651b3ef2a1956e6d0547e40a14d1224e2f367a4f716ca1a + sha256sums = 6f2f248a5ac9b1a37324cbce8d29a65b22a2b20d4b3564c0dc6063789ae733ba + sha256sums = 28f2b9bf5a1f4993bdc77d4d8ac32c1905edfeb3f4cce476f0f85a31b573bcd0 + sha256sums = fa8de80231c933ca294315168d985ae18261e04e77ef17482c815a0703d6c5fb + sha256sums = 62b297619e500b4453e2f3e0305c4dfb92185f69ebbdb67f99e8f76dad139f7a + sha256sums = c2c89baaf134c0151c3f7a3861d16194e32c91c7abc87f870733cab8c5b88389 + sha256sums = f5b560d988c47033c44307da0b584599d1f59cc0028a594f4df87affffc219d5 + sha256sums = de85da760f6692b284e39aa78479904d6ee78b349f1e98d1d210777f9ef17581 sha256sums = 3be072ed798becd91bae66a75d09235c9cb5e84547b1f4eb7768e954ba109e92 + sha256sums = 93c9a77f6c25494cecbe6b236bd2179065d5f5db5589dabaa425134c1a8c3481 sha256sums = c1d96328d96964c2ce3ef7609fb7c07e97eb136dfab9f6d4efcce072a5739838 sha256sums = 2414dc71174c90b92f975a7d16cabc99ba509397d843132764ea9ee91b643dc0 sha256sums = 107a08aa610d3ba3c7ecec301df2ea8f345bc74107fcf4dac96fe9e89a23dcf1 diff --git a/0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch b/0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch new file mode 100644 index 000000000000..e4e3bf170841 --- /dev/null +++ b/0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch @@ -0,0 +1,266 @@ +From 8cab59d3fb33f17e3b3fa4937c5d4bf0b59e6b12 Mon Sep 17 00:00:00 2001 +From: Mohamed Ghanmi <mohamed.ghanmi@supcom.tn> +Date: Fri, 12 Apr 2024 00:56:39 +0100 +Subject: [PATCH] platform/x86: asus-wmi: add support for vivobook fan profiles + +Add support for vivobook fan profiles wmi call on the ASUS VIVOBOOK +to adjust power limits. + +These fan profiles have a different device id than the ROG series. +and different order. This reorders the existing modes and adds a new +full speed mode available on these laptops. + +As part of keeping the patch clean the throttle_thermal_policy_available +boolean stored in the driver struct is removed and +throttle_thermal_policy_dev is used in place (as on init it is zeroed). + +Signed-off-by: Mohamed Ghanmi <mohamed.ghanmi@supcom.tn> +Co-developed-by: Luke D. Jones <luke@ljones.dev> +Signed-off-by: Luke D. Jones <luke@ljones.dev> +--- + drivers/platform/x86/asus-wmi.c | 100 +++++++++++---------- + include/linux/platform_data/x86/asus-wmi.h | 1 + + 2 files changed, 55 insertions(+), 46 deletions(-) + +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index 2d2b4eca7fd8..439d330fb80b 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -97,6 +97,11 @@ module_param(fnlock_default, bool, 0444); + #define ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST 1 + #define ASUS_THROTTLE_THERMAL_POLICY_SILENT 2 + ++#define ASUS_THROTTLE_THERMAL_POLICY_DEFAULT_VIVO 0 ++#define ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST_VIVO 2 ++#define ASUS_THROTTLE_THERMAL_POLICY_SILENT_VIVO 1 ++#define ASUS_THROTTLE_THERMAL_POLICY_FULLSPEED 3 ++ + #define USB_INTEL_XUSB2PR 0xD0 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 + +@@ -285,8 +290,8 @@ struct asus_wmi { + u32 kbd_rgb_dev; + bool kbd_rgb_state_available; + +- bool throttle_thermal_policy_available; + u8 throttle_thermal_policy_mode; ++ u32 throttle_thermal_policy_dev; + + bool cpu_fan_curve_available; + bool gpu_fan_curve_available; +@@ -3153,7 +3158,7 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) + int err, fan_idx; + u8 mode = 0; + +- if (asus->throttle_thermal_policy_available) ++ if (asus->throttle_thermal_policy_dev) + mode = asus->throttle_thermal_policy_mode; + /* DEVID_<C/G>PU_FAN_CURVE is switched for OVERBOOST vs SILENT */ + if (mode == 2) +@@ -3360,7 +3365,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). + */ +- if (asus->throttle_thermal_policy_available) { ++ if (asus->throttle_thermal_policy_dev) { + err = throttle_thermal_policy_write(asus); + if (err) + return err; +@@ -3577,8 +3582,8 @@ static const struct attribute_group asus_fan_curve_attr_group = { + __ATTRIBUTE_GROUPS(asus_fan_curve_attr); + + /* +- * Must be initialised after throttle_thermal_policy_check_present() as +- * we check the status of throttle_thermal_policy_available during init. ++ * Must be initialised after throttle_thermal_policy_dev is set as ++ * we check the status of throttle_thermal_policy_dev during init. + */ + static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) + { +@@ -3619,38 +3624,31 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus) + } + + /* Throttle thermal policy ****************************************************/ +- +-static int throttle_thermal_policy_check_present(struct asus_wmi *asus) +-{ +- u32 result; +- int err; +- +- asus->throttle_thermal_policy_available = false; +- +- err = asus_wmi_get_devstate(asus, +- ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY, +- &result); +- if (err) { +- if (err == -ENODEV) +- return 0; +- return err; +- } +- +- if (result & ASUS_WMI_DSTS_PRESENCE_BIT) +- asus->throttle_thermal_policy_available = true; +- +- return 0; +-} +- + static int throttle_thermal_policy_write(struct asus_wmi *asus) + { +- int err; +- u8 value; ++ u8 value = asus->throttle_thermal_policy_mode; + u32 retval; ++ bool vivo; ++ int err; + +- value = asus->throttle_thermal_policy_mode; ++ vivo = asus->throttle_thermal_policy_dev == ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO; ++ if (vivo) { ++ switch (value) { ++ case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT: ++ value = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT_VIVO; ++ break; ++ case ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST: ++ value = ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST_VIVO; ++ break; ++ case ASUS_THROTTLE_THERMAL_POLICY_SILENT: ++ value = ASUS_THROTTLE_THERMAL_POLICY_SILENT_VIVO; ++ break; ++ default: ++ break; ++ } ++ } + +- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY, ++ err = asus_wmi_set_devstate(asus->throttle_thermal_policy_dev, + value, &retval); + + sysfs_notify(&asus->platform_device->dev.kobj, NULL, +@@ -3680,7 +3678,7 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus) + + static int throttle_thermal_policy_set_default(struct asus_wmi *asus) + { +- if (!asus->throttle_thermal_policy_available) ++ if (!asus->throttle_thermal_policy_dev) + return 0; + + asus->throttle_thermal_policy_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; +@@ -3690,9 +3688,14 @@ static int throttle_thermal_policy_set_default(struct asus_wmi *asus) + static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) + { + u8 new_mode = asus->throttle_thermal_policy_mode + 1; ++ bool vivo; + int err; + +- if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) ++ vivo = asus->throttle_thermal_policy_dev == ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO; ++ if (!vivo && new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) ++ new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; ++ ++ if (vivo && new_mode > ASUS_THROTTLE_THERMAL_POLICY_FULLSPEED) + new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; + + asus->throttle_thermal_policy_mode = new_mode; +@@ -3725,13 +3728,17 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, + struct asus_wmi *asus = dev_get_drvdata(dev); + u8 new_mode; + int result; ++ bool vivo; + int err; + + result = kstrtou8(buf, 10, &new_mode); + if (result < 0) + return result; + +- if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) ++ vivo = asus->throttle_thermal_policy_dev == ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO; ++ if (vivo && new_mode > ASUS_THROTTLE_THERMAL_POLICY_FULLSPEED) ++ return -EINVAL; ++ else if (!vivo && new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) + return -EINVAL; + + asus->throttle_thermal_policy_mode = new_mode; +@@ -3748,7 +3755,10 @@ static ssize_t throttle_thermal_policy_store(struct device *dev, + return count; + } + +-// Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent ++/* ++ * Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent ++ * VIVOBOOK: 3 - fans full speed ++ */ + static DEVICE_ATTR_RW(throttle_thermal_policy); + + /* Platform profile ***********************************************************/ +@@ -3814,7 +3824,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. + */ +- if (!asus->throttle_thermal_policy_available) ++ if (!asus->throttle_thermal_policy_dev) + return 0; + + dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n"); +@@ -4229,7 +4239,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); +- if (asus->throttle_thermal_policy_available) ++ if (asus->throttle_thermal_policy_dev) + throttle_thermal_policy_switch_next(asus); + return; + +@@ -4401,7 +4411,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) +- ok = asus->throttle_thermal_policy_available; ++ ok = asus->throttle_thermal_policy_dev != 0; + 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) +@@ -4693,16 +4703,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; + ++ if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY)) ++ asus->throttle_thermal_policy_dev = ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY; ++ 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; ++ + err = fan_boost_mode_check_present(asus); + if (err) + goto fail_fan_boost_mode; + +- err = throttle_thermal_policy_check_present(asus); +- if (err) +- goto fail_throttle_thermal_policy; +- else +- throttle_thermal_policy_set_default(asus); +- + err = platform_profile_setup(asus); + if (err) + goto fail_platform_profile_setup; +@@ -4797,7 +4806,6 @@ static int asus_wmi_add(struct platform_device *pdev) + fail_input: + asus_wmi_sysfs_exit(asus->platform_device); + fail_sysfs: +-fail_throttle_thermal_policy: + fail_custom_fan_curve: + 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 3eb5cd6773ad..982a637744ec 100644 +--- a/include/linux/platform_data/x86/asus-wmi.h ++++ b/include/linux/platform_data/x86/asus-wmi.h +@@ -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 ++#define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO 0x00110019 + + /* Misc */ + #define ASUS_WMI_DEVID_PANEL_OD 0x00050019 +-- +2.44.0 + diff --git a/0001-v2-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch b/0001-v4-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch index 3eb7367db05f..cc5026904dd3 100644 --- a/0001-v2-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch +++ b/0001-v4-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch @@ -3,21 +3,22 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 1/9] platform/x86: asus-wmi: add support for 2024 ROG Mini-LED -Date: Tue, 2 Apr 2024 14:34:45 +1300 [thread overview] -Message-ID: <20240402013453.18205-2-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 1/9] platform/x86: asus-wmi: add support for 2024 ROG Mini-LED +Date: Thu, 4 Apr 2024 13:16:44 +1300 [thread overview] +Message-ID: <20240404001652.86207-2-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Support the 2024 mini-led backlight and adjust the related functions to select the relevant dev-id. Also add `available_mini_led_mode` to the platform sysfs since the available mini-led levels can be different. -Signed-off-by: Luke D. Jones <luke@ljones.dev> +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> +signed-off-by: Luke D. Jones <luke@ljones.dev> --- .../ABI/testing/sysfs-platform-asus-wmi | 8 ++ - drivers/platform/x86/asus-wmi.c | 81 ++++++++++++++++--- + drivers/platform/x86/asus-wmi.c | 96 +++++++++++++++++-- include/linux/platform_data/x86/asus-wmi.h | 1 + - 3 files changed, 79 insertions(+), 11 deletions(-) + 3 files changed, 95 insertions(+), 10 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi index 8a7e25bde085..ef1ac1a20a71 100644 @@ -39,10 +40,28 @@ index 8a7e25bde085..ef1ac1a20a71 100644 What: /sys/devices/platform/<platform>/ppt_pl1_spl Date: Jun 2023 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 3f07bbf809ef..646f70c65097 100644 +index 3f07bbf809ef..aa2a3b402e33 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -288,7 +288,7 @@ struct asus_wmi { +@@ -126,6 +126,17 @@ module_param(fnlock_default, bool, 0444); + #define ASUS_SCREENPAD_BRIGHT_MAX 255 + #define ASUS_SCREENPAD_BRIGHT_DEFAULT 60 + ++#define ASUS_MINI_LED_MODE_MASK 0x03 ++/* Standard modes for devices with only on/off */ ++#define ASUS_MINI_LED_OFF 0x00 ++#define ASUS_MINI_LED_ON 0x01 ++/* New mode on some devices, define here to clarify remapping later */ ++#define ASUS_MINI_LED_STRONG_MODE 0x02 ++/* New modes for devices with 3 mini-led mode types */ ++#define ASUS_MINI_LED_2024_WEAK 0x00 ++#define ASUS_MINI_LED_2024_STRONG 0x01 ++#define ASUS_MINI_LED_2024_OFF 0x02 ++ + /* Controls the power state of the USB0 hub on ROG Ally which input is on */ + #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE" + /* 300ms so far seems to produce a reliable result on AC and battery */ +@@ -288,7 +299,7 @@ struct asus_wmi { bool battery_rsoc_available; bool panel_overdrive_available; @@ -51,75 +70,81 @@ index 3f07bbf809ef..646f70c65097 100644 struct hotplug_slot hotplug_slot; struct mutex hotplug_lock; -@@ -2108,13 +2108,30 @@ static ssize_t mini_led_mode_show(struct device *dev, +@@ -2108,13 +2119,33 @@ static ssize_t mini_led_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { struct asus_wmi *asus = dev_get_drvdata(dev); - int result; + u32 value; ++ int err; - result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MINI_LED_MODE); - if (result < 0) - return result; -+ asus_wmi_get_devstate(asus, asus->mini_led_dev_id, &value); -+ value = value & 0x03; // only 3 modes on 2024 version ++ err = asus_wmi_get_devstate(asus, asus->mini_led_dev_id, &value); ++ if (err < 0) ++ return err; ++ value = value & ASUS_MINI_LED_MODE_MASK; - return sysfs_emit(buf, "%d\n", result); -+ /* Remap the mode values to match previous generation mini-led. -+ * Some BIOSes return -19 instead of 2, which is "mini-LED off", this -+ * appears to be a BIOS bug. ++ /* ++ * Remap the mode values to match previous generation mini-led. The last gen ++ * WMI 0 == off, while on this version WMI 2 ==off (flipped). + */ + if (asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE2) { + switch (value) { -+ case 0: -+ value = 1; ++ case ASUS_MINI_LED_2024_WEAK: ++ value = ASUS_MINI_LED_ON; + break; -+ case 1: -+ value = 2; ++ case ASUS_MINI_LED_2024_STRONG: ++ value = ASUS_MINI_LED_STRONG_MODE; ++ break; ++ case ASUS_MINI_LED_2024_OFF: ++ value = ASUS_MINI_LED_OFF; + break; -+ case 2: -+ value = 0; + } -+ } else if (value < 0) { -+ return value; + } ++ + return sysfs_emit(buf, "%d\n", value); } static ssize_t mini_led_mode_store(struct device *dev, -@@ -2130,11 +2147,28 @@ static ssize_t mini_led_mode_store(struct device *dev, +@@ -2130,11 +2161,32 @@ static ssize_t mini_led_mode_store(struct device *dev, if (result) return result; - if (mode > 1) -+ if (mode > 1 && asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE) - return -EINVAL; -+ if (mode > 2 && asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE2) ++ if (asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE && ++ mode > ASUS_MINI_LED_ON) + return -EINVAL; ++ if (asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE2 && ++ mode > ASUS_MINI_LED_STRONG_MODE) + return -EINVAL; + +- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MINI_LED_MODE, mode, &result); + /* + * Remap the mode values so expected behaviour is the same as the last -+ * generation of mini-LED ++ * generation of mini-LED with 0 == off, 1 == on. + */ + if (asus->mini_led_dev_id == ASUS_WMI_DEVID_MINI_LED_MODE2) { + switch (mode) { -+ case 0: -+ mode = 2; ++ case ASUS_MINI_LED_OFF: ++ mode = ASUS_MINI_LED_2024_OFF; + break; -+ case 1: -+ mode = 0; ++ case ASUS_MINI_LED_ON: ++ mode = ASUS_MINI_LED_2024_WEAK; ++ break; ++ case ASUS_MINI_LED_STRONG_MODE: ++ mode = ASUS_MINI_LED_2024_STRONG; + break; -+ case 2: -+ mode = 1; + } + } -- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MINI_LED_MODE, mode, &result); -- + err = asus_wmi_set_devstate(asus->mini_led_dev_id, mode, &result); if (err) { pr_warn("Failed to set mini-LED: %d\n", err); return err; -@@ -2151,6 +2185,23 @@ static ssize_t mini_led_mode_store(struct device *dev, +@@ -2151,6 +2203,23 @@ static ssize_t mini_led_mode_store(struct device *dev, } static DEVICE_ATTR_RW(mini_led_mode); @@ -143,7 +168,7 @@ index 3f07bbf809ef..646f70c65097 100644 /* Quirks *********************************************************************/ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus) -@@ -4139,6 +4190,7 @@ static struct attribute *platform_attributes[] = { +@@ -4139,6 +4208,7 @@ static struct attribute *platform_attributes[] = { &dev_attr_nv_temp_target.attr, &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, @@ -151,7 +176,7 @@ index 3f07bbf809ef..646f70c65097 100644 NULL }; -@@ -4191,7 +4243,9 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4191,7 +4261,9 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_panel_od.attr) ok = asus->panel_overdrive_available; else if (attr == &dev_attr_mini_led_mode.attr) @@ -162,7 +187,7 @@ index 3f07bbf809ef..646f70c65097 100644 if (devid != -1) ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); -@@ -4444,10 +4498,15 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4444,10 +4516,14 @@ static int asus_wmi_add(struct platform_device *pdev) asus->nv_dyn_boost_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_NV_DYN_BOOST); asus->nv_temp_tgt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_NV_THERM_TARGET); asus->panel_overdrive_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PANEL_OD); @@ -170,11 +195,10 @@ index 3f07bbf809ef..646f70c65097 100644 asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE) && dmi_match(DMI_BOARD_NAME, "RC71L"); -+ 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; -+ } else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE2)) { ++ else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE2)) + asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE2; -+ } + err = fan_boost_mode_check_present(asus); if (err) diff --git a/0002-v2-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch b/0002-v4-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch index d7f688ce8c22..276d041715d9 100644 --- a/0002-v2-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch +++ b/0002-v4-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch @@ -3,10 +3,10 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 2/9] platform/x86: asus-wmi: add support for Vivobook GPU MUX -Date: Tue, 2 Apr 2024 14:34:46 +1300 [thread overview] -Message-ID: <20240402013453.18205-3-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 2/9] platform/x86: asus-wmi: add support for Vivobook GPU MUX +Date: Thu, 4 Apr 2024 13:16:45 +1300 [thread overview] +Message-ID: <20240404001652.86207-3-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Add support for the Vivobook dgpu MUX available on the ASUS Viviobook and some of the other ranges (Zen). @@ -15,17 +15,18 @@ This MUX functions exactly the same as the existing ROG MUX support so the existing functionality now detects which MUX is available and uses that for control. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- - drivers/platform/x86/asus-wmi.c | 23 +++++++++++++--------- + drivers/platform/x86/asus-wmi.c | 22 +++++++++++++--------- include/linux/platform_data/x86/asus-wmi.h | 1 + - 2 files changed, 15 insertions(+), 9 deletions(-) + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 646f70c65097..7d7a9c8ee529 100644 +index aa2a3b402e33..1ab4380e9771 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -259,7 +259,7 @@ struct asus_wmi { +@@ -270,7 +270,7 @@ struct asus_wmi { bool egpu_enable_available; bool egpu_connect_available; bool dgpu_disable_available; @@ -34,7 +35,7 @@ index 646f70c65097..7d7a9c8ee529 100644 /* Tunables provided by ASUS for gaming laptops */ bool ppt_pl2_sppt_available; -@@ -682,8 +682,8 @@ static ssize_t dgpu_disable_store(struct device *dev, +@@ -693,8 +693,8 @@ static ssize_t dgpu_disable_store(struct device *dev, if (disable > 1) return -EINVAL; @@ -45,7 +46,7 @@ index 646f70c65097..7d7a9c8ee529 100644 if (result < 0) /* An error here may signal greater failure of GPU handling */ return result; -@@ -748,8 +748,8 @@ static ssize_t egpu_enable_store(struct device *dev, +@@ -759,8 +759,8 @@ static ssize_t egpu_enable_store(struct device *dev, return err; } @@ -56,7 +57,7 @@ index 646f70c65097..7d7a9c8ee529 100644 if (result < 0) { /* An error here may signal greater failure of GPU handling */ pr_warn("Failed to get gpu mux status: %d\n", result); -@@ -802,7 +802,7 @@ static ssize_t gpu_mux_mode_show(struct device *dev, +@@ -813,7 +813,7 @@ static ssize_t gpu_mux_mode_show(struct device *dev, struct asus_wmi *asus = dev_get_drvdata(dev); int result; @@ -65,7 +66,7 @@ index 646f70c65097..7d7a9c8ee529 100644 if (result < 0) return result; -@@ -848,7 +848,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev, +@@ -859,7 +859,7 @@ static ssize_t gpu_mux_mode_store(struct device *dev, } } @@ -74,7 +75,7 @@ index 646f70c65097..7d7a9c8ee529 100644 if (err) { dev_err(dev, "Failed to set GPU MUX mode: %d\n", err); return err; -@@ -4221,7 +4221,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4239,7 +4239,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_dgpu_disable.attr) ok = asus->dgpu_disable_available; else if (attr == &dev_attr_gpu_mux_mode.attr) @@ -83,7 +84,7 @@ index 646f70c65097..7d7a9c8ee529 100644 else if (attr == &dev_attr_fan_boost_mode.attr) ok = asus->fan_boost_mode_available; else if (attr == &dev_attr_throttle_thermal_policy.attr) -@@ -4487,7 +4487,6 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4505,7 +4505,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_connect_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU_CONNECTED); asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU); @@ -91,15 +92,14 @@ index 646f70c65097..7d7a9c8ee529 100644 asus->kbd_rgb_mode_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE); asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE); asus->ppt_pl2_sppt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PPT_PL2_SPPT); -@@ -4507,6 +4506,12 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4524,6 +4523,11 @@ static int asus_wmi_add(struct platform_device *pdev) + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE2)) asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE2; - } -+ if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX)) { ++ if (asus_wmi_dev_is_present(asus, 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; -+ } + err = fan_boost_mode_check_present(asus); if (err) @@ -118,5 +118,3 @@ index 9cadce10ad9a..b48b024dd844 100644 #define ASUS_WMI_DEVID_TUF_RGB_MODE 0x00100056 -- 2.44.0 - - diff --git a/0003-v2-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch b/0003-v4-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch index e735ccdc233d..7e606acbae39 100644 --- a/0003-v2-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch +++ b/0003-v4-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch @@ -3,26 +3,27 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 3/9] platform/x86: asus-wmi: add support variant of TUF RGB -Date: Tue, 2 Apr 2024 14:34:47 +1300 [thread overview] -Message-ID: <20240402013453.18205-4-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 3/9] platform/x86: asus-wmi: add support variant of TUF RGB +Date: Thu, 4 Apr 2024 13:16:46 +1300 [thread overview] +Message-ID: <20240404001652.86207-4-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Adds support for a second TUF RGB wmi call that some versions of the TUF laptop come with. Also adjusts existing support to select whichever is available. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- - drivers/platform/x86/asus-wmi.c | 14 ++++++++++---- + drivers/platform/x86/asus-wmi.c | 13 +++++++++---- include/linux/platform_data/x86/asus-wmi.h | 1 + - 2 files changed, 11 insertions(+), 4 deletions(-) + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 7d7a9c8ee529..fa5735af7675 100644 +index 1ab4380e9771..6896d056d227 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -270,7 +270,7 @@ struct asus_wmi { +@@ -281,7 +281,7 @@ struct asus_wmi { bool nv_dyn_boost_available; bool nv_temp_tgt_available; @@ -31,7 +32,7 @@ index 7d7a9c8ee529..fa5735af7675 100644 bool kbd_rgb_state_available; bool throttle_thermal_policy_available; -@@ -870,6 +870,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, +@@ -881,6 +881,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -39,7 +40,7 @@ index 7d7a9c8ee529..fa5735af7675 100644 u32 cmd, mode, r, g, b, speed; int err; -@@ -906,7 +907,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, +@@ -917,7 +918,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, speed = 0xeb; } @@ -48,7 +49,7 @@ index 7d7a9c8ee529..fa5735af7675 100644 cmd | (mode << 8) | (r << 16) | (g << 24), b | (speed << 8), NULL); if (err) return err; -@@ -1549,7 +1550,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) +@@ -1560,7 +1561,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) { int rv = 0, num_rgb_groups = 0, led_val; @@ -57,7 +58,7 @@ index 7d7a9c8ee529..fa5735af7675 100644 kbd_rgb_mode_groups[num_rgb_groups++] = &kbd_rgb_mode_group; if (asus->kbd_rgb_state_available) kbd_rgb_mode_groups[num_rgb_groups++] = &kbd_rgb_state_group; -@@ -4487,7 +4488,6 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4505,7 +4506,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_connect_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU_CONNECTED); asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU); @@ -65,15 +66,14 @@ index 7d7a9c8ee529..fa5735af7675 100644 asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE); asus->ppt_pl2_sppt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PPT_PL2_SPPT); asus->ppt_pl1_spl_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PPT_PL1_SPL); -@@ -4512,6 +4512,12 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4528,6 +4528,11 @@ 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; - } -+ if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE)) { ++ 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)) { ++ else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2)) + asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE2; -+ } + err = fan_boost_mode_check_present(asus); if (err) diff --git a/0004-v2-platform-x86-asus-wmi-support-toggling-POST-sound.patch b/0004-v4-platform-x86-asus-wmi-support-toggling-POST-sound.patch index e04126fd0802..4f0e085cc36f 100644 --- a/0004-v2-platform-x86-asus-wmi-support-toggling-POST-sound.patch +++ b/0004-v4-platform-x86-asus-wmi-support-toggling-POST-sound.patch @@ -3,13 +3,14 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 4/9] platform/x86: asus-wmi: support toggling POST sound -Date: Tue, 2 Apr 2024 14:34:48 +1300 [thread overview] -Message-ID: <20240402013453.18205-5-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 4/9] platform/x86: asus-wmi: support toggling POST sound +Date: Thu, 4 Apr 2024 13:16:47 +1300 [thread overview] +Message-ID: <20240404001652.86207-5-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Add support for toggling the BIOS POST sound on some ASUS laptops. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- .../ABI/testing/sysfs-platform-asus-wmi | 9 ++++ @@ -18,7 +19,7 @@ Signed-off-by: Luke D. Jones <luke@ljones.dev> 3 files changed, 63 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi -index ef1ac1a20a71..41b92e53e88a 100644 +index ef1ac1a20a71..72933527d2e4 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi @@ -194,3 +194,12 @@ Contact: "Luke Jones" <luke@ljones.dev> @@ -34,12 +35,11 @@ index ef1ac1a20a71..41b92e53e88a 100644 + Set if the BIOS POST sound is played on boot. + * 0 - False, + * 1 - True -\ No newline at end of file diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index fa5735af7675..fcf976967325 100644 +index 6896d056d227..6c353b8e8da9 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -2104,6 +2104,54 @@ static ssize_t panel_od_store(struct device *dev, +@@ -2115,6 +2115,54 @@ static ssize_t panel_od_store(struct device *dev, } static DEVICE_ATTR_RW(panel_od); @@ -94,7 +94,7 @@ index fa5735af7675..fcf976967325 100644 /* Mini-LED mode **************************************************************/ static ssize_t mini_led_mode_show(struct device *dev, struct device_attribute *attr, char *buf) -@@ -4189,6 +4237,7 @@ static struct attribute *platform_attributes[] = { +@@ -4207,6 +4255,7 @@ static struct attribute *platform_attributes[] = { &dev_attr_ppt_platform_sppt.attr, &dev_attr_nv_dynamic_boost.attr, &dev_attr_nv_temp_target.attr, @@ -102,7 +102,7 @@ index fa5735af7675..fcf976967325 100644 &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, &dev_attr_available_mini_led_mode.attr, -@@ -4241,6 +4290,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4259,6 +4308,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, ok = asus->nv_dyn_boost_available; else if (attr == &dev_attr_nv_temp_target.attr) ok = asus->nv_temp_tgt_available; diff --git a/0005-v2-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch b/0005-v4-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch index 61d28d5a4bb1..13552ca342ef 100644 --- a/0005-v2-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch +++ b/0005-v4-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch @@ -3,10 +3,10 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 5/9] platform/x86: asus-wmi: store a min default for ppt options -Date: Tue, 2 Apr 2024 14:34:49 +1300 [thread overview] -Message-ID: <20240402013453.18205-6-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 5/9] platform/x86: asus-wmi: store a min default for ppt options +Date: Thu, 4 Apr 2024 13:16:48 +1300 [thread overview] +Message-ID: <20240404001652.86207-6-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Laptops with any of the ppt or nv tunables default to the minimum setting on boot so we can safely assume a stored value is correct. @@ -16,16 +16,17 @@ reading of those values back. To prevent creating a series of byte holes in the struct the "<name>_available" bool is removed and `asus_sysfs_is_visible()` uses the `ASUS_WMI_DEVID_<name>` directly. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- drivers/platform/x86/asus-wmi.c | 127 +++++++++++++++++++++++++------- 1 file changed, 99 insertions(+), 28 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index fcf976967325..0d304a04e7de 100644 +index 6c353b8e8da9..f13606fc62e6 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -262,13 +262,13 @@ struct asus_wmi { +@@ -273,13 +273,13 @@ struct asus_wmi { u32 gpu_mux_dev; /* Tunables provided by ASUS for gaming laptops */ @@ -46,7 +47,7 @@ index fcf976967325..0d304a04e7de 100644 u32 kbd_rgb_dev; bool kbd_rgb_state_available; -@@ -1020,11 +1020,21 @@ static ssize_t ppt_pl2_sppt_store(struct device *dev, +@@ -1031,11 +1031,21 @@ static ssize_t ppt_pl2_sppt_store(struct device *dev, return -EIO; } @@ -63,13 +64,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->ppt_pl2_sppt); ++ return sysfs_emit(buf, "%u\n", asus->ppt_pl2_sppt); +} +static DEVICE_ATTR_RW(ppt_pl2_sppt); /* Tunable: PPT, Intel=PL1, AMD=SPL ******************************************/ static ssize_t ppt_pl1_spl_store(struct device *dev, -@@ -1054,11 +1064,20 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, +@@ -1065,11 +1075,20 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, return -EIO; } @@ -85,13 +86,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->ppt_pl1_spl); ++ return sysfs_emit(buf, "%u\n", asus->ppt_pl1_spl); +} +static DEVICE_ATTR_RW(ppt_pl1_spl); /* Tunable: PPT APU FPPT ******************************************************/ static ssize_t ppt_fppt_store(struct device *dev, -@@ -1088,11 +1107,21 @@ static ssize_t ppt_fppt_store(struct device *dev, +@@ -1099,11 +1118,21 @@ static ssize_t ppt_fppt_store(struct device *dev, return -EIO; } @@ -108,13 +109,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->ppt_fppt); ++ return sysfs_emit(buf, "%u\n", asus->ppt_fppt); +} +static DEVICE_ATTR_RW(ppt_fppt); /* Tunable: PPT APU SPPT *****************************************************/ static ssize_t ppt_apu_sppt_store(struct device *dev, -@@ -1122,11 +1151,21 @@ static ssize_t ppt_apu_sppt_store(struct device *dev, +@@ -1133,11 +1162,21 @@ static ssize_t ppt_apu_sppt_store(struct device *dev, return -EIO; } @@ -131,13 +132,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->ppt_apu_sppt); ++ return sysfs_emit(buf, "%u\n", asus->ppt_apu_sppt); +} +static DEVICE_ATTR_RW(ppt_apu_sppt); /* Tunable: PPT platform SPPT ************************************************/ static ssize_t ppt_platform_sppt_store(struct device *dev, -@@ -1156,11 +1195,21 @@ static ssize_t ppt_platform_sppt_store(struct device *dev, +@@ -1167,11 +1206,21 @@ static ssize_t ppt_platform_sppt_store(struct device *dev, return -EIO; } @@ -154,13 +155,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->ppt_platform_sppt); ++ return sysfs_emit(buf, "%u\n", asus->ppt_platform_sppt); +} +static DEVICE_ATTR_RW(ppt_platform_sppt); /* Tunable: NVIDIA dynamic boost *********************************************/ static ssize_t nv_dynamic_boost_store(struct device *dev, -@@ -1190,11 +1239,21 @@ static ssize_t nv_dynamic_boost_store(struct device *dev, +@@ -1201,11 +1250,21 @@ static ssize_t nv_dynamic_boost_store(struct device *dev, return -EIO; } @@ -177,13 +178,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->nv_dynamic_boost); ++ return sysfs_emit(buf, "%u\n", asus->nv_dynamic_boost); +} +static DEVICE_ATTR_RW(nv_dynamic_boost); /* Tunable: NVIDIA temperature target ****************************************/ static ssize_t nv_temp_target_store(struct device *dev, -@@ -1224,11 +1283,21 @@ static ssize_t nv_temp_target_store(struct device *dev, +@@ -1235,11 +1294,21 @@ static ssize_t nv_temp_target_store(struct device *dev, return -EIO; } @@ -200,13 +201,13 @@ index fcf976967325..0d304a04e7de 100644 +{ + struct asus_wmi *asus = dev_get_drvdata(dev); + -+ return sysfs_emit(buf, "%d\n", asus->nv_temp_target); ++ return sysfs_emit(buf, "%u\n", asus->nv_temp_target); +} +static DEVICE_ATTR_RW(nv_temp_target); /* Battery ********************************************************************/ -@@ -4277,19 +4346,19 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4295,19 +4364,19 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_throttle_thermal_policy.attr) ok = asus->throttle_thermal_policy_available; else if (attr == &dev_attr_ppt_pl2_sppt.attr) @@ -233,7 +234,7 @@ index fcf976967325..0d304a04e7de 100644 else if (attr == &dev_attr_boot_sound.attr) devid = ASUS_WMI_DEVID_BOOT_SOUND; else if (attr == &dev_attr_panel_od.attr) -@@ -4535,18 +4604,20 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4553,18 +4622,20 @@ static int asus_wmi_add(struct platform_device *pdev) if (err) goto fail_platform; diff --git a/0006-v2-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch b/0006-v4-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch index 93c3e6ece467..0e0dd878a4f2 100644 --- a/0006-v2-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch +++ b/0006-v4-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch @@ -3,24 +3,25 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 6/9] platform/x86: asus-wmi: adjust formatting of ppt-<name>() functions -Date: Tue, 2 Apr 2024 14:34:50 +1300 [thread overview] -Message-ID: <20240402013453.18205-7-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 6/9] platform/x86: asus-wmi: adjust formatting of ppt-<name>() functions +Date: Thu, 4 Apr 2024 13:16:49 +1300 [thread overview] +Message-ID: <20240404001652.86207-7-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Shift the call to dev_get_drvdata() up to top of the function block in all of the ppt_<name>() functions as part of a minor cleanup. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- drivers/platform/x86/asus-wmi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 0d304a04e7de..2ff78e194801 100644 +index f13606fc62e6..976e26c82f80 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -997,11 +997,10 @@ static ssize_t ppt_pl2_sppt_store(struct device *dev, +@@ -1008,11 +1008,10 @@ static ssize_t ppt_pl2_sppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -33,7 +34,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1041,11 +1040,10 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, +@@ -1052,11 +1051,10 @@ static ssize_t ppt_pl1_spl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -46,7 +47,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1084,11 +1082,10 @@ static ssize_t ppt_fppt_store(struct device *dev, +@@ -1095,11 +1093,10 @@ static ssize_t ppt_fppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -59,7 +60,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1128,11 +1125,10 @@ static ssize_t ppt_apu_sppt_store(struct device *dev, +@@ -1139,11 +1136,10 @@ static ssize_t ppt_apu_sppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -72,7 +73,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1172,11 +1168,10 @@ static ssize_t ppt_platform_sppt_store(struct device *dev, +@@ -1183,11 +1179,10 @@ static ssize_t ppt_platform_sppt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -85,7 +86,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1216,11 +1211,10 @@ static ssize_t nv_dynamic_boost_store(struct device *dev, +@@ -1227,11 +1222,10 @@ static ssize_t nv_dynamic_boost_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -98,7 +99,7 @@ index 0d304a04e7de..2ff78e194801 100644 result = kstrtou32(buf, 10, &value); if (result) return result; -@@ -1260,11 +1254,10 @@ static ssize_t nv_temp_target_store(struct device *dev, +@@ -1271,11 +1265,10 @@ static ssize_t nv_temp_target_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { diff --git a/0007-v2-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch b/0007-v4-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch index 555dad2c2d03..684263d500c6 100644 --- a/0007-v2-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch +++ b/0007-v4-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch @@ -3,10 +3,10 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 7/9] platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave -Date: Tue, 2 Apr 2024 14:34:51 +1300 [thread overview] -Message-ID: <20240402013453.18205-8-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 7/9] platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave +Date: Thu, 4 Apr 2024 13:16:50 +1300 [thread overview] +Message-ID: <20240404001652.86207-8-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> The previous work to allow the MCU to be resumed correctly after sleep and resume tried to take the shortest possible time. However as work @@ -24,16 +24,17 @@ to allow a proper disconnect and disable, and the same amount of time on resume is required to prevent a rapid disconnect/reconnect happening on seemingly random occasions. To be safe the time is now 1500ms for msleep. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- drivers/platform/x86/asus-wmi.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index 2ff78e194801..ec249eca0d94 100644 +index 976e26c82f80..ab98f91e573c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -129,7 +129,7 @@ module_param(fnlock_default, bool, 0444); +@@ -140,7 +140,7 @@ module_param(fnlock_default, bool, 0444); /* Controls the power state of the USB0 hub on ROG Ally which input is on */ #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE" /* 300ms so far seems to produce a reliable result on AC and battery */ @@ -42,7 +43,7 @@ index 2ff78e194801..ec249eca0d94 100644 static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL }; -@@ -4814,6 +4814,7 @@ static int asus_hotk_resume_early(struct device *device) +@@ -4829,6 +4829,7 @@ static int asus_hotk_resume_early(struct device *device) struct asus_wmi *asus = dev_get_drvdata(device); if (asus->ally_mcu_usb_switch) { @@ -50,7 +51,7 @@ index 2ff78e194801..ec249eca0d94 100644 if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8))) dev_err(device, "ROG Ally MCU failed to connect USB dev\n"); else -@@ -4825,17 +4826,8 @@ static int asus_hotk_resume_early(struct device *device) +@@ -4840,17 +4841,8 @@ static int asus_hotk_resume_early(struct device *device) static int asus_hotk_prepare(struct device *device) { struct asus_wmi *asus = dev_get_drvdata(device); diff --git a/0008-v2-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch b/0008-v4-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch index 11e0a346f685..7e94b8b6cd60 100644 --- a/0008-v2-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch +++ b/0008-v4-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch @@ -3,32 +3,30 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 8/9] platform/x86: asus-wmi: Add support for MCU powersave -Date: Tue, 2 Apr 2024 14:34:52 +1300 [thread overview] -Message-ID: <20240402013453.18205-9-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 8/9] platform/x86: asus-wmi: Add support for MCU powersave +Date: Thu, 4 Apr 2024 13:16:51 +1300 [thread overview] +Message-ID: <20240404001652.86207-9-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Add support for an MCU powersave WMI call. This is intended to set the MCU in to a low-power mode when sleeping. This mode can cut sleep power use by around half. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- - .../ABI/testing/sysfs-platform-asus-wmi | 11 +++- + .../ABI/testing/sysfs-platform-asus-wmi | 9 ++++ drivers/platform/x86/asus-wmi.c | 50 +++++++++++++++++++ - 2 files changed, 60 insertions(+), 1 deletion(-) + 2 files changed, 59 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi -index 41b92e53e88a..28144371a0f1 100644 +index 72933527d2e4..28144371a0f1 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi -@@ -202,4 +202,13 @@ Contact: "Luke Jones" <luke@ljones.dev> - Description: +@@ -203,3 +203,12 @@ Description: Set if the BIOS POST sound is played on boot. * 0 - False, -- * 1 - True -\ No newline at end of file -+ * 1 - True + * 1 - True + +What: /sys/devices/platform/<platform>/mcu_powersave +Date: Apr 2024 @@ -39,10 +37,10 @@ index 41b92e53e88a..28144371a0f1 100644 + * 0 - False, + * 1 - True diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index ec249eca0d94..a6b648457908 100644 +index ab98f91e573c..d06d9e0c498c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -1292,6 +1292,53 @@ static ssize_t nv_temp_target_show(struct device *dev, +@@ -1303,6 +1303,53 @@ static ssize_t nv_temp_target_show(struct device *dev, } static DEVICE_ATTR_RW(nv_temp_target); @@ -96,7 +94,7 @@ index ec249eca0d94..a6b648457908 100644 /* Battery ********************************************************************/ /* The battery maximum charging percentage */ -@@ -4299,6 +4346,7 @@ static struct attribute *platform_attributes[] = { +@@ -4317,6 +4364,7 @@ static struct attribute *platform_attributes[] = { &dev_attr_ppt_platform_sppt.attr, &dev_attr_nv_dynamic_boost.attr, &dev_attr_nv_temp_target.attr, @@ -104,7 +102,7 @@ index ec249eca0d94..a6b648457908 100644 &dev_attr_boot_sound.attr, &dev_attr_panel_od.attr, &dev_attr_mini_led_mode.attr, -@@ -4352,6 +4400,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4370,6 +4418,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, devid = ASUS_WMI_DEVID_NV_DYN_BOOST; else if (attr == &dev_attr_nv_temp_target.attr) devid = ASUS_WMI_DEVID_NV_THERM_TARGET; diff --git a/0009-v2-platform-x86-asus-wmi-add-clean-up-structs.patch b/0009-v4-platform-x86-asus-wmi-add-clean-up-structs.patch index 6d38151cdf0e..27ea10404d76 100644 --- a/0009-v2-platform-x86-asus-wmi-add-clean-up-structs.patch +++ b/0009-v4-platform-x86-asus-wmi-add-clean-up-structs.patch @@ -3,25 +3,26 @@ To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> -Subject: [PATCH v1 9/9] platform/x86: asus-wmi: cleanup main struct to avoid some holes -Date: Tue, 2 Apr 2024 14:34:53 +1300 [thread overview] -Message-ID: <20240402013453.18205-10-luke@ljones.dev> (raw) -In-Reply-To: <20240402013453.18205-1-luke@ljones.dev> +Subject: [PATCH v4 9/9] platform/x86: asus-wmi: cleanup main struct to avoid some holes +Date: Thu, 4 Apr 2024 13:16:52 +1300 [thread overview] +Message-ID: <20240404001652.86207-10-luke@ljones.dev> (raw) +In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> Reorganises some attr-available calls to remove a few unrequired booleans in the main driver struct which combined with some reorganisation prevents a series of large holes seen with pahole. +Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luke D. Jones <luke@ljones.dev> --- drivers/platform/x86/asus-wmi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index a6b648457908..7163cce7079c 100644 +index d06d9e0c498c..2d2b4eca7fd8 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c -@@ -243,6 +243,9 @@ struct asus_wmi { +@@ -254,6 +254,9 @@ struct asus_wmi { u32 tablet_switch_dev_id; bool tablet_switch_inverted; @@ -31,7 +32,7 @@ index a6b648457908..7163cce7079c 100644 enum fan_type fan_type; enum fan_type gpu_fan_type; enum fan_type mid_fan_type; -@@ -255,9 +258,7 @@ struct asus_wmi { +@@ -266,9 +269,7 @@ struct asus_wmi { u8 fan_boost_mode_mask; u8 fan_boost_mode; @@ -41,7 +42,7 @@ index a6b648457908..7163cce7079c 100644 bool dgpu_disable_available; u32 gpu_mux_dev; -@@ -298,9 +299,6 @@ struct asus_wmi { +@@ -309,9 +310,6 @@ struct asus_wmi { bool fnlock_locked; @@ -51,7 +52,7 @@ index a6b648457908..7163cce7079c 100644 struct asus_wmi_debug debug; struct asus_wmi_driver *driver; -@@ -4373,11 +4371,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4391,11 +4389,11 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_als_enable.attr) devid = ASUS_WMI_DEVID_ALS_ENABLE; else if (attr == &dev_attr_charge_mode.attr) @@ -65,7 +66,7 @@ index a6b648457908..7163cce7079c 100644 else if (attr == &dev_attr_dgpu_disable.attr) ok = asus->dgpu_disable_available; else if (attr == &dev_attr_gpu_mux_mode.attr) -@@ -4405,7 +4403,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, +@@ -4423,7 +4421,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, else if (attr == &dev_attr_boot_sound.attr) devid = ASUS_WMI_DEVID_BOOT_SOUND; else if (attr == &dev_attr_panel_od.attr) @@ -74,7 +75,7 @@ index a6b648457908..7163cce7079c 100644 else if (attr == &dev_attr_mini_led_mode.attr) ok = asus->mini_led_dev_id != 0; else if (attr == &dev_attr_available_mini_led_mode.attr) -@@ -4656,12 +4654,9 @@ static int asus_wmi_add(struct platform_device *pdev) +@@ -4674,12 +4672,9 @@ static int asus_wmi_add(struct platform_device *pdev) asus->nv_dynamic_boost = 5; asus->nv_temp_target = 75; @@ -4,7 +4,7 @@ pkgbase=linux-g14 pkgver=6.8.7.arch1 -pkgrel=1 +pkgrel=2 pkgdesc='Linux-g14' url="https://gitlab.com/dragonn/linux-g14.git" _url='https://github.com/archlinux/linux' @@ -54,19 +54,19 @@ source=( 0001-platform-x86-asus-wmi-Support-2023-ROG-X16-tablet-mo.patch amd-tablet-sfh.patch -# fix_amd_eDP_HDR_flickering.patch - - 0001-v2-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch - 0002-v2-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch - 0003-v2-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch - 0004-v2-platform-x86-asus-wmi-support-toggling-POST-sound.patch - 0005-v2-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch - 0006-v2-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch - 0007-v2-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch - 0008-v2-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch - 0009-v2-platform-x86-asus-wmi-add-clean-up-structs.patch + + 0001-v4-platform-x86-asus-wmi-add-support-for-2024-ROG-Mini-LED.patch + 0002-v4-platform-x86-asus-wmi-add-support-for-Vivobook-GPU-MUX.patch + 0003-v4-platform-x86-asus-wmi-add-support-variant-of-TUF-RGB.patch + 0004-v4-platform-x86-asus-wmi-support-toggling-POST-sound.patch + 0005-v4-platform-x86-asus-wmi-store-a-min-default-for-ppt-op.patch + 0006-v4-platform-x86-asus-wmi-adjust-formatting-of-ppt-fcts.patch + 0007-v4-platform-x86-asus-wmi-ROG-Ally-increase-wait-time.patch + 0008-v4-platform-x86-asus-wmi-add-support-for-MCU-powersave.patch + 0009-v4-platform-x86-asus-wmi-add-clean-up-structs.patch 0001-HID-asus-fix-more-n-key-report-descriptors-if-n-key-.patch + 0001-platform-x86-asus-wmi-add-support-for-vivobook-fan-p.patch 0002-HID-asus-make-asus_kbd_init-generic-remove-rog_nkey_.patch 0003-HID-asus-add-ROG-Ally-N-Key-ID-and-keycodes.patch 0004-HID-asus-add-ROG-Z13-lightbar.patch @@ -101,16 +101,17 @@ sha256sums=('291d1a1faf4e87b3b0ea9729080db887aafd1ff2fac1430ceca921e46bc22fae' 'e41198b29cee4de7a5132d8df606f48c2d0f9c9076fe4230b00a33c7e0b22c71' '1edb362a762c8858374027e30ff58ae0014e117fdc05cc7db6da50f80e7aab87' '508f90cbe81a9a145cc540703470f1e6b5d21c7a7b9166d2ce6e56b401262b04' - '06375fa2bcc6fefd8d57c0d8a13b5af02d08318f3721c58fc0354970656f3b64' - 'f64fbf3b7e817edd7267612531d5aba3d17b727d5151b5b9e620d616797cf3da' - '270fe67b07e8138be848958e9fa28ee8fecffd2e146ea68444c5200a9b09c2ed' - '1b53d1914fb0186585125fcd9db2367697e4c265bfd38378aa0f59cc4e0fb46d' - '9a5c4f2cc956933abcb9e1bd652dfad382108dd1f22844d6e5c393861a9ba35d' - '951fe0da7b7939665ffc5094a0d39641d4c73395c264237e082d8c54b2927dfb' - '66c25f11f3fc2cc0db9a3392400f072f1c3ac9408328128f075a9260f4eb01ef' - 'd31ba415c2b65e3485d74f0268f1020dc49f31a6fe3316cf6c74a0690e96c81f' - '47ad6e0781f1df1f6a6d35b8f20c2bf9dbd7e8e0b92a332cb88145755afba77c' + 'feaf5f5fb62e25e2369f92f77e8327dcd4cb4cf4bc6d0c91d9c7bc40c0f4de46' + 'b9866121c69ce22b4651b3ef2a1956e6d0547e40a14d1224e2f367a4f716ca1a' + '6f2f248a5ac9b1a37324cbce8d29a65b22a2b20d4b3564c0dc6063789ae733ba' + '28f2b9bf5a1f4993bdc77d4d8ac32c1905edfeb3f4cce476f0f85a31b573bcd0' + 'fa8de80231c933ca294315168d985ae18261e04e77ef17482c815a0703d6c5fb' + '62b297619e500b4453e2f3e0305c4dfb92185f69ebbdb67f99e8f76dad139f7a' + 'c2c89baaf134c0151c3f7a3861d16194e32c91c7abc87f870733cab8c5b88389' + 'f5b560d988c47033c44307da0b584599d1f59cc0028a594f4df87affffc219d5' + 'de85da760f6692b284e39aa78479904d6ee78b349f1e98d1d210777f9ef17581' '3be072ed798becd91bae66a75d09235c9cb5e84547b1f4eb7768e954ba109e92' + '93c9a77f6c25494cecbe6b236bd2179065d5f5db5589dabaa425134c1a8c3481' 'c1d96328d96964c2ce3ef7609fb7c07e97eb136dfab9f6d4efcce072a5739838' '2414dc71174c90b92f975a7d16cabc99ba509397d843132764ea9ee91b643dc0' '107a08aa610d3ba3c7ecec301df2ea8f345bc74107fcf4dac96fe9e89a23dcf1' |