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.h34
1 files changed, 24 insertions, 10 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a55b88eaf96a..a22944ca0526 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -89,11 +89,15 @@ struct cpufreq_real_policy {
89}; 89};
90 90
91struct cpufreq_policy { 91struct cpufreq_policy {
92 cpumask_var_t cpus; /* CPUs requiring sw coordination */ 92 /* CPUs sharing clock, require sw coordination */
93 cpumask_var_t related_cpus; /* CPUs with any coordination */ 93 cpumask_var_t cpus; /* Online CPUs only */
94 unsigned int shared_type; /* ANY or ALL affected CPUs 94 cpumask_var_t related_cpus; /* Online + Offline CPUs */
95
96 unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs
95 should set cpufreq */ 97 should set cpufreq */
96 unsigned int cpu; /* cpu nr of registered CPU */ 98 unsigned int cpu; /* cpu nr of CPU managing this policy */
99 unsigned int last_cpu; /* cpu nr of previous CPU that managed
100 * this policy */
97 struct cpufreq_cpuinfo cpuinfo;/* see above */ 101 struct cpufreq_cpuinfo cpuinfo;/* see above */
98 102
99 unsigned int min; /* in kHz */ 103 unsigned int min; /* in kHz */
@@ -112,16 +116,23 @@ struct cpufreq_policy {
112 struct completion kobj_unregister; 116 struct completion kobj_unregister;
113}; 117};
114 118
115#define CPUFREQ_ADJUST (0) 119#define CPUFREQ_ADJUST (0)
116#define CPUFREQ_INCOMPATIBLE (1) 120#define CPUFREQ_INCOMPATIBLE (1)
117#define CPUFREQ_NOTIFY (2) 121#define CPUFREQ_NOTIFY (2)
118#define CPUFREQ_START (3) 122#define CPUFREQ_START (3)
123#define CPUFREQ_UPDATE_POLICY_CPU (4)
119 124
125/* Only for ACPI */
120#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ 126#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
121#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ 127#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
122#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ 128#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
123#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ 129#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
124 130
131static inline bool policy_is_shared(struct cpufreq_policy *policy)
132{
133 return cpumask_weight(policy->cpus) > 1;
134}
135
125/******************** cpufreq transition notifiers *******************/ 136/******************** cpufreq transition notifiers *******************/
126 137
127#define CPUFREQ_PRECHANGE (0) 138#define CPUFREQ_PRECHANGE (0)
@@ -173,6 +184,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu
173 184
174struct cpufreq_governor { 185struct cpufreq_governor {
175 char name[CPUFREQ_NAME_LEN]; 186 char name[CPUFREQ_NAME_LEN];
187 int initialized;
176 int (*governor) (struct cpufreq_policy *policy, 188 int (*governor) (struct cpufreq_policy *policy,
177 unsigned int event); 189 unsigned int event);
178 ssize_t (*show_setspeed) (struct cpufreq_policy *policy, 190 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
@@ -308,6 +320,9 @@ __ATTR(_name, 0444, show_##_name, NULL)
308static struct global_attr _name = \ 320static struct global_attr _name = \
309__ATTR(_name, 0644, show_##_name, store_##_name) 321__ATTR(_name, 0644, show_##_name, store_##_name)
310 322
323struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
324void cpufreq_cpu_put(struct cpufreq_policy *data);
325const char *cpufreq_get_current_driver(void);
311 326
312/********************************************************************* 327/*********************************************************************
313 * CPUFREQ 2.6. INTERFACE * 328 * CPUFREQ 2.6. INTERFACE *
@@ -397,14 +412,13 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
397 412
398/* the following 3 funtions are for cpufreq core use only */ 413/* the following 3 funtions are for cpufreq core use only */
399struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); 414struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
400struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
401void cpufreq_cpu_put(struct cpufreq_policy *data);
402 415
403/* the following are really really optional */ 416/* the following are really really optional */
404extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; 417extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
405 418
406void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, 419void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
407 unsigned int cpu); 420 unsigned int cpu);
421void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
408 422
409void cpufreq_frequency_table_put_attr(unsigned int cpu); 423void cpufreq_frequency_table_put_attr(unsigned int cpu);
410#endif /* _LINUX_CPUFREQ_H */ 424#endif /* _LINUX_CPUFREQ_H */