diff options
author | John Stultz <john.stultz@linaro.org> | 2016-08-18 12:20:40 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2016-08-22 23:24:01 -0700 |
commit | 127e1cc406c82b11c4b2e9e0f7cafc047af9fea1 (patch) | |
tree | 96899c165a4b43f0857e6766215a99089e7a7dcc /power | |
parent | 64b54ca01d3420a70aaeb15304bf08cf285d776a (diff) | |
download | hikey-127e1cc406c82b11c4b2e9e0f7cafc047af9fea1.tar.gz |
power_hikey: Add INTERACTIVE_ prefix to macros specific to the interactive gov
Add INTERACTIVE_ prefix to macros specific to the interactive gov
Change-Id: Iaeb4d563cb0fdf46d815f578c34aec77be2c6d40
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/power_hikey.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/power/power_hikey.c b/power/power_hikey.c index bcfe4735..8ff781c9 100644 --- a/power/power_hikey.c +++ b/power/power_hikey.c @@ -34,9 +34,9 @@ #include <hardware/hardware.h> #include <hardware/power.h> -#define BOOSTPULSE_PATH "/sys/devices/system/cpu/cpufreq/interactive/boostpulse" +#define INTERACTIVE_BOOSTPULSE_PATH "/sys/devices/system/cpu/cpufreq/interactive/boostpulse" +#define INTERACTIVE_IO_IS_BUSY_PATH "/sys/devices/system/cpu/cpufreq/interactive/io_is_busy" #define CPU_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" -#define IO_IS_BUSY_PATH "/sys/devices/system/cpu/cpufreq/interactive/io_is_busy" #define LOW_POWER_MAX_FREQ "729000" #define NORMAL_MAX_FREQ "1200000" #define SVELTE_PROP "ro.boot.svelte" @@ -100,10 +100,12 @@ static void power_init(struct power_module __unused *module) if (is_svelte) { char prop_buffer[PROPERTY_VALUE_MAX]; - int len = property_get(SVELTE_MAX_FREQ_PROP, prop_buffer, LOW_POWER_MAX_FREQ); + int len = property_get(SVELTE_MAX_FREQ_PROP, prop_buffer, + LOW_POWER_MAX_FREQ); max_cpu_freq = strndup(prop_buffer, len); - len = property_get(SVELTE_LOW_POWER_MAX_FREQ_PROP, prop_buffer, LOW_POWER_MAX_FREQ); + len = property_get(SVELTE_LOW_POWER_MAX_FREQ_PROP, prop_buffer, + LOW_POWER_MAX_FREQ); low_power_max_cpu_freq = strndup(prop_buffer, len); } } @@ -117,7 +119,7 @@ static void power_set_interactive(struct power_module __unused *module, int on) */ sysfs_write(CPU_MAX_FREQ_PATH, (!on || low_power_mode) ? low_power_max_cpu_freq : max_cpu_freq); - sysfs_write(IO_IS_BUSY_PATH, on ? "1" : "0"); + sysfs_write(INTERACTIVE_IO_IS_BUSY_PATH, on ? "1" : "0"); ALOGV("power_set_interactive: %d done\n", on); } @@ -127,12 +129,12 @@ static int interactive_boostpulse(struct hikey_power_module *hikey) int len; if (hikey->boostpulse_fd < 0) - hikey->boostpulse_fd = open(BOOSTPULSE_PATH, O_WRONLY); + hikey->boostpulse_fd = open(INTERACTIVE_BOOSTPULSE_PATH, O_WRONLY); if (hikey->boostpulse_fd < 0) { if (!hikey->boostpulse_warned) { strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error opening %s: %s\n", BOOSTPULSE_PATH, + ALOGE("Error opening %s: %s\n", INTERACTIVE_BOOSTPULSE_PATH, buf); hikey->boostpulse_warned = 1; } @@ -143,7 +145,7 @@ static int interactive_boostpulse(struct hikey_power_module *hikey) if (len < 0) { strerror_r(errno, buf, sizeof(buf)); ALOGE("Error writing to %s: %s\n", - BOOSTPULSE_PATH, buf); + INTERACTIVE_BOOSTPULSE_PATH, buf); return -1; } return 0; |