Lines Matching refs:gtm

73 struct gtm {  struct
93 struct gtm *gtm = NULL; in gtm_get_timer16() argument
96 list_for_each_entry(gtm, &gtms, list_node) { in gtm_get_timer16()
97 spin_lock_irq(&gtm->lock); in gtm_get_timer16()
99 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { in gtm_get_timer16()
100 if (!gtm->timers[i].requested) { in gtm_get_timer16()
101 gtm->timers[i].requested = true; in gtm_get_timer16()
102 spin_unlock_irq(&gtm->lock); in gtm_get_timer16()
103 return &gtm->timers[i]; in gtm_get_timer16()
107 spin_unlock_irq(&gtm->lock); in gtm_get_timer16()
110 if (gtm) in gtm_get_timer16()
126 struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm, in gtm_get_specific_timer16() argument
134 spin_lock_irq(&gtm->lock); in gtm_get_specific_timer16()
136 if (gtm->timers[timer].requested) in gtm_get_specific_timer16()
139 ret = &gtm->timers[timer]; in gtm_get_specific_timer16()
143 spin_unlock_irq(&gtm->lock); in gtm_get_specific_timer16()
159 spin_lock_irq(&tmr->gtm->lock); in gtm_put_timer16()
161 spin_unlock_irq(&tmr->gtm->lock); in gtm_put_timer16()
172 struct gtm *gtm = tmr->gtm; in gtm_set_ref_timer16() local
173 int num = tmr - &gtm->timers[0]; in gtm_set_ref_timer16()
185 prescaler = gtm->clock / frequency; in gtm_set_ref_timer16()
207 spin_lock_irqsave(&gtm->lock, flags); in gtm_set_ref_timer16()
229 spin_unlock_irqrestore(&gtm->lock, flags); in gtm_set_ref_timer16()
308 struct gtm *gtm = tmr->gtm; in gtm_stop_timer16() local
309 int num = tmr - &gtm->timers[0]; in gtm_stop_timer16()
312 spin_lock_irqsave(&gtm->lock, flags); in gtm_stop_timer16()
317 spin_unlock_irqrestore(&gtm->lock, flags); in gtm_stop_timer16()
385 struct gtm *gtm; in fsl_gtm_init() local
389 gtm = kzalloc(sizeof(*gtm), GFP_KERNEL); in fsl_gtm_init()
390 if (!gtm) { in fsl_gtm_init()
396 spin_lock_init(&gtm->lock); in fsl_gtm_init()
403 gtm->clock = *clock; in fsl_gtm_init()
405 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { in fsl_gtm_init()
414 gtm->timers[i].irq = irq; in fsl_gtm_init()
415 gtm->timers[i].gtm = gtm; in fsl_gtm_init()
418 gtm->regs = of_iomap(np, 0); in fsl_gtm_init()
419 if (!gtm->regs) { in fsl_gtm_init()
425 gtm_set_shortcuts(np, gtm->timers, gtm->regs); in fsl_gtm_init()
426 list_add(&gtm->list_node, &gtms); in fsl_gtm_init()
429 np->data = gtm; in fsl_gtm_init()
434 kfree(gtm); in fsl_gtm_init()