2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
9 #include <linux/of_irq.h>
10 #include <linux/of_pci.h>
12 int (*ltqpci_map_irq
)(const struct pci_dev
*dev
, u8 slot
, u8 pin
) = NULL
;
13 int (*ltqpci_plat_arch_init
)(struct pci_dev
*dev
) = NULL
;
14 int (*ltqpci_plat_dev_init
)(struct pci_dev
*dev
) = NULL
;
17 int pcibios_plat_dev_init(struct pci_dev
*dev
)
19 if (ltqpci_plat_arch_init
)
20 return ltqpci_plat_arch_init(dev
);
22 if (ltqpci_plat_dev_init
)
23 return ltqpci_plat_dev_init(dev
);
28 int __init
pcibios_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
31 return ltqpci_map_irq(dev
, slot
, pin
);
32 if (ltq_pci_irq_map
[slot
]) {
33 dev_info(&dev
->dev
, "SLOT:%d PIN:%d IRQ:%d\n", slot
, pin
, ltq_pci_irq_map
[slot
]);
34 return ltq_pci_irq_map
[slot
];
36 printk(KERN_ERR
"lq_pci: trying to map irq for unknown slot %d\n",