diff options
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/us2e_cpufreq.c | 13 | ||||
-rw-r--r-- | arch/sparc/kernel/us3_cpufreq.c | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/arch/sparc/kernel/us2e_cpufreq.c b/arch/sparc/kernel/us2e_cpufreq.c index 489fc15f3194..abe963d7b87c 100644 --- a/arch/sparc/kernel/us2e_cpufreq.c +++ b/arch/sparc/kernel/us2e_cpufreq.c | |||
@@ -248,8 +248,10 @@ static unsigned int us2e_freq_get(unsigned int cpu) | |||
248 | return clock_tick / estar_to_divisor(estar); | 248 | return clock_tick / estar_to_divisor(estar); |
249 | } | 249 | } |
250 | 250 | ||
251 | static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 251 | static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy, |
252 | unsigned int index) | ||
252 | { | 253 | { |
254 | unsigned int cpu = policy->cpu; | ||
253 | unsigned long new_bits, new_freq; | 255 | unsigned long new_bits, new_freq; |
254 | unsigned long clock_tick, divisor, old_divisor, estar; | 256 | unsigned long clock_tick, divisor, old_divisor, estar; |
255 | cpumask_t cpus_allowed; | 257 | cpumask_t cpus_allowed; |
@@ -272,14 +274,13 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
272 | 274 | ||
273 | freqs.old = clock_tick / old_divisor; | 275 | freqs.old = clock_tick / old_divisor; |
274 | freqs.new = new_freq; | 276 | freqs.new = new_freq; |
275 | freqs.cpu = cpu; | 277 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); |
276 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
277 | 278 | ||
278 | if (old_divisor != divisor) | 279 | if (old_divisor != divisor) |
279 | us2e_transition(estar, new_bits, clock_tick * 1000, | 280 | us2e_transition(estar, new_bits, clock_tick * 1000, |
280 | old_divisor, divisor); | 281 | old_divisor, divisor); |
281 | 282 | ||
282 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 283 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); |
283 | 284 | ||
284 | set_cpus_allowed_ptr(current, &cpus_allowed); | 285 | set_cpus_allowed_ptr(current, &cpus_allowed); |
285 | } | 286 | } |
@@ -295,7 +296,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy, | |||
295 | target_freq, relation, &new_index)) | 296 | target_freq, relation, &new_index)) |
296 | return -EINVAL; | 297 | return -EINVAL; |
297 | 298 | ||
298 | us2e_set_cpu_divider_index(policy->cpu, new_index); | 299 | us2e_set_cpu_divider_index(policy, new_index); |
299 | 300 | ||
300 | return 0; | 301 | return 0; |
301 | } | 302 | } |
@@ -335,7 +336,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) | |||
335 | static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) | 336 | static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) |
336 | { | 337 | { |
337 | if (cpufreq_us2e_driver) | 338 | if (cpufreq_us2e_driver) |
338 | us2e_set_cpu_divider_index(policy->cpu, 0); | 339 | us2e_set_cpu_divider_index(policy, 0); |
339 | 340 | ||
340 | return 0; | 341 | return 0; |
341 | } | 342 | } |
diff --git a/arch/sparc/kernel/us3_cpufreq.c b/arch/sparc/kernel/us3_cpufreq.c index eb1624b931d9..7ceb9c8458f0 100644 --- a/arch/sparc/kernel/us3_cpufreq.c +++ b/arch/sparc/kernel/us3_cpufreq.c | |||
@@ -96,8 +96,10 @@ static unsigned int us3_freq_get(unsigned int cpu) | |||
96 | return ret; | 96 | return ret; |
97 | } | 97 | } |
98 | 98 | ||
99 | static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 99 | static void us3_set_cpu_divider_index(struct cpufreq_policy *policy, |
100 | unsigned int index) | ||
100 | { | 101 | { |
102 | unsigned int cpu = policy->cpu; | ||
101 | unsigned long new_bits, new_freq, reg; | 103 | unsigned long new_bits, new_freq, reg; |
102 | cpumask_t cpus_allowed; | 104 | cpumask_t cpus_allowed; |
103 | struct cpufreq_freqs freqs; | 105 | struct cpufreq_freqs freqs; |
@@ -131,14 +133,13 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
131 | 133 | ||
132 | freqs.old = get_current_freq(cpu, reg); | 134 | freqs.old = get_current_freq(cpu, reg); |
133 | freqs.new = new_freq; | 135 | freqs.new = new_freq; |
134 | freqs.cpu = cpu; | 136 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); |
135 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
136 | 137 | ||
137 | reg &= ~SAFARI_CFG_DIV_MASK; | 138 | reg &= ~SAFARI_CFG_DIV_MASK; |
138 | reg |= new_bits; | 139 | reg |= new_bits; |
139 | write_safari_cfg(reg); | 140 | write_safari_cfg(reg); |
140 | 141 | ||
141 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 142 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); |
142 | 143 | ||
143 | set_cpus_allowed_ptr(current, &cpus_allowed); | 144 | set_cpus_allowed_ptr(current, &cpus_allowed); |
144 | } | 145 | } |
@@ -156,7 +157,7 @@ static int us3_freq_target(struct cpufreq_policy *policy, | |||
156 | &new_index)) | 157 | &new_index)) |
157 | return -EINVAL; | 158 | return -EINVAL; |
158 | 159 | ||
159 | us3_set_cpu_divider_index(policy->cpu, new_index); | 160 | us3_set_cpu_divider_index(policy, new_index); |
160 | 161 | ||
161 | return 0; | 162 | return 0; |
162 | } | 163 | } |
@@ -192,7 +193,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) | |||
192 | static int us3_freq_cpu_exit(struct cpufreq_policy *policy) | 193 | static int us3_freq_cpu_exit(struct cpufreq_policy *policy) |
193 | { | 194 | { |
194 | if (cpufreq_us3_driver) | 195 | if (cpufreq_us3_driver) |
195 | us3_set_cpu_divider_index(policy->cpu, 0); | 196 | us3_set_cpu_divider_index(policy, 0); |
196 | 197 | ||
197 | return 0; | 198 | return 0; |
198 | } | 199 | } |