summaryrefslogtreecommitdiffstats
path: root/power
diff options
context:
space:
mode:
authorZiyann <jaraidaniel@gmail.com>2014-10-07 21:59:14 +0200
committerZiyann <jaraidaniel@gmail.com>2014-11-14 09:05:16 +0100
commit6e32ac8570fb2dab88589f26466ab53e268b5828 (patch)
treed855dc4a6b71d649f8b94f303070b0f7f1026fac /power
parent392ceec578ad4cdf77cee24801f8b588274dbd05 (diff)
downloaddevice_samsung_tuna-6e32ac8570fb2dab88589f26466ab53e268b5828.zip
device_samsung_tuna-6e32ac8570fb2dab88589f26466ab53e268b5828.tar.gz
device_samsung_tuna-6e32ac8570fb2dab88589f26466ab53e268b5828.tar.bz2
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
Diffstat (limited to 'power')
-rw-r--r--power/power_tuna.c25
1 files changed, 10 insertions, 15 deletions
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 <hardware/hardware.h>
#include <hardware/power.h>
-#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;