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.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4de02b10007f..c3e9de8321c6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -196,11 +196,6 @@ extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy,
196int cpufreq_register_governor(struct cpufreq_governor *governor); 196int cpufreq_register_governor(struct cpufreq_governor *governor);
197void cpufreq_unregister_governor(struct cpufreq_governor *governor); 197void cpufreq_unregister_governor(struct cpufreq_governor *governor);
198 198
199int lock_policy_rwsem_read(int cpu);
200int lock_policy_rwsem_write(int cpu);
201void unlock_policy_rwsem_read(int cpu);
202void unlock_policy_rwsem_write(int cpu);
203
204 199
205/********************************************************************* 200/*********************************************************************
206 * CPUFREQ DRIVER INTERFACE * 201 * CPUFREQ DRIVER INTERFACE *
@@ -278,6 +273,27 @@ struct freq_attr {
278 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); 273 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
279}; 274};
280 275
276#define cpufreq_freq_attr_ro(_name) \
277static struct freq_attr _name = \
278__ATTR(_name, 0444, show_##_name, NULL)
279
280#define cpufreq_freq_attr_ro_perm(_name, _perm) \
281static struct freq_attr _name = \
282__ATTR(_name, _perm, show_##_name, NULL)
283
284#define cpufreq_freq_attr_ro_old(_name) \
285static struct freq_attr _name##_old = \
286__ATTR(_name, 0444, show_##_name##_old, NULL)
287
288#define cpufreq_freq_attr_rw(_name) \
289static struct freq_attr _name = \
290__ATTR(_name, 0644, show_##_name, store_##_name)
291
292#define cpufreq_freq_attr_rw_old(_name) \
293static struct freq_attr _name##_old = \
294__ATTR(_name, 0644, show_##_name##_old, store_##_name##_old)
295
296
281struct global_attr { 297struct global_attr {
282 struct attribute attr; 298 struct attribute attr;
283 ssize_t (*show)(struct kobject *kobj, 299 ssize_t (*show)(struct kobject *kobj,
@@ -286,6 +302,15 @@ struct global_attr {
286 const char *c, size_t count); 302 const char *c, size_t count);
287}; 303};
288 304
305#define define_one_global_ro(_name) \
306static struct global_attr _name = \
307__ATTR(_name, 0444, show_##_name, NULL)
308
309#define define_one_global_rw(_name) \
310static struct global_attr _name = \
311__ATTR(_name, 0644, show_##_name, store_##_name)
312
313
289/********************************************************************* 314/*********************************************************************
290 * CPUFREQ 2.6. INTERFACE * 315 * CPUFREQ 2.6. INTERFACE *
291 *********************************************************************/ 316 *********************************************************************/