aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 5ae5100c1f24..3f458896d45c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -110,6 +110,7 @@ struct cpufreq_policy {
110 bool transition_ongoing; /* Tracks transition status */ 110 bool transition_ongoing; /* Tracks transition status */
111 spinlock_t transition_lock; 111 spinlock_t transition_lock;
112 wait_queue_head_t transition_wait; 112 wait_queue_head_t transition_wait;
113 struct task_struct *transition_task; /* Task which is doing the transition */
113}; 114};
114 115
115/* Only for ACPI */ 116/* Only for ACPI */
@@ -468,6 +469,55 @@ struct cpufreq_frequency_table {
468 * order */ 469 * order */
469}; 470};
470 471
472#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
473int dev_pm_opp_init_cpufreq_table(struct device *dev,
474 struct cpufreq_frequency_table **table);
475void dev_pm_opp_free_cpufreq_table(struct device *dev,
476 struct cpufreq_frequency_table **table);
477#else
478static inline int dev_pm_opp_init_cpufreq_table(struct device *dev,
479 struct cpufreq_frequency_table
480 **table)
481{
482 return -EINVAL;
483}
484
485static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
486 struct cpufreq_frequency_table
487 **table)
488{
489}
490#endif
491
492static inline bool cpufreq_next_valid(struct cpufreq_frequency_table **pos)
493{
494 while ((*pos)->frequency != CPUFREQ_TABLE_END)
495 if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
496 return true;
497 else
498 (*pos)++;
499 return false;
500}
501
502/*
503 * cpufreq_for_each_entry - iterate over a cpufreq_frequency_table
504 * @pos: the cpufreq_frequency_table * to use as a loop cursor.
505 * @table: the cpufreq_frequency_table * to iterate over.
506 */
507
508#define cpufreq_for_each_entry(pos, table) \
509 for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++)
510
511/*
512 * cpufreq_for_each_valid_entry - iterate over a cpufreq_frequency_table
513 * excluding CPUFREQ_ENTRY_INVALID frequencies.
514 * @pos: the cpufreq_frequency_table * to use as a loop cursor.
515 * @table: the cpufreq_frequency_table * to iterate over.
516 */
517
518#define cpufreq_for_each_valid_entry(pos, table) \
519 for (pos = table; cpufreq_next_valid(&pos); pos++)
520
471int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, 521int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
472 struct cpufreq_frequency_table *table); 522 struct cpufreq_frequency_table *table);
473 523