summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2017-03-12 17:11:04 +0100
committerChristopher N. Hesse <raymanfx@gmail.com>2017-03-18 17:48:13 +0000
commit81f714d57a00ce951dc60c5b9608173873887b27 (patch)
treebb7901c9d9005008af2ae2885a9264e24791996d
parentc9bdb4d5063a352abf1cf4db82bfe8777f16af88 (diff)
downloadandroid_hardware_samsung-81f714d57a00ce951dc60c5b9608173873887b27.tar.gz
android_hardware_samsung-81f714d57a00ce951dc60c5b9608173873887b27.tar.bz2
android_hardware_samsung-81f714d57a00ce951dc60c5b9608173873887b27.zip
power: Rework governor path abstraction
Construct the paths for the driver based on the device specific header data. Change-Id: Ic7c72a2bbe6f199e1297f41817840059595f516d
-rw-r--r--power/include/samsung_power.h12
-rw-r--r--power/power.c9
2 files changed, 13 insertions, 8 deletions
diff --git a/power/include/samsung_power.h b/power/include/samsung_power.h
index 93752df..a33d802 100644
--- a/power/include/samsung_power.h
+++ b/power/include/samsung_power.h
@@ -24,14 +24,10 @@
* symlink to the locations given here, or override this header in your
* device tree.
*/
-#define BOOST_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/boost"
-#define BOOSTPULSE_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse"
-#define IO_IS_BUSY_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy"
-
-#define CPU0_HISPEED_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq"
-#define CPU0_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
-#define CPU4_HISPEED_FREQ_PATH "/sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq"
-#define CPU4_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq"
+#define CPU0_SYSFS_PATH "/sys/devices/system/cpu/cpu0"
+#define CPU4_SYSFS_PATH "/sys/devices/system/cpu/cpu4"
+#define CPU0_INTERACTIVE_PATH "/sys/devices/system/cpu/cpu0/cpufreq/interactive"
+#define CPU4_INTERACTIVE_PATH "/sys/devices/system/cpu/cpu4/cpufreq/interactive"
#endif // SAMSUNG_POWER_H
diff --git a/power/power.c b/power/power.c
index c4b535d..e737892 100644
--- a/power/power.c
+++ b/power/power.c
@@ -40,6 +40,15 @@
#include "samsung_power.h"
+#define BOOST_PATH CPU0_INTERACTIVE_PATH "/boost"
+#define BOOSTPULSE_PATH CPU0_INTERACTIVE_PATH "/boostpulse"
+#define IO_IS_BUSY_PATH CPU0_INTERACTIVE_PATH "/io_is_busy"
+#define CPU0_HISPEED_FREQ_PATH CPU0_INTERACTIVE_PATH "/hispeed_freq"
+#define CPU4_HISPEED_FREQ_PATH CPU4_INTERACTIVE_PATH "/hispeed_freq"
+
+#define CPU0_MAX_FREQ_PATH CPU0_SYSFS_PATH "/cpufreq/scaling_max_freq"
+#define CPU4_MAX_FREQ_PATH CPU4_SYSFS_PATH "/cpufreq/scaling_max_freq"
+
#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
struct samsung_power_module {