Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / arm / mach-imx / localtimer.c
blob3a163515d41f5688c9f950b947c1efb73d861750
1 /*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
13 #include <linux/init.h>
14 #include <linux/clockchips.h>
15 #include <linux/of_address.h>
16 #include <linux/of_irq.h>
17 #include <asm/smp_twd.h>
20 * Setup the local clock events for a CPU.
22 int __cpuinit local_timer_setup(struct clock_event_device *evt)
24 struct device_node *np;
26 np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
27 if (!twd_base) {
28 twd_base = of_iomap(np, 0);
29 WARN_ON(!twd_base);
31 evt->irq = irq_of_parse_and_map(np, 0);
32 twd_timer_setup(evt);
34 return 0;