X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=target%2Flinux%2Flantiq%2Ffiles%2Farch%2Fmips%2Fpci%2Ffixup-lantiq.c;fp=target%2Flinux%2Flantiq%2Ffiles%2Farch%2Fmips%2Fpci%2Ffixup-lantiq.c;h=daf5ae9e428fc07f5ec656b1c9f2909e0b0a2857;hp=0000000000000000000000000000000000000000;hb=cea2b4210d9b3706cad3cc60cc54dde063e09b58;hpb=6b899d5deac5b0ad531d7a7f2d1d241727848535 diff --git a/target/linux/lantiq/files/arch/mips/pci/fixup-lantiq.c b/target/linux/lantiq/files/arch/mips/pci/fixup-lantiq.c new file mode 100644 index 0000000000..daf5ae9e42 --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/pci/fixup-lantiq.c @@ -0,0 +1,42 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * Copyright (C) 2012 John Crispin + */ + +#include +#include + +int (*ltqpci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin) = NULL; +int (*ltqpci_plat_arch_init)(struct pci_dev *dev) = NULL; +int (*ltqpci_plat_dev_init)(struct pci_dev *dev) = NULL; +int *ltq_pci_irq_map; + +int pcibios_plat_dev_init(struct pci_dev *dev) +{ + if (ltqpci_plat_arch_init) + return ltqpci_plat_arch_init(dev); + + if (ltqpci_plat_dev_init) + return ltqpci_plat_dev_init(dev); + + return 0; +} + +int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) +{ + if (ltqpci_map_irq) + return ltqpci_map_irq(dev, slot, pin); + if (ltq_pci_irq_map[slot]) { + dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, ltq_pci_irq_map[slot]); + return ltq_pci_irq_map[slot]; + } + printk(KERN_ERR "lq_pci: trying to map irq for unknown slot %d\n", + slot); + + return 0; +} + +