Lines Matching refs:to

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