From afae768fda94e4c1d368410e794420bddbdef62b Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Tue, 16 Mar 2021 18:37:21 +0100 Subject: [PATCH] Add IBS14v5 to perf. profile workaround --- src/clevo_keyboard.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/clevo_keyboard.h b/src/clevo_keyboard.h index df1c815..6733218 100644 --- a/src/clevo_keyboard.h +++ b/src/clevo_keyboard.h @@ -770,6 +770,19 @@ struct tuxedo_keyboard_driver clevo_keyboard_driver_v2 = { .key_map = clevo_keymap, }; +/** + * strstr version of dmi_match + */ +static bool dmi_string_in(enum dmi_field f, const char *str) +{ + const char *info = dmi_get_system_info(f); + + if (info == NULL || str == NULL) + return info == str; + + return strstr(info, str) != NULL; +} + int clevo_keyboard_init(void) { bool performance_profile_set_workaround; @@ -782,6 +795,7 @@ int clevo_keyboard_init(void) performance_profile_set_workaround = false || dmi_match(DMI_BOARD_NAME, "AURA1501") || dmi_match(DMI_BOARD_NAME, "NV4XMB,ME,MZ") + || dmi_string_in(DMI_BOARD_NAME, "L140CU") ; if (performance_profile_set_workaround) { TUXEDO_INFO("Performance profile 'performance' set workaround applied\n");