32 static long __init sp804_get_clock_rate(
const char *
name)
40 pr_err(
"sp804: %s clock not found: %d\n", name,
47 pr_err(
"sp804: %s clock failed to prepare: %d\n", name, err);
54 pr_err(
"sp804: %s clock failed to enable: %d\n", name, err);
62 pr_err(
"sp804: %s clock failed to get rate: %ld\n", name, rate);
71 static void __iomem *sched_clock_base;
73 static u32 sp804_read(
void)
82 long rate = sp804_get_clock_rate(name);
97 if (use_sched_clock) {
98 sched_clock_base = base;
104 static void __iomem *clkevt_base;
105 static unsigned long clkevt_reload;
117 evt->event_handler(evt);
122 static void sp804_set_mode(
enum clock_event_mode
mode,
123 struct clock_event_device *evt)
130 case CLOCK_EVT_MODE_PERIODIC:
135 case CLOCK_EVT_MODE_ONESHOT:
140 case CLOCK_EVT_MODE_UNUSED:
141 case CLOCK_EVT_MODE_SHUTDOWN:
149 static int sp804_set_next_event(
unsigned long next,
150 struct clock_event_device *evt)
160 static struct clock_event_device sp804_clockevent = {
161 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
162 .set_mode = sp804_set_mode,
163 .set_next_event = sp804_set_next_event,
167 static struct irqaction sp804_timer_irq = {
170 .handler = sp804_timer_interrupt,
171 .dev_id = &sp804_clockevent,
177 struct clock_event_device *evt = &sp804_clockevent;
178 long rate = sp804_get_clock_rate(name);