]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ARM: sa11x0/pxa: acquire timer rate from the clock rate
authorRobert Jarzmik <robert.jarzmik@free.fr>
Mon, 19 Sep 2016 19:12:13 +0000 (21:12 +0200)
committerRobert Jarzmik <robert.jarzmik@free.fr>
Tue, 18 Oct 2016 07:12:36 +0000 (09:12 +0200)
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>
arch/arm/mach-pxa/generic.c
arch/arm/mach-sa1100/generic.c
drivers/clocksource/pxa_timer.c
include/clocksource/pxa.h

index ec510ecf83702f90d376369e799ab97d0bd5780b..2a9297991d740c0d38b6e370afd2a89f809d65c0 100644 (file)
@@ -69,8 +69,7 @@ void __init pxa_timer_init(void)
                pxa27x_clocks_init();
        if (cpu_is_pxa3xx())
                pxa3xx_clocks_init();
-       pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
-                           get_clock_tick_rate());
+       pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000));
 }
 
 /*
index 3e09beddb6e8f4e84e0863691c7d33c91bae404a..2eb00691b07db3ecab5cf6608159fc30ec1702ec 100644 (file)
@@ -378,7 +378,7 @@ void __init sa1100_map_io(void)
 
 void __init sa1100_timer_init(void)
 {
-       pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000), 3686400);
+       pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x90000000));
 }
 
 static struct resource irq_resource =
index 3e1cb512f3ce962a81b32b5c5ea7ddc1ea5d1b0b..9cae38eebec2c770cf945171064081c125a8a5b9 100644 (file)
@@ -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);
+       }
 }
index 1efbe5a669586bf368160cb4bd8ae1ae18819dfc..a9a0f03024a4819af84a85841b1d0757b54d610e 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef _CLOCKSOURCE_PXA_H
 #define _CLOCKSOURCE_PXA_H
 
-extern void pxa_timer_nodt_init(int irq, void __iomem *base,
-                          unsigned long clock_tick_rate);
+extern void pxa_timer_nodt_init(int irq, void __iomem *base);
 
 #endif