Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+8 -11
+1 -2
arch/arm/mach-pxa/generic.c
··· 69 69 pxa27x_clocks_init(); 70 70 if (cpu_is_pxa3xx()) 71 71 pxa3xx_clocks_init(); 72 - pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000), 73 - get_clock_tick_rate()); 72 + pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000)); 74 73 } 75 74 76 75 /*
+1 -1
arch/arm/mach-sa1100/generic.c
··· 378 378 379 379 void __init sa1100_timer_init(void) 380 380 { 381 - pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000), 3686400); 381 + pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000)); 382 382 } 383 383 384 384 static struct resource irq_resource =
+5 -6
drivers/clocksource/pxa_timer.c
··· 220 220 /* 221 221 * Legacy timer init for non device-tree boards. 222 222 */ 223 - void __init pxa_timer_nodt_init(int irq, void __iomem *base, 224 - unsigned long clock_tick_rate) 223 + void __init pxa_timer_nodt_init(int irq, void __iomem *base) 225 224 { 226 225 struct clk *clk; 227 226 228 227 timer_base = base; 229 228 clk = clk_get(NULL, "OSTIMER0"); 230 - if (clk && !IS_ERR(clk)) 229 + if (clk && !IS_ERR(clk)) { 231 230 clk_prepare_enable(clk); 232 - else 231 + pxa_timer_common_init(irq, clk_get_rate(clk)); 232 + } else { 233 233 pr_crit("%s: unable to get clk\n", __func__); 234 - 235 - pxa_timer_common_init(irq, clock_tick_rate); 234 + } 236 235 }
+1 -2
include/clocksource/pxa.h
··· 12 12 #ifndef _CLOCKSOURCE_PXA_H 13 13 #define _CLOCKSOURCE_PXA_H 14 14 15 - extern void pxa_timer_nodt_init(int irq, void __iomem *base, 16 - unsigned long clock_tick_rate); 15 + extern void pxa_timer_nodt_init(int irq, void __iomem *base); 17 16 18 17 #endif