static void power_init(struct power_module *module) { ALOGI("Simple PowerHAL is alive!."); property_get(LOW_MIN_CPUS, low_min_cpus, "0"); ALOGI("LOW_MIN_CPUS: %s", low_min_cpus); property_get(LOW_MAX_CPUS, low_max_cpus, "0"); ALOGI("LOW_MAX_CPUS: %s", low_max_cpus); property_get(LOW_POWER_BALANCE_LEVEL, low_balance, "0"); ALOGI("LOW_POWER_BALANCE_LEVEL: %s", low_balance); property_get(LOW_POWER_UP_THRESHOLD, low_up, "0"); ALOGI("LOW_POWER_UP_THRESHOLD: %s", low_up); property_get(LOW_POWER_DOWN_THRESHOLD, low_down, "0"); ALOGI("LOW_POWER_DOWN_THRESHOLD: %s", low_down); property_get(NORMAL_MIN_CPUS, normal_min_cpus, "0"); ALOGI("NORMAL_MIN_CPUS: %s", normal_min_cpus); property_get(NORMAL_MAX_CPUS, normal_max_cpus, "0"); ALOGI("NORMAL_MAX_CPUS: %s", normal_max_cpus); property_get(NORMAL_POWER_BALANCE_LEVEL, normal_balance, "0"); ALOGI("NORMAL_POWER_BALANCE_LEVEL: %s", normal_balance); property_get(NORMAL_POWER_UP_THRESHOLD, normal_up, "0"); ALOGI("NORMAL_POWER_UP_THRESHOLD: %s", normal_up); property_get(NORMAL_POWER_DOWN_THRESHOLD, normal_down, "0"); ALOGI("NORMAL_POWER_DOWN_THRESHOLD: %s", normal_down); // init thermal maximum prior to setting normal power profile sysfs_write(CPUQUIET_THERMAL_CPUS, normal_max_cpus); set_normal_power(); }
static void set_interactive(struct power_module *module, int on) { // set interactive means change governor, cpufreqs etc // for when device is awake and ready to be used. if (!on) { ALOGI("Device is asleep."); set_low_power(); } else { ALOGI("Device is awake."); set_normal_power(); } }
static void power_hint(struct power_module *module, power_hint_t hint, void *data) { switch (hint) { case POWER_HINT_VSYNC: break; case POWER_HINT_INTERACTION: // When touching the screen, pressing buttons etc. break; case POWER_HINT_LOW_POWER: // When we want to save battery. if (data) { set_low_power(); } else { set_normal_power(); } break; default: break; } }
static void power_init(struct power_module *module) { ALOGI("Simple PowerHAL is alive!."); set_normal_power(); }