11 #include <linux/errno.h>
12 #include <linux/export.h>
14 #include <linux/list.h>
18 #include <asm/clock.h>
45 static struct clk cpu_clk = {
65 clkp->
ops->recalc(clkp);
84 return (
unsigned long)clk->
rate;
103 ret = clk->
ops->set_rate(clk, rate, 0);
104 spin_unlock_irqrestore(&clock_lock, flags);
112 if (loongson2_clockmod_table[i].
frequency ==
115 if (rate == loongson2_clockmod_table[i].
frequency)
118 if (rate != loongson2_clockmod_table[i].
frequency)
123 regval = LOONGSON_CHIPCFG0;
124 regval = (regval & ~0x7) | (loongson2_clockmod_table[i].
index - 1);
125 LOONGSON_CHIPCFG0 =
regval;
134 unsigned long flags, rounded;
137 rounded = clk->
ops->round_rate(clk, rate);
138 spin_unlock_irqrestore(&clock_lock, flags);