Commit c4779902 authored by Linus Walleij's avatar Linus Walleij Committed by Daniel Lezcano

clocksource/drivers/fttmr010: Factor out clock read code

The sched_clock() and delay timer callbacks can just call
each other and we can save an #ifdef.
Suggested-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 385c98fc
...@@ -98,30 +98,26 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt) ...@@ -98,30 +98,26 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt)
return container_of(evt, struct fttmr010, clkevt); return container_of(evt, struct fttmr010, clkevt);
} }
static u64 notrace fttmr010_read_sched_clock_up(void) static unsigned long fttmr010_read_current_timer_up(void)
{ {
return readl(local_fttmr->base + TIMER2_COUNT); return readl(local_fttmr->base + TIMER2_COUNT);
} }
static u64 notrace fttmr010_read_sched_clock_down(void) static unsigned long fttmr010_read_current_timer_down(void)
{ {
return ~readl(local_fttmr->base + TIMER2_COUNT); return ~readl(local_fttmr->base + TIMER2_COUNT);
} }
#ifdef CONFIG_ARM static u64 notrace fttmr010_read_sched_clock_up(void)
static unsigned long fttmr010_read_current_timer_up(void)
{ {
return readl(local_fttmr->base + TIMER2_COUNT); return fttmr010_read_current_timer_up();
} }
static unsigned long fttmr010_read_current_timer_down(void) static u64 notrace fttmr010_read_sched_clock_down(void)
{ {
return ~readl(local_fttmr->base + TIMER2_COUNT); return fttmr010_read_current_timer_down();
} }
#endif
static int fttmr010_timer_set_next_event(unsigned long cycles, static int fttmr010_timer_set_next_event(unsigned long cycles,
struct clock_event_device *evt) struct clock_event_device *evt)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment