diff mbox

[v2,4/4] arm: pxa: add non device-tree timer link to clocksource

Message ID 1404558781-9537-4-git-send-email-robert.jarzmik@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Jarzmik July 5, 2014, 11:13 a.m. UTC
As clocksource pxa_timer was moved to clocksource framework, the
pxa_timer initialization needs to be a bit amended, to pass the
necessary informations to clocksource, ie :
 - the timer interrupt (mach specific)
 - the timer registers base (ditto)
 - the timer clockrate

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/mach-pxa/generic.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Arnd Bergmann July 5, 2014, 6:29 p.m. UTC | #1
On Saturday 05 July 2014 13:13:01 Robert Jarzmik wrote:
>  EXPORT_SYMBOL(get_clock_tick_rate);
>  
>  /*
> + * For non device-tree builds, keep legacy timer init
> + */
> +extern void pxa_timer_nodt_init(int irq, void __iomem *base,
> +                          unsigned long clock_tick_rate);
> +void pxa_timer_init(void)
> +{
> +       pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
> +                           get_clock_tick_rate());
> +}
> +

I think it would be better to move the extern declaration into 
a new header file, e.g. include/clocksource/pxa.h.

	Arnd
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 4225417..2dcded5 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -25,6 +25,7 @@ 
 #include <asm/mach/map.h>
 #include <asm/mach-types.h>
 
+#include <mach/irqs.h>
 #include <mach/reset.h>
 #include <mach/smemc.h>
 #include <mach/pxa3xx-regs.h>
@@ -57,6 +58,17 @@  unsigned long get_clock_tick_rate(void)
 EXPORT_SYMBOL(get_clock_tick_rate);
 
 /*
+ * For non device-tree builds, keep legacy timer init
+ */
+extern void pxa_timer_nodt_init(int irq, void __iomem *base,
+			   unsigned long clock_tick_rate);
+void pxa_timer_init(void)
+{
+	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
+			    get_clock_tick_rate());
+}
+
+/*
  * Get the clock frequency as reflected by CCCR and the turbo flag.
  * We assume these values have been applied via a fcs.
  * If info is not 0 we also display the current settings.