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