Lines Matching refs:t

103 #define USING_COMPARE(t)		((t)->opts & TIMER_OPTS_USE_COMPARE)  argument
112 static int timer32_config(struct timer_s *t) in timer32_config() argument
117 if (USING_COMPARE(t)) { in timer32_config()
128 __raw_writel(__raw_readl(t->base + t->tim_off) + t->period, in timer32_config()
129 t->base + dtip[event_timer].cmp_off); in timer32_config()
131 tcr = __raw_readl(t->base + TCR); in timer32_config()
134 tcr &= ~(TCR_ENAMODE_MASK << t->enamode_shift); in timer32_config()
135 __raw_writel(tcr, t->base + TCR); in timer32_config()
138 __raw_writel(0, t->base + t->tim_off); in timer32_config()
139 __raw_writel(t->period, t->base + t->prd_off); in timer32_config()
142 if (t->opts & TIMER_OPTS_ONESHOT) in timer32_config()
143 tcr |= TCR_ENAMODE_ONESHOT << t->enamode_shift; in timer32_config()
144 else if (t->opts & TIMER_OPTS_PERIODIC) in timer32_config()
145 tcr |= TCR_ENAMODE_PERIODIC << t->enamode_shift; in timer32_config()
147 __raw_writel(tcr, t->base + TCR); in timer32_config()
152 static inline u32 timer32_read(struct timer_s *t) in timer32_read() argument
154 return __raw_readl(t->base + t->tim_off); in timer32_read()
229 struct timer_s *t = &timers[i]; in timer_init() local
230 int timer = ID_TO_TIMER(t->id); in timer_init()
233 t->base = base[timer]; in timer_init()
234 if (!t->base) in timer_init()
237 if (IS_TIMER_BOT(t->id)) { in timer_init()
238 t->enamode_shift = 6; in timer_init()
239 t->tim_off = TIM12; in timer_init()
240 t->prd_off = PRD12; in timer_init()
243 t->enamode_shift = 22; in timer_init()
244 t->tim_off = TIM34; in timer_init()
245 t->prd_off = PRD34; in timer_init()
250 t->irqaction.name = t->name; in timer_init()
251 t->irqaction.dev_id = (void *)t; in timer_init()
253 if (t->irqaction.handler != NULL) { in timer_init()
254 irq = USING_COMPARE(t) ? dtip[i].cmp_irq : irq; in timer_init()
255 setup_irq(irq, &t->irqaction); in timer_init()
265 struct timer_s *t = &timers[TID_CLOCKSOURCE]; in read_cycles() local
267 return (cycles_t)timer32_read(t); in read_cycles()
291 struct timer_s *t = &timers[TID_CLOCKEVENT]; in davinci_set_next_event() local
293 t->period = cycles; in davinci_set_next_event()
294 timer32_config(t); in davinci_set_next_event()
300 struct timer_s *t = &timers[TID_CLOCKEVENT]; in davinci_shutdown() local
302 t->opts &= ~TIMER_OPTS_STATE_MASK; in davinci_shutdown()
303 t->opts |= TIMER_OPTS_DISABLED; in davinci_shutdown()
309 struct timer_s *t = &timers[TID_CLOCKEVENT]; in davinci_set_oneshot() local
311 t->opts &= ~TIMER_OPTS_STATE_MASK; in davinci_set_oneshot()
312 t->opts |= TIMER_OPTS_ONESHOT; in davinci_set_oneshot()
318 struct timer_s *t = &timers[TID_CLOCKEVENT]; in davinci_set_periodic() local
320 t->period = davinci_clock_tick_rate / (HZ); in davinci_set_periodic()
321 t->opts &= ~TIMER_OPTS_STATE_MASK; in davinci_set_periodic()
322 t->opts |= TIMER_OPTS_PERIODIC; in davinci_set_periodic()
323 timer32_config(t); in davinci_set_periodic()