Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57cc4f7d authored by Russell King's avatar Russell King
Browse files

clockevents: ARM sp804: allow clockevent name to be specified



This allows platforms to specify the clcokevent name upon registration.

Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7ff550de
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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);
}
+1 −1
Original line number Diff line number Diff line
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 *);
+1 −1
Original line number Diff line number Diff line
@@ -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 = {
+1 −1
Original line number Diff line number Diff line
@@ -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");
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -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 = {
Loading