PCI: iproc: Allow override of device tree IRQ mapping function
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 12 May 2015 21:23:00 +0000 (23:23 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 20 May 2015 14:19:40 +0000 (09:19 -0500)
The iProc core PCIe driver defaults to using of_irq_parse_and_map_pci() for
IRQ mapping.  Add iproc_pcie.map_irq so bus interfaces that don't use
device tree can override this by supplying their own IRQ mapping function.

[bhelgaas: changelog]
Posting: http://lkml.kernel.org/r/1431465781-10753-1-git-send-email-hauke@hauke-m.de
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ray Jui <rjui@broadcom.com.com>
drivers/pci/host/pcie-iproc-platform.c
drivers/pci/host/pcie-iproc.c
drivers/pci/host/pcie-iproc.h

index afad6c21fcfa17832fc17ed8c44d8e100d48172d..c8aa06f10d73267c68511029790783ad571f3722 100644 (file)
@@ -71,6 +71,8 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 
        pcie->resources = &res;
 
+       pcie->map_irq = of_irq_parse_and_map_pci;
+
        ret = iproc_pcie_setup(pcie);
        if (ret) {
                dev_err(pcie->dev, "PCIe controller setup failed\n");
index 329e1b54528b3806c1c64477cef27ac1e4c16412..cef31f6a12426c1ef78fe78473b198dfa777744b 100644 (file)
@@ -229,7 +229,7 @@ int iproc_pcie_setup(struct iproc_pcie *pcie)
 
        pci_scan_child_bus(bus);
        pci_assign_unassigned_bus_resources(bus);
-       pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
+       pci_fixup_irqs(pci_common_swizzle, pcie->map_irq);
        pci_bus_add_devices(bus);
 
        return 0;
index e28075ed185691005febba1b38e212a02c3f350f..a333d4b7723af83523abd8689efa950dc683b97a 100644 (file)
@@ -34,6 +34,7 @@ struct iproc_pcie {
        struct pci_bus *root_bus;
        struct phy *phy;
        int irqs[IPROC_PCIE_MAX_NUM_IRQS];
+       int (*map_irq)(const struct pci_dev *, u8, u8);
 };
 
 int iproc_pcie_setup(struct iproc_pcie *pcie);