Lines Matching refs:to
44 static void ostm_timer_stop(struct timer_of *to)
46 if (readb(timer_of_base(to) + OSTM_TE) & TE) {
47 writeb(TT, timer_of_base(to) + OSTM_TT);
50 * Read back the register simply to confirm the write operation
54 while (readb(timer_of_base(to) + OSTM_TE) & TE)
59 static int __init ostm_init_clksrc(struct timer_of *to)
61 ostm_timer_stop(to);
63 writel(0, timer_of_base(to) + OSTM_CMP);
64 writeb(CTL_FREERUN, timer_of_base(to) + OSTM_CTL);
65 writeb(TS, timer_of_base(to) + OSTM_TS);
67 return clocksource_mmio_init(timer_of_base(to) + OSTM_CNT,
68 to->np->full_name, timer_of_rate(to), 300,
77 static void __init ostm_init_sched_clock(struct timer_of *to)
79 system_clock = timer_of_base(to) + OSTM_CNT;
80 sched_clock_register(ostm_read_sched_clock, 32, timer_of_rate(to));
86 struct timer_of *to = to_timer_of(ced);
88 ostm_timer_stop(to);
90 writel(delta, timer_of_base(to) + OSTM_CMP);
91 writeb(CTL_ONESHOT, timer_of_base(to) + OSTM_CTL);
92 writeb(TS, timer_of_base(to) + OSTM_TS);
99 struct timer_of *to = to_timer_of(ced);
101 ostm_timer_stop(to);
107 struct timer_of *to = to_timer_of(ced);
110 ostm_timer_stop(to);
112 writel(timer_of_period(to) - 1, timer_of_base(to) + OSTM_CMP);
113 writeb(CTL_PERIODIC, timer_of_base(to) + OSTM_CTL);
114 writeb(TS, timer_of_base(to) + OSTM_TS);
121 struct timer_of *to = to_timer_of(ced);
123 ostm_timer_stop(to);
142 static int __init ostm_init_clkevt(struct timer_of *to)
144 struct clock_event_device *ced = &to->clkevt;
154 clockevents_config_and_register(ced, timer_of_rate(to), 0xf,
162 struct timer_of *to;
165 to = kzalloc(sizeof(*to), GFP_KERNEL);
166 if (!to)
169 to->flags = TIMER_OF_BASE | TIMER_OF_CLOCK;
174 to->flags |= TIMER_OF_IRQ;
175 to->of_irq.flags = IRQF_TIMER | IRQF_IRQPOLL;
176 to->of_irq.handler = ostm_timer_interrupt;
179 ret = timer_of_init(np, to);
188 ret = ostm_init_clksrc(to);
192 ostm_init_sched_clock(to);
195 ret = ostm_init_clkevt(to);
205 timer_of_cleanup(to);
207 kfree(to);