clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface
Migrate bcm_kona driver to the new 'set-state' interface provided by the 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. Oneshot callback isn't required as it was empty. Acked-by: Ray Jui <rjui@broadcom.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
parent
4996978490
commit
b4cf5d710f
1 changed files with 5 additions and 12 deletions
|
@ -127,25 +127,18 @@ static int kona_timer_set_next_event(unsigned long clc,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kona_timer_set_mode(enum clock_event_mode mode,
|
static int kona_timer_shutdown(struct clock_event_device *evt)
|
||||||
struct clock_event_device *unused)
|
|
||||||
{
|
{
|
||||||
switch (mode) {
|
kona_timer_disable_and_clear(timers.tmr_regs);
|
||||||
case CLOCK_EVT_MODE_ONESHOT:
|
return 0;
|
||||||
/* by default mode is one shot don't do any thing */
|
|
||||||
break;
|
|
||||||
case CLOCK_EVT_MODE_UNUSED:
|
|
||||||
case CLOCK_EVT_MODE_SHUTDOWN:
|
|
||||||
default:
|
|
||||||
kona_timer_disable_and_clear(timers.tmr_regs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct clock_event_device kona_clockevent_timer = {
|
static struct clock_event_device kona_clockevent_timer = {
|
||||||
.name = "timer 1",
|
.name = "timer 1",
|
||||||
.features = CLOCK_EVT_FEAT_ONESHOT,
|
.features = CLOCK_EVT_FEAT_ONESHOT,
|
||||||
.set_next_event = kona_timer_set_next_event,
|
.set_next_event = kona_timer_set_next_event,
|
||||||
.set_mode = kona_timer_set_mode
|
.set_state_shutdown = kona_timer_shutdown,
|
||||||
|
.tick_resume = kona_timer_shutdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __init kona_timer_clockevents_init(void)
|
static void __init kona_timer_clockevents_init(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue