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
tirimbino
Martin Bouchet 8 years ago
parent 56caa269d2
commit 4bf8a7978e
  1. 5
      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__);

Loading…
Cancel
Save