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
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 @@
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__);