030-0001-PCI-iproc-Allow-override-of-device-tree-IRQ-mapping-.patch 1.8 KB

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