aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-19 09:26:56 +0000
committerPaul Mundt <lethal@linux-sh.org>2010-02-22 19:11:22 +0900
commit7be85c6eb4462cd973e680d9dcf897a7b5b26165 (patch)
tree5da0ed4f9d6e24676cca7db071ba3380ee6c0cd7 /arch/sh/kernel/cpu/sh4a/clock-sh7724.c
parentsh: introduce struct clk_div4_table (diff)
downloadlinux-dev-7be85c6eb4462cd973e680d9dcf897a7b5b26165.tar.xz
linux-dev-7be85c6eb4462cd973e680d9dcf897a7b5b26165.zip
sh: add sh7724 kick callback to clk_div4_table
This patch adds a ->kick() callback to clk_div4_table and ties it into sh_clk_div4_set_rate(). A sh7724 specific kick function is also added that updates the KICK bit whenever div4 clocks in FRQCRA and FRQCRB have been set. Allows us to set the VPU clock. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7724.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 70517900ef8f..a8a993fc894a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -127,6 +127,16 @@ struct clk *main_clks[] = {
&div3_clk,
};
+static void div4_kick(struct clk *clk)
+{
+ unsigned long value;
+
+ /* set KICK bit in FRQCRA to update hardware setting */
+ value = __raw_readl(FRQCRA);
+ value |= (1 << 31);
+ __raw_writel(value, FRQCRA);
+}
+
static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };
static struct clk_div_mult_table div4_div_mult_table = {
@@ -136,6 +146,7 @@ static struct clk_div_mult_table div4_div_mult_table = {
static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
+ .kick = div4_kick,
};
enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };