diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-06-18 06:54:43 -0400 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2015-08-10 05:40:43 -0400 |
commit | 1e729d378e75063bf3fa91c62ea372fb73012b24 (patch) | |
tree | b5542fba63f9ff680b764487835e6de3e0d823e0 /drivers/clocksource/timer-atlas7.c | |
parent | 5dd2482c8e7d8108e8d5d59a25f7b7a16d1ea64e (diff) |
clockevents/drivers/atlas7: Migrate to new 'set-state' interface
Migrate atlas7 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.
Cc: Barry Song <baohua@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/timer-atlas7.c')
-rw-r--r-- | drivers/clocksource/timer-atlas7.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c index 60f9de3438b0..27fa13680be1 100644 --- a/drivers/clocksource/timer-atlas7.c +++ b/drivers/clocksource/timer-atlas7.c | |||
@@ -76,7 +76,7 @@ static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) | |||
76 | /* clear timer interrupt */ | 76 | /* clear timer interrupt */ |
77 | writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); | 77 | writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); |
78 | 78 | ||
79 | if (ce->mode == CLOCK_EVT_MODE_ONESHOT) | 79 | if (clockevent_state_oneshot(ce)) |
80 | sirfsoc_timer_count_disable(cpu); | 80 | sirfsoc_timer_count_disable(cpu); |
81 | 81 | ||
82 | ce->event_handler(ce); | 82 | ce->event_handler(ce); |
@@ -117,18 +117,11 @@ static int sirfsoc_timer_set_next_event(unsigned long delta, | |||
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | static void sirfsoc_timer_set_mode(enum clock_event_mode mode, | 120 | /* Oneshot is enabled in set_next_event */ |
121 | struct clock_event_device *ce) | 121 | static int sirfsoc_timer_shutdown(struct clock_event_device *evt) |
122 | { | 122 | { |
123 | switch (mode) { | ||
124 | case CLOCK_EVT_MODE_ONESHOT: | ||
125 | /* enable in set_next_event */ | ||
126 | break; | ||
127 | default: | ||
128 | break; | ||
129 | } | ||
130 | |||
131 | sirfsoc_timer_count_disable(smp_processor_id()); | 123 | sirfsoc_timer_count_disable(smp_processor_id()); |
124 | return 0; | ||
132 | } | 125 | } |
133 | 126 | ||
134 | static void sirfsoc_clocksource_suspend(struct clocksource *cs) | 127 | static void sirfsoc_clocksource_suspend(struct clocksource *cs) |
@@ -193,7 +186,9 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce) | |||
193 | ce->name = "local_timer"; | 186 | ce->name = "local_timer"; |
194 | ce->features = CLOCK_EVT_FEAT_ONESHOT; | 187 | ce->features = CLOCK_EVT_FEAT_ONESHOT; |
195 | ce->rating = 200; | 188 | ce->rating = 200; |
196 | ce->set_mode = sirfsoc_timer_set_mode; | 189 | ce->set_state_shutdown = sirfsoc_timer_shutdown; |
190 | ce->set_state_oneshot = sirfsoc_timer_shutdown; | ||
191 | ce->tick_resume = sirfsoc_timer_shutdown; | ||
197 | ce->set_next_event = sirfsoc_timer_set_next_event; | 192 | ce->set_next_event = sirfsoc_timer_set_next_event; |
198 | clockevents_calc_mult_shift(ce, atlas7_timer_rate, 60); | 193 | clockevents_calc_mult_shift(ce, atlas7_timer_rate, 60); |
199 | ce->max_delta_ns = clockevent_delta2ns(-2, ce); | 194 | ce->max_delta_ns = clockevent_delta2ns(-2, ce); |