aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-03-25 02:53:08 -0400
committerShawn Guo <shawn.guo@linaro.org>2013-04-01 04:30:01 -0400
commit633ef4c7d18982d184242d42056c622a433d93fe (patch)
tree083c25c02198299cd32d855ffd4b35224e4f7771 /arch
parent3ed628a8122112ee796cd643e2478c4a6def234c (diff)
ARM: mxs: use CLKSRC_OF helper to initialize timer
Select CLKSRC_OF and use clocksource_of_init() to initialize timer, so that the call to mxs_timer_init() in clock driver can be removed. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h1
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c3
-rw-r--r--arch/arm/mach-mxs/timer.c10
4 files changed, 6 insertions, 9 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 865c25ded153..5a1f0c9e0ab0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -473,6 +473,7 @@ config ARCH_MXS
473 select ARCH_REQUIRE_GPIOLIB 473 select ARCH_REQUIRE_GPIOLIB
474 select CLKDEV_LOOKUP 474 select CLKDEV_LOOKUP
475 select CLKSRC_MMIO 475 select CLKSRC_MMIO
476 select CLKSRC_OF
476 select COMMON_CLK 477 select COMMON_CLK
477 select GENERIC_CLOCKEVENTS 478 select GENERIC_CLOCKEVENTS
478 select HAVE_CLK_PREPARE 479 select HAVE_CLK_PREPARE
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index be5a9c93cb2a..e043c4735b5a 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -13,7 +13,6 @@
13 13
14extern const u32 *mxs_get_ocotp(void); 14extern const u32 *mxs_get_ocotp(void);
15extern int mxs_reset_block(void __iomem *); 15extern int mxs_reset_block(void __iomem *);
16extern void mxs_timer_init(void);
17extern void mxs_restart(char, const char *); 16extern void mxs_restart(char, const char *);
18extern int mxs_saif_clkmux_select(unsigned int clkmux); 17extern int mxs_saif_clkmux_select(unsigned int clkmux);
19 18
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index e7b781d3788f..c1c0fb414c28 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clkdev.h> 14#include <linux/clkdev.h>
15#include <linux/clocksource.h>
15#include <linux/can/platform/flexcan.h> 16#include <linux/can/platform/flexcan.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
17#include <linux/err.h> 18#include <linux/err.h>
@@ -168,11 +169,13 @@ static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
168static void __init imx23_timer_init(void) 169static void __init imx23_timer_init(void)
169{ 170{
170 mx23_clocks_init(); 171 mx23_clocks_init();
172 clocksource_of_init();
171} 173}
172 174
173static void __init imx28_timer_init(void) 175static void __init imx28_timer_init(void)
174{ 176{
175 mx28_clocks_init(); 177 mx28_clocks_init();
178 clocksource_of_init();
176} 179}
177 180
178enum mac_oui { 181enum mac_oui {
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 421020498a1b..fe2903d7939a 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -242,18 +242,11 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
242 return 0; 242 return 0;
243} 243}
244 244
245void __init mxs_timer_init(void) 245static void __init mxs_timer_init(struct device_node *np)
246{ 246{
247 struct device_node *np;
248 struct clk *timer_clk; 247 struct clk *timer_clk;
249 int irq; 248 int irq;
250 249
251 np = of_find_compatible_node(NULL, NULL, "fsl,timrot");
252 if (!np) {
253 pr_err("%s: failed find timrot node\n", __func__);
254 return;
255 }
256
257 timer_clk = clk_get_sys("timrot", NULL); 250 timer_clk = clk_get_sys("timrot", NULL);
258 if (IS_ERR(timer_clk)) { 251 if (IS_ERR(timer_clk)) {
259 pr_err("%s: failed to get clk\n", __func__); 252 pr_err("%s: failed to get clk\n", __func__);
@@ -304,3 +297,4 @@ void __init mxs_timer_init(void)
304 irq = irq_of_parse_and_map(np, 0); 297 irq = irq_of_parse_and_map(np, 0);
305 setup_irq(irq, &mxs_timer_irq); 298 setup_irq(irq, &mxs_timer_irq);
306} 299}
300CLOCKSOURCE_OF_DECLARE(mxs, "fsl,timrot", mxs_timer_init)