summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/cpufreq-linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/cpufreq-linux.h')
-rw-r--r--firmware/target/hosted/cpufreq-linux.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/firmware/target/hosted/cpufreq-linux.h b/firmware/target/hosted/cpufreq-linux.h
new file mode 100644
index 0000000000..f62e0225dd
--- /dev/null
+++ b/firmware/target/hosted/cpufreq-linux.h
@@ -0,0 +1,58 @@
1/***************************************************************************
2 * __________ __ ___
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2015 by Udo Schläpfer
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 *
20 * Interface for the Linux CPUFreq kernel modul.
21 * See https://www.kernel.org/doc/Documentation/cpu-freq/
22 *
23 ****************************************************************************/
24
25
26#ifndef __CPUFREQ_LINUX_H__
27#define __CPUFREQ_LINUX_H__
28
29
30#include <stdbool.h>
31
32
33/*
34 Get the available governors for cpu.
35 governors Preallocated string for the available governors. On succes this will look like
36 "performance ondemand powersave", each word beeing a governor that can be used with
37 cpufreq_set_governor.
38 governors_size Size of governors.
39 cpu The cpu, starting with 0, for which to get the available governors. CPUFREQ_ALL_CPUS is not
40 supported, you must supply a cpu. See cpucount_linux in cpuinfo-linux.h.
41*/
42void cpufreq_available_governors(char* governors, int governors_size, int cpu);
43
44
45/*
46 Set the cpufreq governor for cpu.
47 governor The governor to set. This must be one of the available governors returned by
48 cpufreq_available_governors.
49 cpu The cpu, starting with 0, for which to set the governor. CPUFREQ_ALL_CPUS to set
50 the governor for all cpus. See cpucount_linux in cpuinfo-linux.h.
51*/
52void cpufreq_set_governor(const char* governor, int cpu);
53
54
55static const int CPUFREQ_ALL_CPUS = -1;
56
57
58#endif