aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9582de1c9cad..cb7d6e0db759 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -5,7 +5,7 @@
5 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> 5 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
6 * 6 *
7 * Oct 2005 - Ashok Raj <ashok.raj@intel.com> 7 * Oct 2005 - Ashok Raj <ashok.raj@intel.com>
8 * Added handling for CPU hotplug 8 * Added handling for CPU hotplug
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -44,8 +44,8 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
44static void handle_update(void *data); 44static void handle_update(void *data);
45 45
46/** 46/**
47 * Two notifier lists: the "policy" list is involved in the 47 * Two notifier lists: the "policy" list is involved in the
48 * validation process for a new CPU frequency policy; the 48 * validation process for a new CPU frequency policy; the
49 * "transition" list for kernel code that needs to handle 49 * "transition" list for kernel code that needs to handle
50 * changes to devices when the CPU clock speed changes. 50 * changes to devices when the CPU clock speed changes.
51 * The mutex locks both lists. 51 * The mutex locks both lists.
@@ -151,7 +151,7 @@ void cpufreq_debug_printk(unsigned int type, const char *prefix, const char *fmt
151 va_list args; 151 va_list args;
152 unsigned int len; 152 unsigned int len;
153 unsigned long flags; 153 unsigned long flags;
154 154
155 WARN_ON(!prefix); 155 WARN_ON(!prefix);
156 if (type & debug) { 156 if (type & debug) {
157 spin_lock_irqsave(&disable_ratelimit_lock, flags); 157 spin_lock_irqsave(&disable_ratelimit_lock, flags);
@@ -198,7 +198,7 @@ static inline void cpufreq_debug_disable_ratelimit(void) { return; }
198 * 198 *
199 * This function alters the system "loops_per_jiffy" for the clock 199 * This function alters the system "loops_per_jiffy" for the clock
200 * speed change. Note that loops_per_jiffy cannot be updated on SMP 200 * speed change. Note that loops_per_jiffy cannot be updated on SMP
201 * systems as each CPU might be scaled differently. So, use the arch 201 * systems as each CPU might be scaled differently. So, use the arch
202 * per-CPU loops_per_jiffy value wherever possible. 202 * per-CPU loops_per_jiffy value wherever possible.
203 */ 203 */
204#ifndef CONFIG_SMP 204#ifndef CONFIG_SMP
@@ -233,7 +233,7 @@ static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) {
233 * 233 *
234 * This function calls the transition notifiers and the "adjust_jiffies" 234 * This function calls the transition notifiers and the "adjust_jiffies"
235 * function. It is called twice on all CPU frequency changes that have 235 * function. It is called twice on all CPU frequency changes that have
236 * external effects. 236 * external effects.
237 */ 237 */
238void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) 238void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
239{ 239{
@@ -251,7 +251,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
251 switch (state) { 251 switch (state) {
252 252
253 case CPUFREQ_PRECHANGE: 253 case CPUFREQ_PRECHANGE:
254 /* detect if the driver reported a value as "old frequency" 254 /* detect if the driver reported a value as "old frequency"
255 * which is not equal to what the cpufreq core thinks is 255 * which is not equal to what the cpufreq core thinks is
256 * "old frequency". 256 * "old frequency".
257 */ 257 */
@@ -335,11 +335,11 @@ extern struct sysdev_class cpu_sysdev_class;
335 * "unsigned int". 335 * "unsigned int".
336 */ 336 */
337 337
338#define show_one(file_name, object) \ 338#define show_one(file_name, object) \
339static ssize_t show_##file_name \ 339static ssize_t show_##file_name \
340(struct cpufreq_policy * policy, char *buf) \ 340(struct cpufreq_policy * policy, char *buf) \
341{ \ 341{ \
342 return sprintf (buf, "%u\n", policy->object); \ 342 return sprintf (buf, "%u\n", policy->object); \
343} 343}
344 344
345show_one(cpuinfo_min_freq, cpuinfo.min_freq); 345show_one(cpuinfo_min_freq, cpuinfo.min_freq);
@@ -404,8 +404,8 @@ static ssize_t show_scaling_governor (struct cpufreq_policy * policy, char *buf)
404/** 404/**
405 * store_scaling_governor - store policy for the specified CPU 405 * store_scaling_governor - store policy for the specified CPU
406 */ 406 */
407static ssize_t store_scaling_governor (struct cpufreq_policy * policy, 407static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
408 const char *buf, size_t count) 408 const char *buf, size_t count)
409{ 409{
410 unsigned int ret = -EINVAL; 410 unsigned int ret = -EINVAL;
411 char str_governor[16]; 411 char str_governor[16];
@@ -528,7 +528,7 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
528 return ret; 528 return ret;
529} 529}
530 530
531static ssize_t store(struct kobject * kobj, struct attribute * attr, 531static ssize_t store(struct kobject * kobj, struct attribute * attr,
532 const char * buf, size_t count) 532 const char * buf, size_t count)
533{ 533{
534 struct cpufreq_policy * policy = to_policy(kobj); 534 struct cpufreq_policy * policy = to_policy(kobj);
@@ -564,7 +564,7 @@ static struct kobj_type ktype_cpufreq = {
564/** 564/**
565 * cpufreq_add_dev - add a CPU device 565 * cpufreq_add_dev - add a CPU device
566 * 566 *
567 * Adds the cpufreq interface for a CPU device. 567 * Adds the cpufreq interface for a CPU device.
568 */ 568 */
569static int cpufreq_add_dev (struct sys_device * sys_dev) 569static int cpufreq_add_dev (struct sys_device * sys_dev)
570{ 570{
@@ -724,7 +724,7 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
724 724
725#ifdef CONFIG_SMP 725#ifdef CONFIG_SMP
726 /* if this isn't the CPU which is the parent of the kobj, we 726 /* if this isn't the CPU which is the parent of the kobj, we
727 * only need to unlink, put and exit 727 * only need to unlink, put and exit
728 */ 728 */
729 if (unlikely(cpu != data->cpu)) { 729 if (unlikely(cpu != data->cpu)) {
730 dprintk("removing link\n"); 730 dprintk("removing link\n");
@@ -740,7 +740,7 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
740 if (!kobject_get(&data->kobj)) { 740 if (!kobject_get(&data->kobj)) {
741 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 741 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
742 cpufreq_debug_enable_ratelimit(); 742 cpufreq_debug_enable_ratelimit();
743 return -EFAULT; 743 return -EFAULT;
744 } 744 }
745 745
746#ifdef CONFIG_SMP 746#ifdef CONFIG_SMP
@@ -783,7 +783,7 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
783 kobject_put(&data->kobj); 783 kobject_put(&data->kobj);
784 784
785 /* we need to make sure that the underlying kobj is actually 785 /* we need to make sure that the underlying kobj is actually
786 * not referenced anymore by anybody before we proceed with 786 * not referenced anymore by anybody before we proceed with
787 * unloading. 787 * unloading.
788 */ 788 */
789 dprintk("waiting for dropping of refcount\n"); 789 dprintk("waiting for dropping of refcount\n");
@@ -831,7 +831,7 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigne
831} 831}
832 832
833 833
834/** 834/**
835 * cpufreq_quick_get - get the CPU frequency (in kHz) frpm policy->cur 835 * cpufreq_quick_get - get the CPU frequency (in kHz) frpm policy->cur
836 * @cpu: CPU number 836 * @cpu: CPU number
837 * 837 *
@@ -855,7 +855,7 @@ unsigned int cpufreq_quick_get(unsigned int cpu)
855EXPORT_SYMBOL(cpufreq_quick_get); 855EXPORT_SYMBOL(cpufreq_quick_get);
856 856
857 857
858/** 858/**
859 * cpufreq_get - get the current CPU frequency (in kHz) 859 * cpufreq_get - get the current CPU frequency (in kHz)
860 * @cpu: CPU number 860 * @cpu: CPU number
861 * 861 *
@@ -1072,7 +1072,7 @@ static struct sysdev_driver cpufreq_sysdev_driver = {
1072 * @nb: notifier function to register 1072 * @nb: notifier function to register
1073 * @list: CPUFREQ_TRANSITION_NOTIFIER or CPUFREQ_POLICY_NOTIFIER 1073 * @list: CPUFREQ_TRANSITION_NOTIFIER or CPUFREQ_POLICY_NOTIFIER
1074 * 1074 *
1075 * Add a driver to one of two lists: either a list of drivers that 1075 * Add a driver to one of two lists: either a list of drivers that
1076 * are notified about clock rate changes (once before and once after 1076 * are notified about clock rate changes (once before and once after
1077 * the transition), or a list of drivers that are notified about 1077 * the transition), or a list of drivers that are notified about
1078 * changes in cpufreq policy. 1078 * changes in cpufreq policy.
@@ -1225,7 +1225,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
1225 return -EINVAL; 1225 return -EINVAL;
1226 1226
1227 mutex_lock(&cpufreq_governor_mutex); 1227 mutex_lock(&cpufreq_governor_mutex);
1228 1228
1229 list_for_each_entry(t, &cpufreq_governor_list, governor_list) { 1229 list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
1230 if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) { 1230 if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) {
1231 mutex_unlock(&cpufreq_governor_mutex); 1231 mutex_unlock(&cpufreq_governor_mutex);
@@ -1234,7 +1234,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
1234 } 1234 }
1235 list_add(&governor->governor_list, &cpufreq_governor_list); 1235 list_add(&governor->governor_list, &cpufreq_governor_list);
1236 1236
1237 mutex_unlock(&cpufreq_governor_mutex); 1237 mutex_unlock(&cpufreq_governor_mutex);
1238 return 0; 1238 return 0;
1239} 1239}
1240EXPORT_SYMBOL_GPL(cpufreq_register_governor); 1240EXPORT_SYMBOL_GPL(cpufreq_register_governor);
@@ -1497,9 +1497,9 @@ static struct notifier_block cpufreq_cpu_notifier =
1497 * @driver_data: A struct cpufreq_driver containing the values# 1497 * @driver_data: A struct cpufreq_driver containing the values#
1498 * submitted by the CPU Frequency driver. 1498 * submitted by the CPU Frequency driver.
1499 * 1499 *
1500 * Registers a CPU Frequency driver to this core code. This code 1500 * Registers a CPU Frequency driver to this core code. This code
1501 * returns zero on success, -EBUSY when another driver got here first 1501 * returns zero on success, -EBUSY when another driver got here first
1502 * (and isn't unregistered in the meantime). 1502 * (and isn't unregistered in the meantime).
1503 * 1503 *
1504 */ 1504 */
1505int cpufreq_register_driver(struct cpufreq_driver *driver_data) 1505int cpufreq_register_driver(struct cpufreq_driver *driver_data)
@@ -1560,7 +1560,7 @@ EXPORT_SYMBOL_GPL(cpufreq_register_driver);
1560/** 1560/**
1561 * cpufreq_unregister_driver - unregister the current CPUFreq driver 1561 * cpufreq_unregister_driver - unregister the current CPUFreq driver
1562 * 1562 *
1563 * Unregister the current CPUFreq driver. Only call this if you have 1563 * Unregister the current CPUFreq driver. Only call this if you have
1564 * the right to do so, i.e. if you have succeeded in initialising before! 1564 * the right to do so, i.e. if you have succeeded in initialising before!
1565 * Returns zero if successful, and -EINVAL if the cpufreq_driver is 1565 * Returns zero if successful, and -EINVAL if the cpufreq_driver is
1566 * currently not initialised. 1566 * currently not initialised.