aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/freq_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/freq_table.c')
-rw-r--r--drivers/cpufreq/freq_table.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index 551f4ccf87fd..e7490925fdcf 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -9,7 +9,8 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/cpufreq.h> 10#include <linux/cpufreq.h>
11 11
12#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg) 12#define dprintk(msg...) \
13 cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
13 14
14/********************************************************************* 15/*********************************************************************
15 * FREQUENCY TABLE HELPERS * 16 * FREQUENCY TABLE HELPERS *
@@ -29,7 +30,8 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
29 30
30 continue; 31 continue;
31 } 32 }
32 dprintk("table entry %u: %u kHz, %u index\n", i, freq, table[i].index); 33 dprintk("table entry %u: %u kHz, %u index\n",
34 i, freq, table[i].index);
33 if (freq < min_freq) 35 if (freq < min_freq)
34 min_freq = freq; 36 min_freq = freq;
35 if (freq > max_freq) 37 if (freq > max_freq)
@@ -54,13 +56,14 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
54 unsigned int i; 56 unsigned int i;
55 unsigned int count = 0; 57 unsigned int count = 0;
56 58
57 dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu); 59 dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n",
60 policy->min, policy->max, policy->cpu);
58 61
59 if (!cpu_online(policy->cpu)) 62 if (!cpu_online(policy->cpu))
60 return -EINVAL; 63 return -EINVAL;
61 64
62 cpufreq_verify_within_limits(policy, 65 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
63 policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); 66 policy->cpuinfo.max_freq);
64 67
65 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { 68 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
66 unsigned int freq = table[i].frequency; 69 unsigned int freq = table[i].frequency;
@@ -75,10 +78,11 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
75 if (!count) 78 if (!count)
76 policy->max = next_larger; 79 policy->max = next_larger;
77 80
78 cpufreq_verify_within_limits(policy, 81 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
79 policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); 82 policy->cpuinfo.max_freq);
80 83
81 dprintk("verification lead to (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu); 84 dprintk("verification lead to (%u - %u kHz) for cpu %u\n",
85 policy->min, policy->max, policy->cpu);
82 86
83 return 0; 87 return 0;
84} 88}
@@ -101,7 +105,8 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
101 }; 105 };
102 unsigned int i; 106 unsigned int i;
103 107
104 dprintk("request for target %u kHz (relation: %u) for cpu %u\n", target_freq, relation, policy->cpu); 108 dprintk("request for target %u kHz (relation: %u) for cpu %u\n",
109 target_freq, relation, policy->cpu);
105 110
106 switch (relation) { 111 switch (relation) {
107 case CPUFREQ_RELATION_H: 112 case CPUFREQ_RELATION_H:
@@ -192,7 +197,10 @@ static ssize_t show_available_freqs (struct cpufreq_policy *policy, char *buf)
192} 197}
193 198
194struct freq_attr cpufreq_freq_attr_scaling_available_freqs = { 199struct freq_attr cpufreq_freq_attr_scaling_available_freqs = {
195 .attr = { .name = "scaling_available_frequencies", .mode = 0444, .owner=THIS_MODULE }, 200 .attr = { .name = "scaling_available_frequencies",
201 .mode = 0444,
202 .owner=THIS_MODULE
203 },
196 .show = show_available_freqs, 204 .show = show_available_freqs,
197}; 205};
198EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); 206EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs);