aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2012-11-02 20:07:02 +0000
committerJohn Crispin <blogic@openwrt.org>2012-11-02 20:07:02 +0000
commit5a5e4b27825721f902e64a0d993d71a6b8fd48a4 (patch)
tree9042a707f9a1efd86b4873f9ad1e0116e209f93c /target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c
parentbd7dc4e3eae386a0d79e7586ea73ebd6feb74ef0 (diff)
downloadmaster-187ad058-5a5e4b27825721f902e64a0d993d71a6b8fd48a4.tar.gz
master-187ad058-5a5e4b27825721f902e64a0d993d71a6b8fd48a4.tar.bz2
master-187ad058-5a5e4b27825721f902e64a0d993d71a6b8fd48a4.zip
[lantiq] move files/ -> files-3.3/
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34060 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c')
-rw-r--r--target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c b/target/linux/lantiq/files-3.3/arch/mips/pci/fixup-lantiq.c
new file mode 100644
index 0000000000..daf5ae9e42
--- /dev/null
+++ b/target/linux/lantiq/files-3.3/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 <blogic@openwrt.org>
+ */
+
+#include <linux/of_irq.h>
+#include <linux/of_pci.h>
+
+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;
+}
+
+