void systemasic_irq_init(void) { int i, nid = cpu_to_node(boot_cpu_data); /* Assign all virtual IRQs to the System ASIC int. handler */ for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) { unsigned int irq; irq = create_irq_nr(i, nid); if (unlikely(irq == 0)) { pr_err("%s: failed hooking irq %d for systemasic\n", __func__, i); return; } if (unlikely(irq != i)) { pr_err("%s: got irq %d but wanted %d, bailing.\n", __func__, irq, i); destroy_irq(irq); return; } set_irq_chip_and_handler(i, &systemasic_int, handle_level_irq); } }
int __init setup_hd64461(void) { int i, nid = cpu_to_node(boot_cpu_data); if (!MACH_HD64461) return 0; printk(KERN_INFO "HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n", HD64461_IOBASE, CONFIG_HD64461_IRQ, HD64461_IRQBASE, HD64461_IRQBASE + 15); /* Should be at processor specific part.. */ #if defined(CONFIG_CPU_SUBTYPE_SH7709) __raw_writew(0x2240, INTC_ICR1); #endif __raw_writew(0xffff, HD64461_NIMR); /* IRQ 80 -> 95 belongs to HD64461 */ for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) { unsigned int irq; irq = create_irq_nr(i, nid); if (unlikely(irq == 0)) { pr_err("%s: failed hooking irq %d for HD64461\n", __func__, i); return -EBUSY; } if (unlikely(irq != i)) { pr_err("%s: got irq %d but wanted %d, bailing.\n", __func__, irq, i); destroy_irq(irq); return -EINVAL; } irq_set_chip_and_handler(i, &hd64461_irq_chip, handle_level_irq); } irq_set_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); irq_set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW); #ifdef CONFIG_HD64461_ENABLER printk(KERN_INFO "HD64461: enabling PCMCIA devices\n"); __raw_writeb(0x4c, HD64461_PCC1CSCIER); __raw_writeb(0x00, HD64461_PCC1CSCR); #endif return 0; }
void __init init_se7724_IRQ(void) { int i, nid = cpu_to_node(boot_cpu_data); __raw_writew(0xffff, IRQ0_MR); __raw_writew(0xffff, IRQ1_MR); __raw_writew(0xffff, IRQ2_MR); __raw_writew(0x0000, IRQ0_SR); __raw_writew(0x0000, IRQ1_SR); __raw_writew(0x0000, IRQ2_SR); __raw_writew(0x002a, IRQ_MODE); for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) { int irq, wanted; wanted = SE7724_FPGA_IRQ_BASE + i; irq = create_irq_nr(wanted, nid); if (unlikely(irq == 0)) { pr_err("%s: failed hooking irq %d for FPGA\n", __func__, wanted); return; } if (unlikely(irq != wanted)) { pr_err("%s: got irq %d but wanted %d, bailing.\n", __func__, irq, wanted); destroy_irq(irq); return; } irq_set_chip_and_handler_name(irq, &se7724_irq_chip, handle_level_irq, "level"); } irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux); irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); irq_set_chained_handler(IRQ1_IRQ, se7724_irq_demux); irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW); irq_set_chained_handler(IRQ2_IRQ, se7724_irq_demux); irq_set_irq_type(IRQ2_IRQ, IRQ_TYPE_LEVEL_LOW); }
int uv_setup_irq(char *irq_name, int cpu, int mmr_blade, unsigned long mmr_offset, int limit) { int irq, ret; irq = create_irq_nr(NR_IRQS_LEGACY, uv_blade_to_memory_nid(mmr_blade)); if (irq <= 0) return -EBUSY; ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset, limit); if (ret == irq) uv_set_irq_2_mmr_info(irq, mmr_offset, mmr_blade); else destroy_irq(irq); return ret; }