clockevents: ARM sp804: allow clockevent name to be specified
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 12 May 2011 14:31:13 +0000 (15:31 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 23 May 2011 17:04:53 +0000 (18:04 +0100)
This allows platforms to specify the clcokevent name upon registration.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/timer-sp.c
arch/arm/include/asm/hardware/timer-sp.h
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-realview/core.c
arch/arm/mach-versatile/core.c
arch/arm/mach-vexpress/ct-ca9x4.c
arch/arm/mach-vexpress/v2m.c

index 166f892a24d5d0f9a09701f9605ab3198888d6be..5b7e8c9046bef37d904feca7300c5b81582f137f 100644 (file)
@@ -139,7 +139,6 @@ static int sp804_set_next_event(unsigned long next,
 }
 
 static struct clock_event_device sp804_clockevent = {
-       .name           = "timer0",
        .shift          = 32,
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode       = sp804_set_mode,
@@ -155,17 +154,19 @@ static struct irqaction sp804_timer_irq = {
        .dev_id         = &sp804_clockevent,
 };
 
-void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq)
+void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
+       const char *name)
 {
        struct clock_event_device *evt = &sp804_clockevent;
 
        clkevt_base = base;
 
-       evt->irq = timer_irq;
+       evt->name = name;
+       evt->irq = irq;
        evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift);
        evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
        evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
 
-       setup_irq(timer_irq, &sp804_timer_irq);
+       setup_irq(irq, &sp804_timer_irq);
        clockevents_register_device(evt);
 }
index 11c386bbbf3631daf2ab2d2f9d7d463a36c0d838..4384d81eee79d4f456589541d8ea957ca598d50a 100644 (file)
@@ -1,2 +1,2 @@
 void sp804_clocksource_init(void __iomem *, const char *);
-void sp804_clockevents_init(void __iomem *, unsigned int);
+void sp804_clockevents_init(void __iomem *, unsigned int, const char *);
index 8fb8afb014efc16ee81916628fead06e6b3e2e38..c4914c69462bbface8ac24fb02a6dd4eb7c11e2d 100644 (file)
@@ -484,7 +484,7 @@ static void __init intcp_timer_init(void)
        writel(0, TIMER2_VA_BASE + TIMER_CTRL);
 
        sp804_clocksource_init(TIMER2_VA_BASE, "timer2");
-       sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1);
+       sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
 }
 
 static struct sys_timer cp_timer = {
index 6a9cd1eb4c2e23b080764ecbf46c4952d3f7339d..9f5155507d2760e2e7aa3bbdb6e723f4b27cf549 100644 (file)
@@ -553,7 +553,7 @@ void __init realview_timer_init(unsigned int timer_irq)
        writel(0, timer3_va_base + TIMER_CTRL);
 
        sp804_clocksource_init(timer3_va_base, "timer3");
-       sp804_clockevents_init(timer0_va_base, timer_irq);
+       sp804_clockevents_init(timer0_va_base, timer_irq, "timer0");
 }
 
 /*
index b0b7de6875ab7da90367d650769ab24c868314ca..4e78c379c5c6ddc611375a98efb699ce8d3a77f9 100644 (file)
@@ -772,7 +772,7 @@ static void __init versatile_timer_init(void)
        writel(0, TIMER3_VA_BASE + TIMER_CTRL);
 
        sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
-       sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1);
+       sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
 }
 
 struct sys_timer versatile_timer = {
index 6004f06cbde5e66d77228700f189a37847378b3b..271213384203182b8be69f97013daa421453bc41 100644 (file)
@@ -72,7 +72,8 @@ static void __init ct_ca9x4_timer_init(void)
        writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
 
        sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), "ct-timer1");
-       sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0);
+       sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0,
+               "ct-timer0");
 }
 
 static struct sys_timer ct_ca9x4_timer = {
index 77d5db3d7808e9045172ccae544514c3fab1e1d0..f6fecdd0fbe8c5bb9b2308da1f0803747d7fb643 100644 (file)
@@ -66,7 +66,8 @@ static void __init v2m_timer_init(void)
        writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
 
        sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), "v2m-timer1");
-       sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
+       sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0,
+               "v2m-timer0");
 }
 
 static struct sys_timer v2m_timer = {