From eeca6e604032af8336baafef84144dd47f5a0f99 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Mon, 20 Aug 2012 08:51:45 +0800 Subject: 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 --- arch/arm/mach-mxs/timer.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-mxs/timer.c') 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 #include #include +#include +#include #include #include @@ -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); } -- cgit v1.2.3