diff options
-rw-r--r-- | power/power_tuna.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/power/power_tuna.c b/power/power_tuna.c index bc996cb..c5852d7 100644 --- a/power/power_tuna.c +++ b/power/power_tuna.c @@ -137,7 +137,13 @@ static void tuna_power_set_interactive(struct power_module *module, int on) /* read the current scaling max freq and save it before updating */ len = sysfs_read(SCALINGMAXFREQ_PATH, buf, sizeof(buf)); - if (len != -1) + /* make sure it's not the screen off freq, if the "on" + * call is skipped (can happen if you press the power + * button repeatedly) we might have read it. We should + * skip it if that's the case + */ + if (len != -1 && strncmp(buf, screen_off_max_freq, + strlen(screen_off_max_freq)) != 0) memcpy(scaling_max_freq, buf, sizeof(buf)); sysfs_write("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", |