diff options
author | Martin Bouchet <tincho5588@gmail.com> | 2017-03-28 04:00:04 -0300 |
---|---|---|
committer | Martin Bouchet <tincho5588@gmail.com> | 2017-03-28 19:28:29 +0000 |
commit | 4bf8a7978e4291eb59cd85ef9da7fe48c5dad6a7 (patch) | |
tree | 27e6f2823b9a10b57cb667571bb07c5616d00949 | |
parent | 56caa269d2fff5977724c486f7059d1cc11e0be7 (diff) | |
download | android_hardware_samsung-4bf8a7978e4291eb59cd85ef9da7fe48c5dad6a7.tar.gz android_hardware_samsung-4bf8a7978e4291eb59cd85ef9da7fe48c5dad6a7.tar.bz2 android_hardware_samsung-4bf8a7978e4291eb59cd85ef9da7fe48c5dad6a7.zip |
PowerHAL: Update the hispeed_freq value before using it
The hispeed_freq value is read only in the inizialization process.
If we decide to change it later writing a new value to the node
this new value wont be taken into consideration by the power hal.
Lets update the hispeed_freq value in the power hal before using
it to limit the max cpu freq when we go into power save mode.
Change-Id: I4b8c7f67259750b2931b18c3871874022aa6054d
-rw-r--r-- | power/power.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/power/power.c b/power/power.c index e737892..bcc40f6 100644 --- a/power/power.c +++ b/power/power.c @@ -192,10 +192,15 @@ static void set_power_profile(struct samsung_power_module *samsung_pwr, switch (profile) { case PROFILE_POWER_SAVE: + // Grab value set by init.*.rc + sysfs_read(CPU0_HISPEED_FREQ_PATH, samsung_pwr->cpu0_hispeed_freq, + sizeof(samsung_pwr->cpu0_hispeed_freq)); // Limit to hispeed freq sysfs_write(CPU0_MAX_FREQ_PATH, samsung_pwr->cpu0_hispeed_freq); rc = stat(CPU4_MAX_FREQ_PATH, &sb); if (rc == 0) { + sysfs_read(CPU4_HISPEED_FREQ_PATH, samsung_pwr->cpu4_hispeed_freq, + sizeof(samsung_pwr->cpu4_hispeed_freq)); sysfs_write(CPU4_MAX_FREQ_PATH, samsung_pwr->cpu4_hispeed_freq); } ALOGV("%s: set powersave mode", __func__); |