Skip to content

Commit f4e14ed

Browse files
committed
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>
1 parent a758c9b commit f4e14ed

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

arch/arm/mach-pxa/generic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ void __init pxa_timer_init(void)
6969
pxa27x_clocks_init();
7070
if (cpu_is_pxa3xx())
7171
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));
7473
}
7574

7675
/*

arch/arm/mach-sa1100/generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void __init sa1100_map_io(void)
378378

379379
void __init sa1100_timer_init(void)
380380
{
381-
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000), 3686400);
381+
pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000));
382382
}
383383

384384
static struct resource irq_resource =

drivers/clocksource/pxa_timer.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,16 @@ CLOCKSOURCE_OF_DECLARE(pxa_timer, "marvell,pxa-timer", pxa_timer_dt_init);
220220
/*
221221
* Legacy timer init for non device-tree boards.
222222
*/
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)
225224
{
226225
struct clk *clk;
227226

228227
timer_base = base;
229228
clk = clk_get(NULL, "OSTIMER0");
230-
if (clk && !IS_ERR(clk))
229+
if (clk && !IS_ERR(clk)) {
231230
clk_prepare_enable(clk);
232-
else
231+
pxa_timer_common_init(irq, clk_get_rate(clk));
232+
} else {
233233
pr_crit("%s: unable to get clk\n", __func__);
234-
235-
pxa_timer_common_init(irq, clock_tick_rate);
234+
}
236235
}

include/clocksource/pxa.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#ifndef _CLOCKSOURCE_PXA_H
1313
#define _CLOCKSOURCE_PXA_H
1414

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);
1716

1817
#endif

0 commit comments

Comments
 (0)