aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-12 10:31:13 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-23 13:04:53 -0400
commit57cc4f7de2b896ca79185e337eaf7ff9906c4656 (patch)
treed572d278dfc7d319518b73103905574f0a4b06e2 /arch/arm/common
parent7ff550de99141cbd3be0129d563cc4554fdde9f6 (diff)
clockevents: ARM sp804: allow clockevent name to be specified
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>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/timer-sp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 166f892a24d5..5b7e8c9046be 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -139,7 +139,6 @@ static int sp804_set_next_event(unsigned long next,
139} 139}
140 140
141static struct clock_event_device sp804_clockevent = { 141static struct clock_event_device sp804_clockevent = {
142 .name = "timer0",
143 .shift = 32, 142 .shift = 32,
144 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 143 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
145 .set_mode = sp804_set_mode, 144 .set_mode = sp804_set_mode,
@@ -155,17 +154,19 @@ static struct irqaction sp804_timer_irq = {
155 .dev_id = &sp804_clockevent, 154 .dev_id = &sp804_clockevent,
156}; 155};
157 156
158void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq) 157void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
158 const char *name)
159{ 159{
160 struct clock_event_device *evt = &sp804_clockevent; 160 struct clock_event_device *evt = &sp804_clockevent;
161 161
162 clkevt_base = base; 162 clkevt_base = base;
163 163
164 evt->irq = timer_irq; 164 evt->name = name;
165 evt->irq = irq;
165 evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift); 166 evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift);
166 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt); 167 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
167 evt->min_delta_ns = clockevent_delta2ns(0xf, evt); 168 evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
168 169
169 setup_irq(timer_irq, &sp804_timer_irq); 170 setup_irq(irq, &sp804_timer_irq);
170 clockevents_register_device(evt); 171 clockevents_register_device(evt);
171} 172}