lantiq: allow pcie to be disabled by dts + vgv7519 fix pci irq + disable pcie by dts
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.14 / 0151-lantiq-ifxmips_pcie-use-of.patch
1 --- linux-3.14.18.orig/arch/mips/pci/ifxmips_pcie.c 2014-09-27 14:55:19.000000000 +0200
2 +++ linux-3.14.18/arch/mips/pci/ifxmips_pcie.c 2014-10-09 13:45:12.000000000 +0200
3 @@ -18,6 +18,8 @@
4 #include <linux/pci_regs.h>
5 #include <linux/module.h>
6
7 +#include <linux/of_platform.h>
8 +
9 #include "ifxmips_pcie.h"
10 #include "ifxmips_pcie_reg.h"
11
12 @@ -1048,7 +1050,7 @@
13 extern int (*ltq_pci_plat_arch_init)(struct pci_dev *dev);
14 extern int (*ltq_pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
15
16 -static int __init ifx_pcie_bios_init(void)
17 +static int __init ifx_pcie_bios_probe(struct platform_device *pdev)
18 {
19 void __iomem *io_map_base;
20 int pcie_port;
21 @@ -1090,6 +1092,30 @@
22
23 return 0;
24 }
25 +
26 +static const struct of_device_id ifxmips_pcie_match[] = {
27 + { .compatible = "lantiq,pcie-xrx200" },
28 + {},
29 +};
30 +MODULE_DEVICE_TABLE(of, ifxmips_pcie_match);
31 +
32 +static struct platform_driver ltq_pci_driver = {
33 + .probe = ifx_pcie_bios_probe,
34 + .driver = {
35 + .name = "pcie-xrx200",
36 + .owner = THIS_MODULE,
37 + .of_match_table = ifxmips_pcie_match,
38 + },
39 +};
40 +
41 +int __init ifx_pcie_bios_init(void)
42 +{
43 + int ret = platform_driver_register(&ltq_pci_driver);
44 + if (ret)
45 + pr_info("pcie-xrx200: Error registering platform driver!");
46 + return ret;
47 +}
48 +
49 arch_initcall(ifx_pcie_bios_init);
50
51 MODULE_LICENSE("GPL");