summary refs log tree commit diff
path: root/drivers/clocksource/pxa_timer.c
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-09-19 21:12:13 +0200
committerRobert Jarzmik <robert.jarzmik@free.fr>2016-10-18 09:12:36 +0200
commitf4e14edf25661f32c9e7323d8a482b8632a6f47f (patch)
treea778fa00549bd28efe7c6ed27c56e1348b8d4aff /drivers/clocksource/pxa_timer.c
parenta758c9b93f5c4e826b3c0849c96c630b1cce8f8d (diff)
downloadlinux-f4e14edf25661f32c9e7323d8a482b8632a6f47f.tar.gz
ARM: sa11x0/pxa: acquire timer rate from the clock rate
As both pxa and sa1100 provide a clock to the timer, the rate can be
inferred from the clock rather than hard encoded in a functional call.

This patch changes the pxa timer to have a mandatory clock which is used
as the timer rate.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/clocksource/pxa_timer.c')
-rw-r--r--drivers/clocksource/pxa_timer.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/clocksource/pxa_timer.c b/drivers/clocksource/pxa_timer.c
index 3e1cb512f3ce..9cae38eebec2 100644
--- a/drivers/clocksource/pxa_timer.c
+++ b/drivers/clocksource/pxa_timer.c
@@ -220,17 +220,16 @@ CLOCKSOURCE_OF_DECLARE(pxa_timer, "marvell,pxa-timer", pxa_timer_dt_init);
 /*
  * Legacy timer init for non device-tree boards.
  */
-void __init pxa_timer_nodt_init(int irq, void __iomem *base,
-	unsigned long clock_tick_rate)
+void __init pxa_timer_nodt_init(int irq, void __iomem *base)
 {
 	struct clk *clk;
 
 	timer_base = base;
 	clk = clk_get(NULL, "OSTIMER0");
-	if (clk && !IS_ERR(clk))
+	if (clk && !IS_ERR(clk)) {
 		clk_prepare_enable(clk);
-	else
+		pxa_timer_common_init(irq, clk_get_rate(clk));
+	} else {
 		pr_crit("%s: unable to get clk\n", __func__);
-
-	pxa_timer_common_init(irq, clock_tick_rate);
+	}
 }