19 #include <linux/kernel.h>
20 #include <linux/module.h>
28 #include <linux/timex.h>
31 #define REG_CSCIR 0x22
32 #define REG_CSCDR 0x23
80 static unsigned int elanfreq_get_cpu_frequency(
unsigned int cpu)
89 if ((clockspeed_reg & 0xE0) == 0xE0)
93 if ((clockspeed_reg & 0xE0) == 0xC0) {
94 if ((clockspeed_reg & 0x01) == 0)
101 if ((clockspeed_reg & 0xE0) == 0xA0)
104 return (1<<((clockspeed_reg & 0xE0) >> 5)) * 1000;
120 static void elanfreq_set_cpu_state(
unsigned int state)
124 freqs.
old = elanfreq_get_cpu_frequency(0);
131 elan_multiplier[state].
clock);
182 unsigned int target_freq,
183 unsigned int relation)
185 unsigned int newstate = 0;
188 target_freq, relation, &newstate))
191 elanfreq_set_cpu_state(newstate);
214 max_freq = elanfreq_get_cpu_frequency(0);
218 if (elanfreq_table[i].
frequency > max_freq)
224 policy->
cur = elanfreq_get_cpu_frequency(0);
254 static int __init elanfreq_setup(
char *
str)
257 printk(
KERN_WARNING "You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
260 __setup(
"elanfreq=", elanfreq_setup);
264 static struct freq_attr *elanfreq_attr[] = {
271 .get = elanfreq_get_cpu_frequency,
272 .verify = elanfreq_verify,
273 .target = elanfreq_target,
274 .init = elanfreq_cpu_init,
275 .exit = elanfreq_cpu_exit,
278 .attr = elanfreq_attr,
287 static int __init elanfreq_init(
void)
295 static void __exit elanfreq_exit(
void)