24 #include <linux/module.h>
27 #include <asm/machdep.h>
52 static int set_pmode(
unsigned int cpu,
unsigned int slow_mode)
89 pr_info(
"invalid CBE regs pointers for cpufreq\n");
101 max_freq = *max_freqp / 1000;
103 pr_debug(
"max clock-frequency is at %u kHz\n", max_freq);
104 pr_debug(
"initializing frequency table\n");
114 policy->
cpuinfo.transition_latency = 25000;
117 pr_debug(
"current pmode is at %d\n",cur_pmode);
122 cpumask_copy(policy->
cpus, cpu_sibling_mask(policy->
cpu));
144 unsigned int target_freq,
145 unsigned int relation)
149 unsigned int cbe_pmode_new;
157 freqs.old = policy->
cur;
158 freqs.new = cbe_freqs[cbe_pmode_new].
frequency;
159 freqs.cpu = policy->
cpu;
164 pr_debug(
"setting frequency for cpu %d to %d kHz, " \
165 "1/%d of max frequency\n",
168 cbe_freqs[cbe_pmode_new].
index);
170 rc = set_pmode(policy->
cpu, cbe_pmode_new);
179 .verify = cbe_cpufreq_verify,
180 .target = cbe_cpufreq_target,
181 .init = cbe_cpufreq_cpu_init,
182 .exit = cbe_cpufreq_cpu_exit,
183 .name =
"cbe-cpufreq",
192 static int __init cbe_cpufreq_init(
void)
194 if (!machine_is(cell))
200 static void __exit cbe_cpufreq_exit(
void)