Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373806
b: refs/heads/master
c: 7653c31
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Simon Horman committed Apr 2, 2013
1 parent c7decc9 commit 293dceb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d313d068d4b5801ea9c0c66bed66f37c64ad6807
refs/heads/master: 7653c318b73d8553d4c13bb7e371878ddc19f80d
23 changes: 17 additions & 6 deletions trunk/arch/arm/mach-shmobile/clock-sh73a0.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/sh_clk.h>
#include <linux/clkdev.h>
#include <asm/processor.h>
#include <mach/common.h>

#define FRQCRA IOMEM(0xe6150000)
Expand Down Expand Up @@ -234,14 +235,24 @@ static struct clk *main_clks[] = {
&sh73a0_extalr_clk,
};

static void div4_kick(struct clk *clk)
static int frqcr_kick(void)
{
unsigned long value;
int i;

/* set KICK bit in FRQCRB to update hardware setting, check success */
__raw_writel(__raw_readl(FRQCRB) | (1 << 31), FRQCRB);
for (i = 1000; i; i--)
if (__raw_readl(FRQCRB) & (1 << 31))
cpu_relax();
else
return i;

return -ETIMEDOUT;
}

/* set KICK bit in FRQCRB to update hardware setting */
value = __raw_readl(FRQCRB);
value |= (1 << 31);
__raw_writel(value, FRQCRB);
static void div4_kick(struct clk *clk)
{
frqcr_kick();
}

static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
Expand Down

0 comments on commit 293dceb

Please sign in to comment.