diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-03-09 03:29:27 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-25 11:03:45 -0400 |
commit | 821dc4dfd955da0679872088025542a0795c6b3e (patch) | |
tree | 0f36bc43b9bf76106d43524bd61fbd745da48bd7 /arch/arm/plat-mxc | |
parent | 096c19c37b43ee8ce04d4f27022f899ef4133fbb (diff) |
ARM i.MX timer: request correct clock
We used to pass the timer clock directly to mxc_timer_init. We
should instead request the correct clock. This is an intermediate
step: For now we request the clock in the timer code when NULL
is passed as clock.
Also, the gpt on some i.MX have an additional ipg clock which can
be gated. Request and enable this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/time.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index 7daf7c9a413b..99f958ca6cb8 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/clockchips.h> | 26 | #include <linux/clockchips.h> |
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/err.h> | ||
28 | 29 | ||
29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
30 | #include <asm/sched_clock.h> | 31 | #include <asm/sched_clock.h> |
@@ -282,6 +283,19 @@ static int __init mxc_clockevent_init(struct clk *timer_clk) | |||
282 | void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | 283 | void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) |
283 | { | 284 | { |
284 | uint32_t tctl_val; | 285 | uint32_t tctl_val; |
286 | struct clk *timer_ipg_clk; | ||
287 | |||
288 | if (!timer_clk) { | ||
289 | timer_clk = clk_get_sys("imx-gpt.0", "per"); | ||
290 | if (IS_ERR(timer_clk)) { | ||
291 | pr_err("i.MX timer: unable to get clk\n"); | ||
292 | return; | ||
293 | } | ||
294 | |||
295 | timer_ipg_clk = clk_get_sys("imx-gpt.0", "ipg"); | ||
296 | if (!IS_ERR(timer_ipg_clk)) | ||
297 | clk_prepare_enable(timer_ipg_clk); | ||
298 | } | ||
285 | 299 | ||
286 | clk_prepare_enable(timer_clk); | 300 | clk_prepare_enable(timer_clk); |
287 | 301 | ||