summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/timer.c
diff options
context:
space:
mode:
authorShawn Guo2012-04-28 18:02:37 +0200
committerShawn Guo2012-05-08 18:02:39 +0200
commit39d1367e11e406ddb9bcd5f2e4798f3c355db7d9 (patch)
treedbb5eb076cd1268d1e52529afe3d351755d9bb86 /arch/arm/mach-mxs/timer.c
parentclk: mxs: add clock support for imx28 (diff)
downloadkernel-qcow2-linux-39d1367e11e406ddb9bcd5f2e4798f3c355db7d9.tar.gz
kernel-qcow2-linux-39d1367e11e406ddb9bcd5f2e4798f3c355db7d9.tar.xz
kernel-qcow2-linux-39d1367e11e406ddb9bcd5f2e4798f3c355db7d9.zip
ARM: mxs: request clock for timer
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 <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs/timer.c')
-rw-r--r--arch/arm/mach-mxs/timer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 564a63279f18..575e8fd6bc79 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);
/*