13 #include <linux/kernel.h>
16 #include <asm/clock.h>
21 static int bfc_divisors[] = { 1, 1, 1, 8, 12, 16, 24, 1 };
22 static int pfc_divisors[] = { 1, 24, 24, 1 };
23 static int cfc_divisors[] = { 1, 1, 4, 1, 6, 1, 1, 1 };
25 static void master_clk_init(
struct clk *
clk)
30 static struct sh_clk_ops sh7780_master_clk_ops = {
31 .init = master_clk_init,
34 static unsigned long module_clk_recalc(
struct clk *
clk)
37 return clk->
parent->rate / pfc_divisors[
idx];
40 static struct sh_clk_ops sh7780_module_clk_ops = {
41 .recalc = module_clk_recalc,
44 static unsigned long bus_clk_recalc(
struct clk *
clk)
50 static struct sh_clk_ops sh7780_bus_clk_ops = {
51 .recalc = bus_clk_recalc,
54 static unsigned long cpu_clk_recalc(
struct clk *
clk)
60 static struct sh_clk_ops sh7780_cpu_clk_ops = {
61 .recalc = cpu_clk_recalc,
65 &sh7780_master_clk_ops,
66 &sh7780_module_clk_ops,
74 *ops = sh7780_clk_ops[
idx];
77 static unsigned long shyway_clk_recalc(
struct clk *
clk)
80 return clk->
parent->rate / cfc_divisors[
idx];
83 static struct sh_clk_ops sh7780_shyway_clk_ops = {
84 .recalc = shyway_clk_recalc,
87 static struct clk sh7780_shyway_clk = {
89 .ops = &sh7780_shyway_clk_ops,
96 static struct clk *sh7780_onchip_clocks[] = {
113 for (i = 0; i <
ARRAY_SIZE(sh7780_onchip_clocks); i++) {
114 struct clk *clkp = sh7780_onchip_clocks[
i];