Commit 4086c75d authored by Gergo Koteles's avatar Gergo Koteles Committed by Hans de Goede

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: default avatarGergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/eb2484f5356786578d820301b714335221524839.1712597199.git.soyer@irl.huReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 822188bf
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment