diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-08-20 04:51:45 +0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-09-03 05:31:50 +0400 |
commit | eeca6e604032af8336baafef84144dd47f5a0f99 (patch) | |
tree | cff564b1bf3de3ead8186fac9dec332a0cf3a170 /arch/arm/mach-mxs | |
parent | 0b76c5412146c1c9e8aef495d2926f31351bc3c0 (diff) | |
download | linux-eeca6e604032af8336baafef84144dd47f5a0f99.tar.xz |
ARM: mxs: retrieve timer irq from device tree
Rather than using the static timer irq definition, we should retrieve
timer irq from device tree for better.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/include/mach/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mxs/timer.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h index de6c7ba42544..a7416c8a85ff 100644 --- a/arch/arm/mach-mxs/include/mach/common.h +++ b/arch/arm/mach-mxs/include/mach/common.h @@ -13,7 +13,7 @@ extern const u32 *mxs_get_ocotp(void); extern int mxs_reset_block(void __iomem *); -extern void mxs_timer_init(int); +extern void mxs_timer_init(void); extern void mxs_restart(char, const char *); extern int mxs_saif_clkmux_select(unsigned int clkmux); diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 02d36de9c4e8..7c3792613392 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c @@ -25,6 +25,8 @@ #include <linux/irq.h> #include <linux/clockchips.h> #include <linux/clk.h> +#include <linux/of.h> +#include <linux/of_irq.h> #include <asm/mach/time.h> #include <mach/mxs.h> @@ -244,9 +246,17 @@ static int __init mxs_clocksource_init(struct clk *timer_clk) return 0; } -void __init mxs_timer_init(int irq) +void __init mxs_timer_init(void) { + struct device_node *np; struct clk *timer_clk; + int irq; + + np = of_find_compatible_node(NULL, NULL, "fsl,timrot"); + if (!np) { + pr_err("%s: failed find timrot node\n", __func__); + return; + } timer_clk = clk_get_sys("timrot", NULL); if (IS_ERR(timer_clk)) { @@ -295,5 +305,6 @@ void __init mxs_timer_init(int irq) mxs_clockevent_init(timer_clk); /* Make irqs happen */ + irq = irq_of_parse_and_map(np, 0); setup_irq(irq, &mxs_timer_irq); } |