summaryrefslogtreecommitdiff
path: root/src/modules/cpufreq
diff options
context:
space:
mode:
authorChidambar Zinnoury <illogict@online.fr>2011-12-28 21:22:41 +0000
committerChidambar Zinnoury <illogict@online.fr>2011-12-28 21:22:41 +0000
commitc64faa47e5eed733109e9bb91472138dddfbe49f (patch)
treefded85e28edc1203ed5f19403b71379bcf032322 /src/modules/cpufreq
parent762b0aa52b4b2ff9d759c703f5a4bbf529edcb86 (diff)
downloadenlightenment-c64faa47e5eed733109e9bb91472138dddfbe49f.tar.gz
e: cpufreq governor settings moved around a lil' bit.
SVN revision: 66614
Diffstat (limited to 'src/modules/cpufreq')
-rw-r--r--src/modules/cpufreq/freqset.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/modules/cpufreq/freqset.c b/src/modules/cpufreq/freqset.c
index fd7a1275c3..ce397634e8 100644
--- a/src/modules/cpufreq/freqset.c
+++ b/src/modules/cpufreq/freqset.c
@@ -10,6 +10,7 @@
#endif
static int sys_cpu_setall(const char *control, const char *value);
+static int sys_cpufreq_set(const char *control, const char *value);
int
main(int argc, char *argv[])
@@ -68,9 +69,9 @@ main(int argc, char *argv[])
return 1;
}
if (!strcmp(argv[2], "ondemand"))
- sys_cpu_setall("ondemand/ignore_nice_load", "0");
+ sys_cpufreq_set("ondemand/ignore_nice_load", "0");
else if (!strcmp(argv[2], "conservative"))
- sys_cpu_setall("conservative/ignore_nice_load", "0");
+ sys_cpufreq_set("conservative/ignore_nice_load", "0");
return 0;
}
else
@@ -106,3 +107,26 @@ sys_cpu_setall(const char *control, const char *value)
}
return -1;
}
+
+static int
+sys_cpufreq_set(const char *control, const char *value)
+{
+ char filename[4096];
+ FILE *f;
+
+ snprintf(filename, sizeof(filename), "/sys/devices/system/cpu/cpufreq/%s", control);
+ f = fopen(filename, "w");
+
+ if (!f)
+ {
+ if (sys_cpu_setall(control, value) > 0)
+ return 1;
+ else
+ return -1;
+ }
+
+ fprintf(f, "%s\n", value);
+ fclose(f);
+
+ return 1;
+}