powerpc/time: Migrate to new 'set-state' interface
Migrate powerpc driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. We weren't doing anything in ->set_mode(ONSHOT) and so set_state_oneshot() isn't implemented. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
parent
00c5a0acd1
commit
37a13e78e0
|
@ -99,16 +99,17 @@ static struct clocksource clocksource_timebase = {
|
|||
|
||||
static int decrementer_set_next_event(unsigned long evt,
|
||||
struct clock_event_device *dev);
|
||||
static void decrementer_set_mode(enum clock_event_mode mode,
|
||||
struct clock_event_device *dev);
|
||||
static int decrementer_shutdown(struct clock_event_device *evt);
|
||||
|
||||
struct clock_event_device decrementer_clockevent = {
|
||||
.name = "decrementer",
|
||||
.rating = 200,
|
||||
.irq = 0,
|
||||
.set_next_event = decrementer_set_next_event,
|
||||
.set_mode = decrementer_set_mode,
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP,
|
||||
.name = "decrementer",
|
||||
.rating = 200,
|
||||
.irq = 0,
|
||||
.set_next_event = decrementer_set_next_event,
|
||||
.set_state_shutdown = decrementer_shutdown,
|
||||
.tick_resume = decrementer_shutdown,
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT |
|
||||
CLOCK_EVT_FEAT_C3STOP,
|
||||
};
|
||||
EXPORT_SYMBOL(decrementer_clockevent);
|
||||
|
||||
|
@ -862,11 +863,10 @@ static int decrementer_set_next_event(unsigned long evt,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void decrementer_set_mode(enum clock_event_mode mode,
|
||||
struct clock_event_device *dev)
|
||||
static int decrementer_shutdown(struct clock_event_device *dev)
|
||||
{
|
||||
if (mode != CLOCK_EVT_MODE_ONESHOT)
|
||||
decrementer_set_next_event(DECREMENTER_MAX, dev);
|
||||
decrementer_set_next_event(DECREMENTER_MAX, dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Interrupt handler for the timer broadcast IPI */
|
||||
|
|
Loading…
Reference in New Issue