1
2
3
4
5
6
7
8 #ifndef __CPUPOWER_CPUFREQ_H__
9 #define __CPUPOWER_CPUFREQ_H__
10
11 struct cpufreq_policy {
12 unsigned long min;
13 unsigned long max;
14 char *governor;
15 };
16
17 struct cpufreq_available_governors {
18 char *governor;
19 struct cpufreq_available_governors *next;
20 struct cpufreq_available_governors *first;
21 };
22
23 struct cpufreq_available_frequencies {
24 unsigned long frequency;
25 struct cpufreq_available_frequencies *next;
26 struct cpufreq_available_frequencies *first;
27 };
28
29
30 struct cpufreq_affected_cpus {
31 unsigned int cpu;
32 struct cpufreq_affected_cpus *next;
33 struct cpufreq_affected_cpus *first;
34 };
35
36 struct cpufreq_stats {
37 unsigned long frequency;
38 unsigned long long time_in_state;
39 struct cpufreq_stats *next;
40 struct cpufreq_stats *first;
41 };
42
43
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49
50
51
52
53
54
55
56
57 unsigned long cpufreq_get_freq_kernel(unsigned int cpu);
58
59 unsigned long cpufreq_get_freq_hardware(unsigned int cpu);
60
61 #define cpufreq_get(cpu) cpufreq_get_freq_kernel(cpu);
62
63
64
65
66
67
68 unsigned long cpufreq_get_transition_latency(unsigned int cpu);
69
70
71
72
73
74
75
76
77 int cpufreq_get_hardware_limits(unsigned int cpu,
78 unsigned long *min,
79 unsigned long *max);
80
81
82
83
84
85
86
87
88 char *cpufreq_get_driver(unsigned int cpu);
89
90 void cpufreq_put_driver(char *ptr);
91
92
93
94
95
96
97
98
99
100 struct cpufreq_policy *cpufreq_get_policy(unsigned int cpu);
101
102 void cpufreq_put_policy(struct cpufreq_policy *policy);
103
104
105
106
107
108
109
110
111
112
113 struct cpufreq_available_governors
114 *cpufreq_get_available_governors(unsigned int cpu);
115
116 void cpufreq_put_available_governors(
117 struct cpufreq_available_governors *first);
118
119
120
121
122
123
124
125
126
127 struct cpufreq_available_frequencies
128 *cpufreq_get_available_frequencies(unsigned int cpu);
129
130 void cpufreq_put_available_frequencies(
131 struct cpufreq_available_frequencies *first);
132
133 struct cpufreq_available_frequencies
134 *cpufreq_get_boost_frequencies(unsigned int cpu);
135
136 void cpufreq_put_boost_frequencies(
137 struct cpufreq_available_frequencies *first);
138
139
140
141
142
143
144
145
146 struct cpufreq_affected_cpus *cpufreq_get_affected_cpus(unsigned
147 int cpu);
148
149 void cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *first);
150
151
152
153
154
155
156
157
158 struct cpufreq_affected_cpus *cpufreq_get_related_cpus(unsigned
159 int cpu);
160
161 void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *first);
162
163
164
165
166
167
168
169 struct cpufreq_stats *cpufreq_get_stats(unsigned int cpu,
170 unsigned long long *total_time);
171
172 void cpufreq_put_stats(struct cpufreq_stats *stats);
173
174 unsigned long cpufreq_get_transitions(unsigned int cpu);
175
176
177
178
179
180
181
182
183 int cpufreq_set_policy(unsigned int cpu, struct cpufreq_policy *policy);
184
185
186
187
188
189
190
191 int cpufreq_modify_policy_min(unsigned int cpu, unsigned long min_freq);
192 int cpufreq_modify_policy_max(unsigned int cpu, unsigned long max_freq);
193 int cpufreq_modify_policy_governor(unsigned int cpu, char *governor);
194
195
196
197
198
199
200
201
202
203 int cpufreq_set_frequency(unsigned int cpu,
204 unsigned long target_frequency);
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210 #endif