0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/init.h>
0013 #include <linux/kernel.h>
0014 #include <linux/module.h>
0015 #include <linux/of_pci.h>
0016 #include <linux/pci.h>
0017 #include <linux/platform_device.h>
0018 #include <linux/slab.h>
0019
0020 #include "pcie-mobiveil.h"
0021
0022 static int mobiveil_pcie_probe(struct platform_device *pdev)
0023 {
0024 struct mobiveil_pcie *pcie;
0025 struct pci_host_bridge *bridge;
0026 struct device *dev = &pdev->dev;
0027
0028
0029 bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
0030 if (!bridge)
0031 return -ENOMEM;
0032
0033 pcie = pci_host_bridge_priv(bridge);
0034 pcie->rp.bridge = bridge;
0035
0036 pcie->pdev = pdev;
0037
0038 return mobiveil_pcie_host_probe(pcie);
0039 }
0040
0041 static const struct of_device_id mobiveil_pcie_of_match[] = {
0042 {.compatible = "mbvl,gpex40-pcie",},
0043 {},
0044 };
0045
0046 MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match);
0047
0048 static struct platform_driver mobiveil_pcie_driver = {
0049 .probe = mobiveil_pcie_probe,
0050 .driver = {
0051 .name = "mobiveil-pcie",
0052 .of_match_table = mobiveil_pcie_of_match,
0053 .suppress_bind_attrs = true,
0054 },
0055 };
0056
0057 builtin_platform_driver(mobiveil_pcie_driver);
0058
0059 MODULE_LICENSE("GPL v2");
0060 MODULE_DESCRIPTION("Mobiveil PCIe host controller driver");
0061 MODULE_AUTHOR("Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>");