Lines Matching refs:gtm

69 struct gtm {  struct
89 struct gtm *gtm; in gtm_get_timer16() argument
92 list_for_each_entry(gtm, &gtms, list_node) { in gtm_get_timer16()
93 spin_lock_irq(&gtm->lock); in gtm_get_timer16()
95 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { in gtm_get_timer16()
96 if (!gtm->timers[i].requested) { in gtm_get_timer16()
97 gtm->timers[i].requested = true; in gtm_get_timer16()
98 spin_unlock_irq(&gtm->lock); in gtm_get_timer16()
99 return &gtm->timers[i]; in gtm_get_timer16()
103 spin_unlock_irq(&gtm->lock); in gtm_get_timer16()
122 struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm, in gtm_get_specific_timer16() argument
130 spin_lock_irq(&gtm->lock); in gtm_get_specific_timer16()
132 if (gtm->timers[timer].requested) in gtm_get_specific_timer16()
135 ret = &gtm->timers[timer]; in gtm_get_specific_timer16()
139 spin_unlock_irq(&gtm->lock); in gtm_get_specific_timer16()
155 spin_lock_irq(&tmr->gtm->lock); in gtm_put_timer16()
157 spin_unlock_irq(&tmr->gtm->lock); in gtm_put_timer16()
168 struct gtm *gtm = tmr->gtm; in gtm_set_ref_timer16() local
169 int num = tmr - &gtm->timers[0]; in gtm_set_ref_timer16()
181 prescaler = gtm->clock / frequency; in gtm_set_ref_timer16()
203 spin_lock_irqsave(&gtm->lock, flags); in gtm_set_ref_timer16()
225 spin_unlock_irqrestore(&gtm->lock, flags); in gtm_set_ref_timer16()
304 struct gtm *gtm = tmr->gtm; in gtm_stop_timer16() local
305 int num = tmr - &gtm->timers[0]; in gtm_stop_timer16()
308 spin_lock_irqsave(&gtm->lock, flags); in gtm_stop_timer16()
313 spin_unlock_irqrestore(&gtm->lock, flags); in gtm_stop_timer16()
381 struct gtm *gtm; in fsl_gtm_init() local
385 gtm = kzalloc(sizeof(*gtm), GFP_KERNEL); in fsl_gtm_init()
386 if (!gtm) { in fsl_gtm_init()
392 spin_lock_init(&gtm->lock); in fsl_gtm_init()
399 gtm->clock = *clock; in fsl_gtm_init()
401 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { in fsl_gtm_init()
410 gtm->timers[i].irq = irq; in fsl_gtm_init()
411 gtm->timers[i].gtm = gtm; in fsl_gtm_init()
414 gtm->regs = of_iomap(np, 0); in fsl_gtm_init()
415 if (!gtm->regs) { in fsl_gtm_init()
421 gtm_set_shortcuts(np, gtm->timers, gtm->regs); in fsl_gtm_init()
422 list_add(&gtm->list_node, &gtms); in fsl_gtm_init()
425 np->data = gtm; in fsl_gtm_init()
430 kfree(gtm); in fsl_gtm_init()