Lines Matching refs:to

46 static void ostm_timer_stop(struct timer_of *to)
48 if (readb(timer_of_base(to) + OSTM_TE) & TE) {
49 writeb(TT, timer_of_base(to) + OSTM_TT);
52 * Read back the register simply to confirm the write operation
56 while (readb(timer_of_base(to) + OSTM_TE) & TE)
61 static int __init ostm_init_clksrc(struct timer_of *to)
63 ostm_timer_stop(to);
65 writel(0, timer_of_base(to) + OSTM_CMP);
66 writeb(CTL_FREERUN, timer_of_base(to) + OSTM_CTL);
67 writeb(TS, timer_of_base(to) + OSTM_TS);
69 return clocksource_mmio_init(timer_of_base(to) + OSTM_CNT,
70 to->np->full_name, timer_of_rate(to), 300,
79 static void __init ostm_init_sched_clock(struct timer_of *to)
81 system_clock = timer_of_base(to) + OSTM_CNT;
82 sched_clock_register(ostm_read_sched_clock, 32, timer_of_rate(to));
88 struct timer_of *to = to_timer_of(ced);
90 ostm_timer_stop(to);
92 writel(delta, timer_of_base(to) + OSTM_CMP);
93 writeb(CTL_ONESHOT, timer_of_base(to) + OSTM_CTL);
94 writeb(TS, timer_of_base(to) + OSTM_TS);
101 struct timer_of *to = to_timer_of(ced);
103 ostm_timer_stop(to);
109 struct timer_of *to = to_timer_of(ced);
112 ostm_timer_stop(to);
114 writel(timer_of_period(to) - 1, timer_of_base(to) + OSTM_CMP);
115 writeb(CTL_PERIODIC, timer_of_base(to) + OSTM_CTL);
116 writeb(TS, timer_of_base(to) + OSTM_TS);
123 struct timer_of *to = to_timer_of(ced);
125 ostm_timer_stop(to);
144 static int __init ostm_init_clkevt(struct timer_of *to)
146 struct clock_event_device *ced = &to->clkevt;
156 clockevents_config_and_register(ced, timer_of_rate(to), 0xf,
165 struct timer_of *to;
168 to = kzalloc(sizeof(*to), GFP_KERNEL);
169 if (!to)
180 to->flags = TIMER_OF_BASE | TIMER_OF_CLOCK;
185 to->flags |= TIMER_OF_IRQ;
186 to->of_irq.flags = IRQF_TIMER | IRQF_IRQPOLL;
187 to->of_irq.handler = ostm_timer_interrupt;
190 ret = timer_of_init(np, to);
199 ret = ostm_init_clksrc(to);
203 ostm_init_sched_clock(to);
206 ret = ostm_init_clkevt(to);
217 timer_of_cleanup(to);
222 kfree(to);