Lines Matching defs:gtm

69 struct gtm {
89 struct gtm *gtm;
92 list_for_each_entry(gtm, &gtms, list_node) {
93 spin_lock_irq(&gtm->lock);
95 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) {
96 if (!gtm->timers[i].requested) {
97 gtm->timers[i].requested = true;
98 spin_unlock_irq(&gtm->lock);
99 return &gtm->timers[i];
103 spin_unlock_irq(&gtm->lock);
114 * @gtm: specific GTM, pass here GTM's device_node->data
122 struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm,
130 spin_lock_irq(&gtm->lock);
132 if (gtm->timers[timer].requested)
135 ret = &gtm->timers[timer];
139 spin_unlock_irq(&gtm->lock);
155 spin_lock_irq(&tmr->gtm->lock);
157 spin_unlock_irq(&tmr->gtm->lock);
168 struct gtm *gtm = tmr->gtm;
169 int num = tmr - &gtm->timers[0];
181 prescaler = gtm->clock / frequency;
203 spin_lock_irqsave(&gtm->lock, flags);
225 spin_unlock_irqrestore(&gtm->lock, flags);
304 struct gtm *gtm = tmr->gtm;
305 int num = tmr - &gtm->timers[0];
308 spin_lock_irqsave(&gtm->lock, flags);
313 spin_unlock_irqrestore(&gtm->lock, flags);
367 if (!of_device_is_compatible(np, "fsl,cpm2-gtm")) {
379 for_each_compatible_node(np, NULL, "fsl,gtm") {
381 struct gtm *gtm;
385 gtm = kzalloc(sizeof(*gtm), GFP_KERNEL);
386 if (!gtm) {
392 spin_lock_init(&gtm->lock);
399 gtm->clock = *clock;
401 for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) {
410 gtm->timers[i].irq = irq;
411 gtm->timers[i].gtm = gtm;
414 gtm->regs = of_iomap(np, 0);
415 if (!gtm->regs) {
421 gtm_set_shortcuts(np, gtm->timers, gtm->regs);
422 list_add(&gtm->list_node, &gtms);
425 np->data = gtm;
430 kfree(gtm);