Lines Matching refs:tcu
91 struct ingenic_tcu *tcu; in ingenic_tcu_irq_init() local
100 tcu = kzalloc(sizeof(*tcu), GFP_KERNEL); in ingenic_tcu_irq_init()
101 if (!tcu) in ingenic_tcu_irq_init()
104 tcu->map = map; in ingenic_tcu_irq_init()
107 if (irqs < 0 || irqs > ARRAY_SIZE(tcu->parent_irqs)) { in ingenic_tcu_irq_init()
113 tcu->nb_parent_irqs = irqs; in ingenic_tcu_irq_init()
115 tcu->domain = irq_domain_add_linear(np, 32, &irq_generic_chip_ops, in ingenic_tcu_irq_init()
117 if (!tcu->domain) { in ingenic_tcu_irq_init()
122 ret = irq_alloc_domain_generic_chips(tcu->domain, 32, 1, "TCU", in ingenic_tcu_irq_init()
130 gc = irq_get_domain_generic_chip(tcu->domain, 0); in ingenic_tcu_irq_init()
134 gc->private = tcu->map; in ingenic_tcu_irq_init()
145 regmap_write(tcu->map, TCU_REG_TMSR, IRQ_MSK(32)); in ingenic_tcu_irq_init()
158 tcu->parent_irqs[i] = irq_of_parse_and_map(np, i); in ingenic_tcu_irq_init()
159 if (!tcu->parent_irqs[i]) { in ingenic_tcu_irq_init()
164 irq_set_chained_handler_and_data(tcu->parent_irqs[i], in ingenic_tcu_irq_init()
166 tcu->domain); in ingenic_tcu_irq_init()
173 irq_dispose_mapping(tcu->parent_irqs[i - 1]); in ingenic_tcu_irq_init()
175 irq_domain_remove(tcu->domain); in ingenic_tcu_irq_init()
177 kfree(tcu); in ingenic_tcu_irq_init()