aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/lib/cpufreq.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/power/cpupower/lib/cpufreq.h')
-rw-r--r--tools/power/cpupower/lib/cpufreq.h54
1 files changed, 31 insertions, 23 deletions
diff --git a/tools/power/cpupower/lib/cpufreq.h b/tools/power/cpupower/lib/cpufreq.h
index 03be906581b5..3aae8e7a0839 100644
--- a/tools/power/cpupower/lib/cpufreq.h
+++ b/tools/power/cpupower/lib/cpufreq.h
@@ -93,9 +93,9 @@ extern unsigned long cpufreq_get_transition_latency(unsigned int cpu);
93 * considerations by cpufreq policy notifiers in the kernel. 93 * considerations by cpufreq policy notifiers in the kernel.
94 */ 94 */
95 95
96extern int cpufreq_get_hardware_limits(unsigned int cpu, 96extern int cpufreq_get_hardware_limits(unsigned int cpu,
97 unsigned long *min, 97 unsigned long *min,
98 unsigned long *max); 98 unsigned long *max);
99 99
100 100
101/* determine CPUfreq driver used 101/* determine CPUfreq driver used
@@ -104,9 +104,9 @@ extern int cpufreq_get_hardware_limits(unsigned int cpu,
104 * to avoid memory leakage, please. 104 * to avoid memory leakage, please.
105 */ 105 */
106 106
107extern char * cpufreq_get_driver(unsigned int cpu); 107extern char *cpufreq_get_driver(unsigned int cpu);
108 108
109extern void cpufreq_put_driver(char * ptr); 109extern void cpufreq_put_driver(char *ptr);
110 110
111 111
112/* determine CPUfreq policy currently used 112/* determine CPUfreq policy currently used
@@ -116,7 +116,7 @@ extern void cpufreq_put_driver(char * ptr);
116 */ 116 */
117 117
118 118
119extern struct cpufreq_policy * cpufreq_get_policy(unsigned int cpu); 119extern struct cpufreq_policy *cpufreq_get_policy(unsigned int cpu);
120 120
121extern void cpufreq_put_policy(struct cpufreq_policy *policy); 121extern void cpufreq_put_policy(struct cpufreq_policy *policy);
122 122
@@ -129,41 +129,47 @@ extern void cpufreq_put_policy(struct cpufreq_policy *policy);
129 */ 129 */
130 130
131 131
132extern struct cpufreq_available_governors * cpufreq_get_available_governors(unsigned int cpu); 132extern struct cpufreq_available_governors
133*cpufreq_get_available_governors(unsigned int cpu);
133 134
134extern void cpufreq_put_available_governors(struct cpufreq_available_governors *first); 135extern void cpufreq_put_available_governors(
136 struct cpufreq_available_governors *first);
135 137
136 138
137/* determine CPU frequency states available 139/* determine CPU frequency states available
138 * 140 *
139 * only present on _some_ ->target() cpufreq drivers. For information purposes 141 * Only present on _some_ ->target() cpufreq drivers. For information purposes
140 * only. Please free allocated memory by calling cpufreq_put_available_frequencies 142 * only. Please free allocated memory by calling
141 * after use. 143 * cpufreq_put_available_frequencies after use.
142 */ 144 */
143 145
144extern struct cpufreq_available_frequencies * cpufreq_get_available_frequencies(unsigned int cpu); 146extern struct cpufreq_available_frequencies
147*cpufreq_get_available_frequencies(unsigned int cpu);
145 148
146extern void cpufreq_put_available_frequencies(struct cpufreq_available_frequencies *first); 149extern void cpufreq_put_available_frequencies(
150 struct cpufreq_available_frequencies *first);
147 151
148 152
149/* determine affected CPUs 153/* determine affected CPUs
150 * 154 *
151 * Remember to call cpufreq_put_affected_cpus when no longer needed 155 * Remember to call cpufreq_put_affected_cpus when no longer needed
152 * to avoid memory leakage, please. 156 * to avoid memory leakage, please.
153 */ 157 */
154 158
155extern struct cpufreq_affected_cpus * cpufreq_get_affected_cpus(unsigned int cpu); 159extern struct cpufreq_affected_cpus *cpufreq_get_affected_cpus(unsigned
160 int cpu);
156 161
157extern void cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *first); 162extern void cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *first);
158 163
159 164
160/* determine related CPUs 165/* determine related CPUs
161 * 166 *
162 * Remember to call cpufreq_put_related_cpus when no longer needed 167 * Remember to call cpufreq_put_related_cpus when no longer needed
163 * to avoid memory leakage, please. 168 * to avoid memory leakage, please.
164 */ 169 */
165 170
166extern struct cpufreq_affected_cpus * cpufreq_get_related_cpus(unsigned int cpu); 171extern struct cpufreq_affected_cpus *cpufreq_get_related_cpus(unsigned
172 int cpu);
167 173
168extern void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *first); 174extern void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *first);
169 175
@@ -173,15 +179,16 @@ extern void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *first);
173 * This is not available in all kernel versions or configurations. 179 * This is not available in all kernel versions or configurations.
174 */ 180 */
175 181
176extern struct cpufreq_stats * cpufreq_get_stats(unsigned int cpu, unsigned long long *total_time); 182extern struct cpufreq_stats *cpufreq_get_stats(unsigned int cpu,
183 unsigned long long *total_time);
177 184
178extern void cpufreq_put_stats(struct cpufreq_stats *stats); 185extern void cpufreq_put_stats(struct cpufreq_stats *stats);
179 186
180extern unsigned long cpufreq_get_transitions(unsigned int cpu); 187extern unsigned long cpufreq_get_transitions(unsigned int cpu);
181 188
182 189
183/* set new cpufreq policy 190/* set new cpufreq policy
184 * 191 *
185 * Tries to set the passed policy as new policy as close as possible, 192 * Tries to set the passed policy as new policy as close as possible,
186 * but results may differ depending e.g. on governors being available. 193 * but results may differ depending e.g. on governors being available.
187 */ 194 */
@@ -189,7 +196,7 @@ extern unsigned long cpufreq_get_transitions(unsigned int cpu);
189extern int cpufreq_set_policy(unsigned int cpu, struct cpufreq_policy *policy); 196extern int cpufreq_set_policy(unsigned int cpu, struct cpufreq_policy *policy);
190 197
191 198
192/* modify a policy by only changing min/max freq or governor 199/* modify a policy by only changing min/max freq or governor
193 * 200 *
194 * Does not check whether result is what was intended. 201 * Does not check whether result is what was intended.
195 */ 202 */
@@ -202,11 +209,12 @@ extern int cpufreq_modify_policy_governor(unsigned int cpu, char *governor);
202/* set a specific frequency 209/* set a specific frequency
203 * 210 *
204 * Does only work if userspace governor can be used and no external 211 * Does only work if userspace governor can be used and no external
205 * interference (other calls to this function or to set/modify_policy) 212 * interference (other calls to this function or to set/modify_policy)
206 * occurs. Also does not work on ->range() cpufreq drivers. 213 * occurs. Also does not work on ->range() cpufreq drivers.
207 */ 214 */
208 215
209extern int cpufreq_set_frequency(unsigned int cpu, unsigned long target_frequency); 216extern int cpufreq_set_frequency(unsigned int cpu,
217 unsigned long target_frequency);
210 218
211#ifdef __cplusplus 219#ifdef __cplusplus
212} 220}