Lines Matching refs:pic

62 	struct megamod_pic *pic;  member
70 struct megamod_pic *pic = irq_data_get_irq_chip_data(data); in mask_megamod() local
72 u32 __iomem *evtmask = &pic->regs->evtmask[src / 32]; in mask_megamod()
74 raw_spin_lock(&pic->lock); in mask_megamod()
76 raw_spin_unlock(&pic->lock); in mask_megamod()
81 struct megamod_pic *pic = irq_data_get_irq_chip_data(data); in unmask_megamod() local
83 u32 __iomem *evtmask = &pic->regs->evtmask[src / 32]; in unmask_megamod()
85 raw_spin_lock(&pic->lock); in unmask_megamod()
87 raw_spin_unlock(&pic->lock); in unmask_megamod()
99 struct megamod_pic *pic; in megamod_irq_cascade() local
105 pic = cascade->pic; in megamod_irq_cascade()
108 while ((events = soc_readl(&pic->regs->mevtflag[idx])) != 0) { in megamod_irq_cascade()
111 irq = irq_linear_revmap(pic->irqhost, idx * 32 + n); in megamod_irq_cascade()
113 soc_writel(1 << n, &pic->regs->evtclr[idx]); in megamod_irq_cascade()
122 struct megamod_pic *pic = h->host_data; in megamod_map() local
127 if (pic->output_to_irq[i] == hw) in megamod_map()
130 irq_set_chip_data(virq, pic); in megamod_map()
144 static void __init set_megamod_mux(struct megamod_pic *pic, int src, int output) in set_megamod_mux() argument
150 pic->output_to_irq[output] = IRQ_UNMAPPED; in set_megamod_mux()
158 val = soc_readl(&pic->regs->intmux[index]); in set_megamod_mux()
161 soc_writel(val, &pic->regs->intmux[index]); in set_megamod_mux()
177 static void __init parse_priority_map(struct megamod_pic *pic, in parse_priority_map() argument
180 struct device_node *np = pic->irqhost->of_node; in parse_priority_map()
202 struct megamod_pic *pic; in init_megamod_pic() local
208 pic = kzalloc(sizeof(struct megamod_pic), GFP_KERNEL); in init_megamod_pic()
209 if (!pic) { in init_megamod_pic()
214 pic->irqhost = irq_domain_add_linear(np, NR_COMBINERS * 32, in init_megamod_pic()
215 &megamod_domain_ops, pic); in init_megamod_pic()
216 if (!pic->irqhost) { in init_megamod_pic()
221 pic->irqhost->host_data = pic; in init_megamod_pic()
223 raw_spin_lock_init(&pic->lock); in init_megamod_pic()
225 pic->regs = of_iomap(np, 0); in init_megamod_pic()
226 if (!pic->regs) { in init_megamod_pic()
235 parse_priority_map(pic, mapping, ARRAY_SIZE(mapping)); in init_megamod_pic()
278 cascade_data[i].pic = pic; in init_megamod_pic()
282 soc_writel(~0, &pic->regs->evtmask[i]); in init_megamod_pic()
283 soc_writel(~0, &pic->regs->evtclr[i]); in init_megamod_pic()
294 set_megamod_mux(pic, mapping[i], i); in init_megamod_pic()
298 return pic; in init_megamod_pic()
301 kfree(pic); in init_megamod_pic()