• Home
  • Raw
  • Download

Lines Matching +full:interrupt +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/interrupt.h>
11 #include <linux/mfd/ingenic-tcu.h>
17 struct regmap *map; member
26 struct irq_chip *irq_chip = irq_data_get_irq_chip(&desc->irq_data); in ingenic_tcu_intc_cascade()
29 struct regmap *map = gc->private; in ingenic_tcu_intc_cascade() local
33 regmap_read(map, TCU_REG_TFR, &irq_reg); in ingenic_tcu_intc_cascade()
34 regmap_read(map, TCU_REG_TMR, &irq_mask); in ingenic_tcu_intc_cascade()
50 struct regmap *map = gc->private; in ingenic_tcu_gc_unmask_enable_reg() local
51 u32 mask = d->mask; in ingenic_tcu_gc_unmask_enable_reg()
54 regmap_write(map, ct->regs.ack, mask); in ingenic_tcu_gc_unmask_enable_reg()
55 regmap_write(map, ct->regs.enable, mask); in ingenic_tcu_gc_unmask_enable_reg()
56 *ct->mask_cache |= mask; in ingenic_tcu_gc_unmask_enable_reg()
64 struct regmap *map = gc->private; in ingenic_tcu_gc_mask_disable_reg() local
65 u32 mask = d->mask; in ingenic_tcu_gc_mask_disable_reg()
68 regmap_write(map, ct->regs.disable, mask); in ingenic_tcu_gc_mask_disable_reg()
69 *ct->mask_cache &= ~mask; in ingenic_tcu_gc_mask_disable_reg()
77 struct regmap *map = gc->private; in ingenic_tcu_gc_mask_disable_reg_and_ack() local
78 u32 mask = d->mask; in ingenic_tcu_gc_mask_disable_reg_and_ack()
81 regmap_write(map, ct->regs.ack, mask); in ingenic_tcu_gc_mask_disable_reg_and_ack()
82 regmap_write(map, ct->regs.disable, mask); in ingenic_tcu_gc_mask_disable_reg_and_ack()
92 struct regmap *map; in ingenic_tcu_irq_init() local
96 map = device_node_to_regmap(np); in ingenic_tcu_irq_init()
97 if (IS_ERR(map)) in ingenic_tcu_irq_init()
98 return PTR_ERR(map); in ingenic_tcu_irq_init()
102 return -ENOMEM; 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()
109 ret = -EINVAL; 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()
118 ret = -ENOMEM; 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()
131 ct = gc->chip_types; in ingenic_tcu_irq_init()
133 gc->wake_enabled = IRQ_MSK(32); in ingenic_tcu_irq_init()
134 gc->private = tcu->map; in ingenic_tcu_irq_init()
136 ct->regs.disable = TCU_REG_TMSR; in ingenic_tcu_irq_init()
137 ct->regs.enable = TCU_REG_TMCR; in ingenic_tcu_irq_init()
138 ct->regs.ack = TCU_REG_TFCR; in ingenic_tcu_irq_init()
139 ct->chip.irq_unmask = ingenic_tcu_gc_unmask_enable_reg; in ingenic_tcu_irq_init()
140 ct->chip.irq_mask = ingenic_tcu_gc_mask_disable_reg; in ingenic_tcu_irq_init()
141 ct->chip.irq_mask_ack = ingenic_tcu_gc_mask_disable_reg_and_ack; in ingenic_tcu_irq_init()
142 ct->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE; in ingenic_tcu_irq_init()
145 regmap_write(tcu->map, TCU_REG_TMSR, IRQ_MSK(32)); in ingenic_tcu_irq_init()
148 * On JZ4740, timer 0 and timer 1 have their own interrupt line; in ingenic_tcu_irq_init()
149 * timers 2-7 share one interrupt. in ingenic_tcu_irq_init()
150 * On SoCs >= JZ4770, timer 5 has its own interrupt line; in ingenic_tcu_irq_init()
151 * timers 0-4 and 6-7 share one single interrupt. in ingenic_tcu_irq_init()
155 * channel fired the interrupt. 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()
160 ret = -EINVAL; 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()
172 for (; i > 0; i--) 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()
180 IRQCHIP_DECLARE(jz4740_tcu_irq, "ingenic,jz4740-tcu", ingenic_tcu_irq_init);
181 IRQCHIP_DECLARE(jz4725b_tcu_irq, "ingenic,jz4725b-tcu", ingenic_tcu_irq_init);
182 IRQCHIP_DECLARE(jz4760_tcu_irq, "ingenic,jz4760-tcu", ingenic_tcu_irq_init);
183 IRQCHIP_DECLARE(jz4770_tcu_irq, "ingenic,jz4770-tcu", ingenic_tcu_irq_init);
184 IRQCHIP_DECLARE(x1000_tcu_irq, "ingenic,x1000-tcu", ingenic_tcu_irq_init);