9050f724513ce29ed02c26f39c8a848bfd740473
[openwrt/staging/noltari.git] /
1 From c1e02ceaf5739d32f092ac07bf886a0281ec40b1 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Tue, 12 May 2015 23:23:00 +0200
4 Subject: [PATCH 1/2] PCI: iproc: Allow override of device tree IRQ mapping
5 function
6
7 The iProc core PCIe driver defaults to using of_irq_parse_and_map_pci() for
8 IRQ mapping. Add iproc_pcie.map_irq so bus interfaces that don't use
9 device tree can override this by supplying their own IRQ mapping function.
10
11 [bhelgaas: changelog]
12 Posting: http://lkml.kernel.org/r/1431465781-10753-1-git-send-email-hauke@hauke-m.de
13 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
14 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
15 Reviewed-by: Ray Jui <rjui@broadcom.com.com>
16 ---
17 drivers/pci/host/pcie-iproc-platform.c | 2 ++
18 drivers/pci/host/pcie-iproc.c | 2 +-
19 drivers/pci/host/pcie-iproc.h | 1 +
20 3 files changed, 4 insertions(+), 1 deletion(-)
21
22 --- a/drivers/pci/host/pcie-iproc-platform.c
23 +++ b/drivers/pci/host/pcie-iproc-platform.c
24 @@ -71,6 +71,8 @@ static int iproc_pcie_pltfm_probe(struct
25
26 pcie->resources = &res;
27
28 + pcie->map_irq = of_irq_parse_and_map_pci;
29 +
30 ret = iproc_pcie_setup(pcie);
31 if (ret) {
32 dev_err(pcie->dev, "PCIe controller setup failed\n");
33 --- a/drivers/pci/host/pcie-iproc.c
34 +++ b/drivers/pci/host/pcie-iproc.c
35 @@ -229,7 +229,7 @@ int iproc_pcie_setup(struct iproc_pcie *
36
37 pci_scan_child_bus(bus);
38 pci_assign_unassigned_bus_resources(bus);
39 - pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
40 + pci_fixup_irqs(pci_common_swizzle, pcie->map_irq);
41 pci_bus_add_devices(bus);
42
43 return 0;
44 --- a/drivers/pci/host/pcie-iproc.h
45 +++ b/drivers/pci/host/pcie-iproc.h
46 @@ -34,6 +34,7 @@ struct iproc_pcie {
47 struct pci_bus *root_bus;
48 struct phy *phy;
49 int irqs[IPROC_PCIE_MAX_NUM_IRQS];
50 + int (*map_irq)(const struct pci_dev *, u8, u8);
51 };
52
53 int iproc_pcie_setup(struct iproc_pcie *pcie);