Lines Matching +full:shared +full:- +full:interrupt

2  * SPEAr platform shared irq layer source file
4 * Copyright (C) 2009-2012 ST Microelectronics
18 #include <linux/interrupt.h>
29 * struct spear_shirq: shared irq structure
32 * status_reg: Status register offset for chained interrupt handler
35 * virq_base: Base virtual interrupt number
37 * offset: Bit offset of the first interrupt
38 * irq_chip: Interrupt controller chip used for this instance,
52 /* spear300 shared irq registers offsets and masks */
61 u32 val, shift = d->irq - shirq->virq_base + shirq->offset; in shirq_irq_mask()
62 u32 __iomem *reg = shirq->base + shirq->mask_reg; in shirq_irq_mask()
73 u32 val, shift = d->irq - shirq->virq_base + shirq->offset; in shirq_irq_unmask()
74 u32 __iomem *reg = shirq->base + shirq->mask_reg; in shirq_irq_unmask()
83 .name = "spear-shirq",
91 .mask = ((0x1 << 9) - 1) << 0,
101 /* spear310 shared irq registers offsets and masks */
107 .mask = ((0x1 << 8) - 1) << 0,
115 .mask = ((0x1 << 5) - 1) << 8,
123 .mask = ((0x1 << 1) - 1) << 13,
131 .mask = ((0x1 << 3) - 1) << 14,
143 /* spear320 shared irq registers offsets and masks */
151 .mask = ((0x1 << 7) - 1) << 0,
159 .mask = ((0x1 << 3) - 1) << 7,
167 .mask = ((0x1 << 1) - 1) << 10,
175 .mask = ((0x1 << 11) - 1) << 11,
192 pend = readl(shirq->base + shirq->status_reg) & shirq->mask; in shirq_handler()
193 pend >>= shirq->offset; in shirq_handler()
199 generic_handle_irq(shirq->virq_base + irq); in shirq_handler()
208 if (!shirq->irq_chip) in spear_shirq_register()
213 for (i = 0; i < shirq->nr_irqs; i++) { in spear_shirq_register()
214 irq_set_chip_and_handler(shirq->virq_base + i, in spear_shirq_register()
215 shirq->irq_chip, handle_simple_irq); in spear_shirq_register()
216 irq_set_chip_data(shirq->virq_base + i, shirq); in spear_shirq_register()
230 return -ENXIO; in shirq_init()
234 nr_irqs += shirq_blocks[i]->nr_irqs; in shirq_init()
236 virq_base = irq_alloc_descs(-1, 0, nr_irqs, 0); in shirq_init()
250 shirq_blocks[i]->base = base; in shirq_init()
251 shirq_blocks[i]->virq_base = irq_find_mapping(shirq_domain, in shirq_init()
256 hwirq += shirq_blocks[i]->nr_irqs; in shirq_init()
265 return -ENXIO; in shirq_init()
274 IRQCHIP_DECLARE(spear300_shirq, "st,spear300-shirq", spear300_shirq_of_init);
282 IRQCHIP_DECLARE(spear310_shirq, "st,spear310-shirq", spear310_shirq_of_init);
290 IRQCHIP_DECLARE(spear320_shirq, "st,spear320-shirq", spear320_shirq_of_init);