WIP FPC-III support
[linux/fpc-iii.git] / drivers / pci / controller / mobiveil / pcie-mobiveil-plat.c
blobf6fcd95c2bf554c5893c2ae0fd4d599979ff8f51
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * PCIe host controller driver for Mobiveil PCIe Host controller
5 * Copyright (c) 2018 Mobiveil Inc.
6 * Copyright 2019 NXP
8 * Author: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
9 * Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/of_pci.h>
16 #include <linux/pci.h>
17 #include <linux/platform_device.h>
18 #include <linux/slab.h>
20 #include "pcie-mobiveil.h"
22 static int mobiveil_pcie_probe(struct platform_device *pdev)
24 struct mobiveil_pcie *pcie;
25 struct pci_host_bridge *bridge;
26 struct device *dev = &pdev->dev;
28 /* allocate the PCIe port */
29 bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
30 if (!bridge)
31 return -ENOMEM;
33 pcie = pci_host_bridge_priv(bridge);
34 pcie->rp.bridge = bridge;
36 pcie->pdev = pdev;
38 return mobiveil_pcie_host_probe(pcie);
41 static const struct of_device_id mobiveil_pcie_of_match[] = {
42 {.compatible = "mbvl,gpex40-pcie",},
43 {},
46 MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match);
48 static struct platform_driver mobiveil_pcie_driver = {
49 .probe = mobiveil_pcie_probe,
50 .driver = {
51 .name = "mobiveil-pcie",
52 .of_match_table = mobiveil_pcie_of_match,
53 .suppress_bind_attrs = true,
57 builtin_platform_driver(mobiveil_pcie_driver);
59 MODULE_LICENSE("GPL v2");
60 MODULE_DESCRIPTION("Mobiveil PCIe host controller driver");
61 MODULE_AUTHOR("Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>");