From 6e32ac8570fb2dab88589f26466ab53e268b5828 Mon Sep 17 00:00:00 2001 From: Ziyann Date: Tue, 7 Oct 2014 21:59:14 +0200 Subject: tuna: PowerHAL: Define constants for CPUfreq paths Same CPUfreq paths are used many times in the code. This patch defines constants for them. Cherry-picked and adjusted for tuna from http://omapzoom.org/?p=device/ti/blaze_tablet.git;a=commit;h=f5ee7ba155978bd9e547c079b521a1a249bdefab Change-Id: I07519ad70a2f243c6fe68b26dc8b409e6223772e --- power/power_tuna.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'power') diff --git a/power/power_tuna.c b/power/power_tuna.c index a544f9a..4562bc1 100644 --- a/power/power_tuna.c +++ b/power/power_tuna.c @@ -25,9 +25,10 @@ #include #include -#define SCALINGMAXFREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" -#define SCREENOFFMAXFREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq" -#define BOOSTPULSE_PATH "/sys/devices/system/cpu/cpufreq/interactive/boostpulse" +#define CPUFREQ_INTERACTIVE "/sys/devices/system/cpu/cpufreq/interactive/" +#define CPUFREQ_CPU0 "/sys/devices/system/cpu/cpu0/cpufreq/" +#define BOOSTPULSE_PATH (CPUFREQ_INTERACTIVE "boostpulse") +#define SCALINGMAXFREQ_PATH (CPUFREQ_CPU0 "scaling_max_freq") #define MAX_BUF_SZ 10 @@ -85,18 +86,12 @@ static void tuna_power_init(struct power_module *module) { struct tuna_power_module *tuna = (struct tuna_power_module *) module; - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/timer_rate", - "20000"); - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/min_sample_time", - "60000"); - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/hispeed_freq", - "700000"); - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/target_loads", - "70 920000:80 1200000:99"); - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load", - "99"); - sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay", - "80000"); + sysfs_write(CPUFREQ_INTERACTIVE "timer_rate", "20000"); + sysfs_write(CPUFREQ_INTERACTIVE "min_sample_time", "60000"); + sysfs_write(CPUFREQ_INTERACTIVE "hispeed_freq", "700000"); + sysfs_write(CPUFREQ_INTERACTIVE "target_loads", "70 920000:80 1200000:99"); + sysfs_write(CPUFREQ_INTERACTIVE "go_hispeed_load", "99"); + sysfs_write(CPUFREQ_INTERACTIVE "above_hispeed_delay", "80000"); ALOGI("Initialized successfully"); tuna->inited = 1; -- cgit v1.1