diff options
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bbcf227..4d89e0e6f9cc 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #ifndef _LINUX_CPUFREQ_H | 11 | #ifndef _LINUX_CPUFREQ_H |
12 | #define _LINUX_CPUFREQ_H | 12 | #define _LINUX_CPUFREQ_H |
13 | 13 | ||
14 | #include <linux/clk.h> | ||
14 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
15 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
16 | #include <linux/kobject.h> | 17 | #include <linux/kobject.h> |
@@ -66,6 +67,7 @@ struct cpufreq_policy { | |||
66 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 67 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
67 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | 68 | unsigned int last_cpu; /* cpu nr of previous CPU that managed |
68 | * this policy */ | 69 | * this policy */ |
70 | struct clk *clk; | ||
69 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 71 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
70 | 72 | ||
71 | unsigned int min; /* in kHz */ | 73 | unsigned int min; /* in kHz */ |
@@ -225,6 +227,11 @@ struct cpufreq_driver { | |||
225 | int (*suspend) (struct cpufreq_policy *policy); | 227 | int (*suspend) (struct cpufreq_policy *policy); |
226 | int (*resume) (struct cpufreq_policy *policy); | 228 | int (*resume) (struct cpufreq_policy *policy); |
227 | struct freq_attr **attr; | 229 | struct freq_attr **attr; |
230 | |||
231 | /* platform specific boost support code */ | ||
232 | bool boost_supported; | ||
233 | bool boost_enabled; | ||
234 | int (*set_boost) (int state); | ||
228 | }; | 235 | }; |
229 | 236 | ||
230 | /* flags */ | 237 | /* flags */ |
@@ -252,6 +259,15 @@ struct cpufreq_driver { | |||
252 | */ | 259 | */ |
253 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) | 260 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) |
254 | 261 | ||
262 | /* | ||
263 | * Set by drivers which want cpufreq core to check if CPU is running at a | ||
264 | * frequency present in freq-table exposed by the driver. For these drivers if | ||
265 | * CPU is found running at an out of table freq, we will try to set it to a freq | ||
266 | * from the table. And if that fails, we will stop further boot process by | ||
267 | * issuing a BUG_ON(). | ||
268 | */ | ||
269 | #define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5) | ||
270 | |||
255 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 271 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
256 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 272 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
257 | 273 | ||
@@ -299,6 +315,8 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
299 | #define CPUFREQ_NOTIFY (2) | 315 | #define CPUFREQ_NOTIFY (2) |
300 | #define CPUFREQ_START (3) | 316 | #define CPUFREQ_START (3) |
301 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | 317 | #define CPUFREQ_UPDATE_POLICY_CPU (4) |
318 | #define CPUFREQ_CREATE_POLICY (5) | ||
319 | #define CPUFREQ_REMOVE_POLICY (6) | ||
302 | 320 | ||
303 | #ifdef CONFIG_CPU_FREQ | 321 | #ifdef CONFIG_CPU_FREQ |
304 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 322 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
@@ -306,6 +324,8 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | |||
306 | 324 | ||
307 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 325 | void cpufreq_notify_transition(struct cpufreq_policy *policy, |
308 | struct cpufreq_freqs *freqs, unsigned int state); | 326 | struct cpufreq_freqs *freqs, unsigned int state); |
327 | void cpufreq_notify_post_transition(struct cpufreq_policy *policy, | ||
328 | struct cpufreq_freqs *freqs, int transition_failed); | ||
309 | 329 | ||
310 | #else /* CONFIG_CPU_FREQ */ | 330 | #else /* CONFIG_CPU_FREQ */ |
311 | static inline int cpufreq_register_notifier(struct notifier_block *nb, | 331 | static inline int cpufreq_register_notifier(struct notifier_block *nb, |
@@ -420,6 +440,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
420 | 440 | ||
421 | #define CPUFREQ_ENTRY_INVALID ~0 | 441 | #define CPUFREQ_ENTRY_INVALID ~0 |
422 | #define CPUFREQ_TABLE_END ~1 | 442 | #define CPUFREQ_TABLE_END ~1 |
443 | #define CPUFREQ_BOOST_FREQ ~2 | ||
423 | 444 | ||
424 | struct cpufreq_frequency_table { | 445 | struct cpufreq_frequency_table { |
425 | unsigned int driver_data; /* driver specific data, not used by core */ | 446 | unsigned int driver_data; /* driver specific data, not used by core */ |
@@ -439,10 +460,30 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
439 | unsigned int target_freq, | 460 | unsigned int target_freq, |
440 | unsigned int relation, | 461 | unsigned int relation, |
441 | unsigned int *index); | 462 | unsigned int *index); |
463 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, | ||
464 | unsigned int freq); | ||
442 | 465 | ||
443 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | 466 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); |
444 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); | 467 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); |
445 | 468 | ||
469 | #ifdef CONFIG_CPU_FREQ | ||
470 | int cpufreq_boost_trigger_state(int state); | ||
471 | int cpufreq_boost_supported(void); | ||
472 | int cpufreq_boost_enabled(void); | ||
473 | #else | ||
474 | static inline int cpufreq_boost_trigger_state(int state) | ||
475 | { | ||
476 | return 0; | ||
477 | } | ||
478 | static inline int cpufreq_boost_supported(void) | ||
479 | { | ||
480 | return 0; | ||
481 | } | ||
482 | static inline int cpufreq_boost_enabled(void) | ||
483 | { | ||
484 | return 0; | ||
485 | } | ||
486 | #endif | ||
446 | /* the following funtion is for cpufreq core use only */ | 487 | /* the following funtion is for cpufreq core use only */ |
447 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 488 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
448 | 489 | ||
@@ -455,6 +496,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu); | |||
455 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, | 496 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
456 | struct cpufreq_frequency_table *table); | 497 | struct cpufreq_frequency_table *table); |
457 | 498 | ||
499 | unsigned int cpufreq_generic_get(unsigned int cpu); | ||
458 | int cpufreq_generic_init(struct cpufreq_policy *policy, | 500 | int cpufreq_generic_init(struct cpufreq_policy *policy, |
459 | struct cpufreq_frequency_table *table, | 501 | struct cpufreq_frequency_table *table, |
460 | unsigned int transition_latency); | 502 | unsigned int transition_latency); |