Thread (22 messages) 22 messages, 4 authors, 2012-04-25
STALE5194d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 4/8] ARM: mxs: request clock for timer

From: Shawn Guo <hidden>
Date: 2012-04-21 15:57:16
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

When mxs_timer_init() does not have a timer_clk passed in, it should
try to request clock from clkdev system.

Signed-off-by: Shawn Guo <redacted>
---
 arch/arm/mach-mxs/timer.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 564a632..575e8fd 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -20,6 +20,7 @@
  * MA 02110-1301, USA.
  */
 
+#include <linux/err.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/clockchips.h>
@@ -245,6 +246,14 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
 
 void __init mxs_timer_init(struct clk *timer_clk, int irq)
 {
+	if (!timer_clk) {
+		timer_clk = clk_get_sys("timrot", NULL);
+		if (IS_ERR(timer_clk)) {
+			pr_err("%s: failed to get clk\n", __func__);
+			return;
+		}
+	}
+
 	clk_prepare_enable(timer_clk);
 
 	/*
-- 
1.7.5.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help