-static void macio_create_fixup_irq(struct macio_dev *dev, int index,
- unsigned int line)
-{
- unsigned int irq;
-
- irq = irq_create_mapping(NULL, line);
- if (irq != NO_IRQ) {
- dev->interrupt[index].start = irq;
- dev->interrupt[index].flags = IORESOURCE_IRQ;
- dev->interrupt[index].name = dev->ofdev.dev.bus_id;
- }
- if (dev->n_interrupts <= index)
- dev->n_interrupts = index + 1;
-}
-
-static void macio_add_missing_resources(struct macio_dev *dev)
-{
- struct device_node *np = dev->ofdev.node;
- unsigned int irq_base;
-
- /* Gatwick has some missing interrupts on child nodes */
- if (dev->bus->chip->type != macio_gatwick)
- return;
-
- /* irq_base is always 64 on gatwick. I have no cleaner way to get
- * that value from here at this point
- */
- irq_base = 64;
-
- /* Fix SCC */
- if (strcmp(np->name, "ch-a") == 0) {
- macio_create_fixup_irq(dev, 0, 15 + irq_base);
- macio_create_fixup_irq(dev, 1, 4 + irq_base);
- macio_create_fixup_irq(dev, 2, 5 + irq_base);
- printk(KERN_INFO "macio: fixed SCC irqs on gatwick\n");
- }
-
- /* Fix media-bay */
- if (strcmp(np->name, "media-bay") == 0) {
- macio_create_fixup_irq(dev, 0, 29 + irq_base);
- printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n");
- }
-
- /* Fix left media bay childs */
- if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) {
- macio_create_fixup_irq(dev, 0, 19 + irq_base);
- macio_create_fixup_irq(dev, 1, 1 + irq_base);
- printk(KERN_INFO "macio: fixed left floppy irqs\n");
- }
- if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) {
- macio_create_fixup_irq(dev, 0, 14 + irq_base);
- macio_create_fixup_irq(dev, 0, 3 + irq_base);
- printk(KERN_INFO "macio: fixed left ide irqs\n");
- }
-}