Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Viresh Kumar and committed by
Daniel Lezcano
b4cf5d71 49969784

+5 -12
+5 -12
drivers/clocksource/bcm_kona_timer.c
··· 127 127 return 0; 128 128 } 129 129 130 - static void kona_timer_set_mode(enum clock_event_mode mode, 131 - struct clock_event_device *unused) 130 + static int kona_timer_shutdown(struct clock_event_device *evt) 132 131 { 133 - switch (mode) { 134 - case CLOCK_EVT_MODE_ONESHOT: 135 - /* by default mode is one shot don't do any thing */ 136 - break; 137 - case CLOCK_EVT_MODE_UNUSED: 138 - case CLOCK_EVT_MODE_SHUTDOWN: 139 - default: 140 - kona_timer_disable_and_clear(timers.tmr_regs); 141 - } 132 + kona_timer_disable_and_clear(timers.tmr_regs); 133 + return 0; 142 134 } 143 135 144 136 static struct clock_event_device kona_clockevent_timer = { 145 137 .name = "timer 1", 146 138 .features = CLOCK_EVT_FEAT_ONESHOT, 147 139 .set_next_event = kona_timer_set_next_event, 148 - .set_mode = kona_timer_set_mode 140 + .set_state_shutdown = kona_timer_shutdown, 141 + .tick_resume = kona_timer_shutdown, 149 142 }; 150 143 151 144 static void __init kona_timer_clockevents_init(void)