Skip to content

Commit

Permalink
power: check governor is ondemand
Browse files Browse the repository at this point in the history
  • Loading branch information
Daz Jones committed Feb 17, 2013
1 parent 9d946e6 commit 1af4629
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions power/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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.