diff options
author | Luke D. Jones <luke@ljones.dev> | 2022-08-26 02:42:09 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-08-26 11:35:19 +0200 |
commit | 601eb4c8e1500285d1c40eacb1e2da19bf220e12 (patch) | |
tree | 99a16426dff160468391f8a97bb8ffe8ea00c1c5 /drivers/platform/x86/asus-wmi.c | |
parent | platform/x86: asus-wmi: Update tablet_mode_sw module-param help text (diff) | |
download | linux-601eb4c8e1500285d1c40eacb1e2da19bf220e12.tar.xz linux-601eb4c8e1500285d1c40eacb1e2da19bf220e12.zip |
platform/x86: asus-wmi: Modify behaviour of Fn+F5 fan key
Some more recent TUF laptops have both fan_boost and thermal_throttle.
The key code for Fn+F5 is also different and unmapped.
This patch adjusts the asus_wmi_handle_event_code() match to match
for both 0x99 and 0xAE, and run both mode switch functions for
fan_boost and/or thermal_throttle if either are available.
It is required that both are tried, as in some instances the ACPI
set-method for one may not have any code body within it even though
it was returned as supported by the get method.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20220826004210.356534-2-luke@ljones.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 0f9f79f249c7..94e0be80baba 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3063,14 +3063,13 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) return; } - if (asus->fan_boost_mode_available && code == NOTIFY_KBD_FBM) { - fan_boost_mode_switch_next(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) + throttle_thermal_policy_switch_next(asus); return; - } - if (asus->throttle_thermal_policy_available && code == NOTIFY_KBD_TTP) { - throttle_thermal_policy_switch_next(asus); - return; } if (is_display_toggle(code) && asus->driver->quirks->no_display_toggle) |