14 #include <linux/kernel.h>
15 #include <linux/errno.h>
19 #include <mach/regs-clock.h>
20 #include <mach/regs-gpio.h>
22 #include <plat/clock.h>
27 static int s3c24xx_dclk_enable(
struct clk *
clk,
int enable)
41 static int s3c24xx_dclk_setparent(
struct clk *clk,
struct clk *parent)
43 unsigned long dclkcon;
48 else if (parent == &clk_p)
73 static unsigned long s3c24xx_calc_div(
struct clk *clk,
unsigned long rate)
77 if ((rate == 0) || !clk->
parent)
89 static unsigned long s3c24xx_round_dclk_rate(
struct clk *clk,
92 unsigned long div = s3c24xx_calc_div(clk, rate);
100 static int s3c24xx_set_dclk_rate(
struct clk *clk,
unsigned long rate)
102 unsigned long mask,
data, div = s3c24xx_calc_div(clk, rate);
125 static int s3c24xx_clkout_setparent(
struct clk *clk,
struct clk *parent)
136 else if (parent == &clk_f)
138 else if (parent == &clk_h)
140 else if (parent == &clk_p)
164 static struct clk_ops dclk_ops = {
165 .set_parent = s3c24xx_dclk_setparent,
166 .set_rate = s3c24xx_set_dclk_rate,
167 .round_rate = s3c24xx_round_dclk_rate,
173 .enable = s3c24xx_dclk_enable,
180 .enable = s3c24xx_dclk_enable,
184 static struct clk_ops clkout_ops = {
185 .set_parent = s3c24xx_clkout_setparent,