PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/target/linux/imx6/patches-3.14/0060-pci_designware_use-new-OF-interrupt-mapping-when-possible.patch

https://github.com/wm5d8b/openwrt
Patch | 58 lines | 50 code | 8 blank | 0 comment | 0 complexity | af3db273a48d140b01926d9eee2139be MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. commit 62fe03d1dd629a98c6da86cabb2a98b85e89d516
  2. Author: Lucas Stach <l.stach@pengutronix.de>
  3. Date: Wed Mar 5 14:25:51 2014 +0100
  4. PCI: designware: use new OF interrupt mapping when possible
  5. This is the recommended method of doing the IRQ
  6. mapping. For old devicetrees we fall back to the
  7. previous practice.
  8. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
  9. Acked-by: Arnd Bergmann <arnd@arndb.de>
  10. Acked-by: Jingoo Han <jg1.han@samsung.com>
  11. Reviewed-by: Marek Vasut <marex@denx.de>
  12. --- a/drivers/pci/host/pcie-designware.c
  13. +++ b/drivers/pci/host/pcie-designware.c
  14. @@ -17,6 +17,7 @@
  15. #include <linux/module.h>
  16. #include <linux/msi.h>
  17. #include <linux/of_address.h>
  18. +#include <linux/of_pci.h>
  19. #include <linux/pci.h>
  20. #include <linux/pci_regs.h>
  21. #include <linux/types.h>
  22. @@ -492,7 +493,7 @@ int __init dw_pcie_host_init(struct pcie
  23. dw_pci.nr_controllers = 1;
  24. dw_pci.private_data = (void **)&pp;
  25. - pci_common_init(&dw_pci);
  26. + pci_common_init_dev(pp->dev, &dw_pci);
  27. pci_assign_unassigned_resources();
  28. #ifdef CONFIG_PCI_DOMAINS
  29. dw_pci.domain++;
  30. @@ -725,7 +726,7 @@ static struct pci_bus *dw_pcie_scan_bus(
  31. if (pp) {
  32. pp->root_bus_nr = sys->busnr;
  33. - bus = pci_scan_root_bus(NULL, sys->busnr, &dw_pcie_ops,
  34. + bus = pci_scan_root_bus(pp->dev, sys->busnr, &dw_pcie_ops,
  35. sys, &sys->resources);
  36. } else {
  37. bus = NULL;
  38. @@ -738,8 +739,13 @@ static struct pci_bus *dw_pcie_scan_bus(
  39. static int dw_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  40. {
  41. struct pcie_port *pp = sys_to_pcie(dev->bus->sysdata);
  42. + int irq;
  43. - return pp->irq;
  44. + irq = of_irq_parse_and_map_pci(dev, slot, pin);
  45. + if (!irq)
  46. + irq = pp->irq;
  47. +
  48. + return irq;
  49. }
  50. static void dw_pcie_add_bus(struct pci_bus *bus)