mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 14:52:05 +00:00
03bdc38840
Modularize the Mobiveil PCIe host driver according to the abstraction of Root Complex and Endpoint and move it into a new directory in order to make it easier to reuse the driver functions to add new host drivers for systems integrating the Mobiveil PCIe GPEX IP. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Andrew Murray <andrew.murray@arm.com>
62 lines
1.4 KiB
C
62 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* PCIe host controller driver for Mobiveil PCIe Host controller
|
|
*
|
|
* Copyright (c) 2018 Mobiveil Inc.
|
|
* Copyright 2019 NXP
|
|
*
|
|
* Author: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
|
|
* Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of_pci.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/slab.h>
|
|
|
|
#include "pcie-mobiveil.h"
|
|
|
|
static int mobiveil_pcie_probe(struct platform_device *pdev)
|
|
{
|
|
struct mobiveil_pcie *pcie;
|
|
struct pci_host_bridge *bridge;
|
|
struct device *dev = &pdev->dev;
|
|
|
|
/* allocate the PCIe port */
|
|
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
|
|
if (!bridge)
|
|
return -ENOMEM;
|
|
|
|
pcie = pci_host_bridge_priv(bridge);
|
|
pcie->rp.bridge = bridge;
|
|
|
|
pcie->pdev = pdev;
|
|
|
|
return mobiveil_pcie_host_probe(pcie);
|
|
}
|
|
|
|
static const struct of_device_id mobiveil_pcie_of_match[] = {
|
|
{.compatible = "mbvl,gpex40-pcie",},
|
|
{},
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match);
|
|
|
|
static struct platform_driver mobiveil_pcie_driver = {
|
|
.probe = mobiveil_pcie_probe,
|
|
.driver = {
|
|
.name = "mobiveil-pcie",
|
|
.of_match_table = mobiveil_pcie_of_match,
|
|
.suppress_bind_attrs = true,
|
|
},
|
|
};
|
|
|
|
builtin_platform_driver(mobiveil_pcie_driver);
|
|
|
|
MODULE_LICENSE("GPL v2");
|
|
MODULE_DESCRIPTION("Mobiveil PCIe host controller driver");
|
|
MODULE_AUTHOR("Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>");
|