diff options
| author | jrior001 <jriordan001@gmail.com> | 2016-12-03 19:12:12 -0500 |
|---|---|---|
| committer | jrior001 <jriordan001@gmail.com> | 2016-12-03 19:37:54 -0500 |
| commit | f414e4404d8d13035b3f00a4accbb252272004e4 (patch) | |
| tree | a0d232e90dd61a7f6d50a12cba390922e7e772bf | |
| parent | 137e6bfd12fb52c81f1a87f779af98e8f9a05a1f (diff) | |
mofd: utilize vendor init to set our governor values
Change-Id: Ic7629605a4ded34410f4908e524d8137162ad685
| -rw-r--r-- | init/init_mofd.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/init/init_mofd.cpp b/init/init_mofd.cpp index f47db7a..495afb3 100644 --- a/init/init_mofd.cpp +++ b/init/init_mofd.cpp @@ -35,6 +35,11 @@ #define SERIAL_OFFSET 0x00 #define SERIAL_LENGTH 17 +/* Cpufreq */ +#define MAX_CPU_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" +#define LOW_CPU "1833000" +#define HIGH_CPU "2333000" + /* Zram */ #define ZRAM_PROP "ro.config.zram" #define MEMINFO_FILE "/proc/meminfo" @@ -175,10 +180,29 @@ static void intel_props() { } +void set_feq_values() +{ + char buf[BUF_SIZE]; + + if(read_file2(MAX_CPU_FREQ, buf, sizeof(buf))) { + if ( strncmp(buf, LOW_CPU, strlen(LOW_CPU)) == 0 ) { + property_set("ro.sys.perf.device.powersave", "1250000"); + property_set("ro.sys.perf.device.touchboost", "500000"); + property_set("ro.sys.perf.device.full", "1833000"); + } else if ( strncmp(buf, HIGH_CPU, strlen(HIGH_CPU)) == 0 ) { + property_set("ro.sys.perf.device.powersave", "1500000"); + property_set("ro.sys.perf.device.touchboost", "1833000"); + property_set("ro.sys.perf.device.full", "2333000"); + } else { + INFO("%s: Failed to get max cpu speed: %s\n", __func__, buf); + } + } +} + void vendor_load_properties() { get_serial(); configure_zram(); intel_props(); - + set_feq_values(); } |
