aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergo Koteles <[email protected]>2024-04-08 19:35:12 +0200
committerHans de Goede <[email protected]>2024-04-15 15:48:35 +0200
commit4086c75d6febf595379c50d64729041f7a521e24 (patch)
treec2f95473a6281a83cfb03f6aeae31484d246e5f1
parent822188bf55e1ae6f5c41272382b2aa5f206bc6ab (diff)
platform/x86: thinkpad_acpi: use platform_profile_cycle()
Some Thinkpads have a 'mode' button that switches between platform profiles. Use the new platform_module_cycle function instead of the existing switch-based one. Signed-off-by: Gergo Koteles <[email protected]> Link: https://lore.kernel.org/r/eb2484f5356786578d820301b714335221524839.1712597199.git.soyer@irl.hu Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 82429e59999d..771aaa7ae4cf 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -11190,23 +11190,8 @@ static void tpacpi_driver_event(const unsigned int hkey_event)
else
dytc_control_amt(!dytc_amt_active);
}
- if (hkey_event == TP_HKEY_EV_PROFILE_TOGGLE) {
- switch (dytc_current_profile) {
- case PLATFORM_PROFILE_LOW_POWER:
- dytc_profile_set(NULL, PLATFORM_PROFILE_BALANCED);
- break;
- case PLATFORM_PROFILE_BALANCED:
- dytc_profile_set(NULL, PLATFORM_PROFILE_PERFORMANCE);
- break;
- case PLATFORM_PROFILE_PERFORMANCE:
- dytc_profile_set(NULL, PLATFORM_PROFILE_LOW_POWER);
- break;
- default:
- pr_warn("Profile HKEY unexpected profile %d", dytc_current_profile);
- }
- /* Notify user space the profile changed */
- platform_profile_notify();
- }
+ if (hkey_event == TP_HKEY_EV_PROFILE_TOGGLE)
+ platform_profile_cycle();
}
static void hotkey_driver_event(const unsigned int scancode)