@@ -129,6 +129,7 @@ enum acer_wmi_predator_v4_oc {
129
129
enum acer_wmi_gaming_misc_setting {
130
130
ACER_WMID_MISC_SETTING_OC_1 = 0x0005 ,
131
131
ACER_WMID_MISC_SETTING_OC_2 = 0x0007 ,
132
+ /* Unreliable on some models */
132
133
ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES = 0x000A ,
133
134
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE = 0x000B ,
134
135
};
@@ -794,9 +795,6 @@ static bool platform_profile_support;
794
795
*/
795
796
static int last_non_turbo_profile = INT_MIN ;
796
797
797
- /* The most performant supported profile */
798
- static int acer_predator_v4_max_perf ;
799
-
800
798
enum acer_predator_v4_thermal_profile {
801
799
ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET = 0x00 ,
802
800
ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED = 0x01 ,
@@ -2014,7 +2012,7 @@ acer_predator_v4_platform_profile_set(struct device *dev,
2014
2012
if (err )
2015
2013
return err ;
2016
2014
2017
- if (tp != acer_predator_v4_max_perf )
2015
+ if (tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO )
2018
2016
last_non_turbo_profile = tp ;
2019
2017
2020
2018
return 0 ;
@@ -2023,55 +2021,14 @@ acer_predator_v4_platform_profile_set(struct device *dev,
2023
2021
static int
2024
2022
acer_predator_v4_platform_profile_probe (void * drvdata , unsigned long * choices )
2025
2023
{
2026
- unsigned long supported_profiles ;
2027
- int err ;
2024
+ set_bit (PLATFORM_PROFILE_PERFORMANCE , choices );
2025
+ set_bit (PLATFORM_PROFILE_BALANCED_PERFORMANCE , choices );
2026
+ set_bit (PLATFORM_PROFILE_BALANCED , choices );
2027
+ set_bit (PLATFORM_PROFILE_QUIET , choices );
2028
+ set_bit (PLATFORM_PROFILE_LOW_POWER , choices );
2028
2029
2029
- err = WMID_gaming_get_misc_setting (ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES ,
2030
- (u8 * )& supported_profiles );
2031
- if (err )
2032
- return err ;
2033
-
2034
- /* Iterate through supported profiles in order of increasing performance */
2035
- if (test_bit (ACER_PREDATOR_V4_THERMAL_PROFILE_ECO , & supported_profiles )) {
2036
- set_bit (PLATFORM_PROFILE_LOW_POWER , choices );
2037
- acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO ;
2038
- last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO ;
2039
- }
2040
-
2041
- if (test_bit (ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET , & supported_profiles )) {
2042
- set_bit (PLATFORM_PROFILE_QUIET , choices );
2043
- acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET ;
2044
- last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET ;
2045
- }
2046
-
2047
- if (test_bit (ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED , & supported_profiles )) {
2048
- set_bit (PLATFORM_PROFILE_BALANCED , choices );
2049
- acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED ;
2050
- last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED ;
2051
- }
2052
-
2053
- if (test_bit (ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE , & supported_profiles )) {
2054
- set_bit (PLATFORM_PROFILE_BALANCED_PERFORMANCE , choices );
2055
- acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE ;
2056
-
2057
- /* We only use this profile as a fallback option in case no prior
2058
- * profile is supported.
2059
- */
2060
- if (last_non_turbo_profile < 0 )
2061
- last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE ;
2062
- }
2063
-
2064
- if (test_bit (ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO , & supported_profiles )) {
2065
- set_bit (PLATFORM_PROFILE_PERFORMANCE , choices );
2066
- acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO ;
2067
-
2068
- /* We need to handle the hypothetical case where only the turbo profile
2069
- * is supported. In this case the turbo toggle will essentially be a
2070
- * no-op.
2071
- */
2072
- if (last_non_turbo_profile < 0 )
2073
- last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO ;
2074
- }
2030
+ /* Set default non-turbo profile */
2031
+ last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED ;
2075
2032
2076
2033
return 0 ;
2077
2034
}
@@ -2108,27 +2065,23 @@ static int acer_thermal_profile_change(void)
2108
2065
if (cycle_gaming_thermal_profile ) {
2109
2066
platform_profile_cycle ();
2110
2067
} else {
2111
- /* Do nothing if no suitable platform profiles where found */
2112
- if (last_non_turbo_profile < 0 )
2113
- return 0 ;
2114
-
2115
2068
err = WMID_gaming_get_misc_setting (
2116
2069
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE , & current_tp );
2117
2070
if (err )
2118
2071
return err ;
2119
2072
2120
- if (current_tp == acer_predator_v4_max_perf )
2073
+ if (current_tp == ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO )
2121
2074
tp = last_non_turbo_profile ;
2122
2075
else
2123
- tp = acer_predator_v4_max_perf ;
2076
+ tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO ;
2124
2077
2125
2078
err = WMID_gaming_set_misc_setting (
2126
2079
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE , tp );
2127
2080
if (err )
2128
2081
return err ;
2129
2082
2130
2083
/* Store last profile for toggle */
2131
- if (current_tp != acer_predator_v4_max_perf )
2084
+ if (current_tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO )
2132
2085
last_non_turbo_profile = current_tp ;
2133
2086
2134
2087
platform_profile_notify (platform_profile_device );
0 commit comments