diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-03-07 14:00:48 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-04-01 22:02:15 -0400 |
commit | fe7aa82d62d13d97c9a786707c467357cb8bddc3 (patch) | |
tree | e353234b16d45f5bc276871fe4cc9e5558c82a5a /arch/arm/mach-shmobile/clock-sh73a0.c | |
parent | 0b7d78202260162057248875b1c9bac70d041e58 (diff) |
ARM: shmobile: sh73a0: add a TWD clock
Add a TWD clock on sh73a0 for the smp_twd driver to properly update the
clock's frequency upon cpufreq events.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/clock-sh73a0.c')
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh73a0.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 34b5c5ae4cbd..a57ec151674e 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -288,6 +288,20 @@ static struct clk div4_clks[DIV4_NR] = { | |||
288 | [DIV4_HP] = DIV4(FRQCRB, 4, 0xdff, 0), | 288 | [DIV4_HP] = DIV4(FRQCRB, 4, 0xdff, 0), |
289 | }; | 289 | }; |
290 | 290 | ||
291 | static unsigned long twd_recalc(struct clk *clk) | ||
292 | { | ||
293 | return clk_get_rate(clk->parent) / 4; | ||
294 | } | ||
295 | |||
296 | static struct sh_clk_ops twd_clk_ops = { | ||
297 | .recalc = twd_recalc, | ||
298 | }; | ||
299 | |||
300 | static struct clk twd_clk = { | ||
301 | .parent = &div4_clks[DIV4_Z], | ||
302 | .ops = &twd_clk_ops, | ||
303 | }; | ||
304 | |||
291 | enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1, | 305 | enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1, |
292 | DIV6_FLCTL, DIV6_SDHI0, DIV6_SDHI1, DIV6_SDHI2, | 306 | DIV6_FLCTL, DIV6_SDHI0, DIV6_SDHI1, DIV6_SDHI2, |
293 | DIV6_FSIA, DIV6_FSIB, DIV6_SUB, | 307 | DIV6_FSIA, DIV6_FSIB, DIV6_SUB, |
@@ -482,6 +496,7 @@ static struct clk dsi1phy_clk = { | |||
482 | static struct clk *late_main_clks[] = { | 496 | static struct clk *late_main_clks[] = { |
483 | &dsi0phy_clk, | 497 | &dsi0phy_clk, |
484 | &dsi1phy_clk, | 498 | &dsi1phy_clk, |
499 | &twd_clk, | ||
485 | }; | 500 | }; |
486 | 501 | ||
487 | enum { MSTP001, | 502 | enum { MSTP001, |
@@ -546,6 +561,7 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
546 | static struct clk_lookup lookups[] = { | 561 | static struct clk_lookup lookups[] = { |
547 | /* main clocks */ | 562 | /* main clocks */ |
548 | CLKDEV_CON_ID("r_clk", &r_clk), | 563 | CLKDEV_CON_ID("r_clk", &r_clk), |
564 | CLKDEV_DEV_ID("smp_twd", &twd_clk), /* smp_twd */ | ||
549 | 565 | ||
550 | /* DIV6 clocks */ | 566 | /* DIV6 clocks */ |
551 | CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), | 567 | CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), |