diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpufreq.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 3ec6e7ff5fbd..23932d7741a9 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -32,12 +32,24 @@ | |||
32 | * CPUFREQ NOTIFIER INTERFACE * | 32 | * CPUFREQ NOTIFIER INTERFACE * |
33 | *********************************************************************/ | 33 | *********************************************************************/ |
34 | 34 | ||
35 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | ||
36 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | ||
37 | |||
38 | #define CPUFREQ_TRANSITION_NOTIFIER (0) | 35 | #define CPUFREQ_TRANSITION_NOTIFIER (0) |
39 | #define CPUFREQ_POLICY_NOTIFIER (1) | 36 | #define CPUFREQ_POLICY_NOTIFIER (1) |
40 | 37 | ||
38 | #ifdef CONFIG_CPU_FREQ | ||
39 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | ||
40 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | ||
41 | #else /* CONFIG_CPU_FREQ */ | ||
42 | static inline int cpufreq_register_notifier(struct notifier_block *nb, | ||
43 | unsigned int list) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | static inline int cpufreq_unregister_notifier(struct notifier_block *nb, | ||
48 | unsigned int list) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | #endif /* CONFIG_CPU_FREQ */ | ||
41 | 53 | ||
42 | /* if (cpufreq_driver->target) exists, the ->governor decides what frequency | 54 | /* if (cpufreq_driver->target) exists, the ->governor decides what frequency |
43 | * within the limits is used. If (cpufreq_driver->setpolicy> exists, these | 55 | * within the limits is used. If (cpufreq_driver->setpolicy> exists, these |
@@ -155,6 +167,9 @@ struct cpufreq_governor { | |||
155 | char name[CPUFREQ_NAME_LEN]; | 167 | char name[CPUFREQ_NAME_LEN]; |
156 | int (*governor) (struct cpufreq_policy *policy, | 168 | int (*governor) (struct cpufreq_policy *policy, |
157 | unsigned int event); | 169 | unsigned int event); |
170 | unsigned int max_transition_latency; /* HW must be able to switch to | ||
171 | next freq faster than this value in nano secs or we | ||
172 | will fallback to performance governor */ | ||
158 | struct list_head governor_list; | 173 | struct list_head governor_list; |
159 | struct module *owner; | 174 | struct module *owner; |
160 | }; | 175 | }; |
@@ -279,12 +294,24 @@ static inline unsigned int cpufreq_quick_get(unsigned int cpu) | |||
279 | *********************************************************************/ | 294 | *********************************************************************/ |
280 | 295 | ||
281 | 296 | ||
282 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE | 297 | /* |
298 | Performance governor is fallback governor if any other gov failed to | ||
299 | auto load due latency restrictions | ||
300 | */ | ||
301 | #ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE | ||
283 | extern struct cpufreq_governor cpufreq_gov_performance; | 302 | extern struct cpufreq_governor cpufreq_gov_performance; |
284 | #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_performance | 303 | #endif |
304 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE | ||
305 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance) | ||
285 | #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) | 306 | #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) |
286 | extern struct cpufreq_governor cpufreq_gov_userspace; | 307 | extern struct cpufreq_governor cpufreq_gov_userspace; |
287 | #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace | 308 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace) |
309 | #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND) | ||
310 | extern struct cpufreq_governor cpufreq_gov_ondemand; | ||
311 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_ondemand) | ||
312 | #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE) | ||
313 | extern struct cpufreq_governor cpufreq_gov_conservative; | ||
314 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) | ||
288 | #endif | 315 | #endif |
289 | 316 | ||
290 | 317 | ||