Skip to content
Permalink
Browse files

power: check governor is ondemand

  • Loading branch information...
Dazzozo committed Feb 16, 2013
1 parent 9d946e6 commit 1af4629db3ce37226b845c0a24a0b3ebe9d3bbdb
Showing with 11 additions and 4 deletions.
  1. +11 −4 power/power.c
@@ -178,13 +178,21 @@ static void cm_power_hint(struct power_module *module, power_hint_t hint,

static void cm_power_set_interactive(struct power_module *module, int on)
{
sysfs_write(SAMPLING_RATE_ONDEMAND,
on ? SAMPLING_RATE_SCREEN_ON : SAMPLING_RATE_SCREEN_OFF);
char governor[80];
if (strncmp(governor, "ondemand", 8) == 0)
sysfs_write(SAMPLING_RATE_ONDEMAND,
on ? SAMPLING_RATE_SCREEN_ON : SAMPLING_RATE_SCREEN_OFF);
else
ALOGV("Skipping sysfs_write to sampling_rate -- NOT using ondemand");
}

static void cm_power_init(struct power_module *module)
{
sysfs_write(SAMPLING_RATE_ONDEMAND, SAMPLING_RATE_SCREEN_ON);
char governor[80];
if (strncmp(governor, "ondemand", 8) == 0)
sysfs_write(SAMPLING_RATE_ONDEMAND, SAMPLING_RATE_SCREEN_ON);
else
ALOGV("Skipping sysfs_write to sampling_rate -- NOT using ondemand");
}

static struct hw_module_methods_t power_module_methods = {
@@ -211,4 +219,3 @@ struct cm_power_module HAL_MODULE_INFO_SYM = {
boostpulse_fd: -1,
boostpulse_warned: 0,
};

0 comments on commit 1af4629

Please sign in to comment.
You can’t perform that action at this time.