Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ae7383e authored by Alan Douglas's avatar Alan Douglas Committed by Lorenzo Pieralisi
Browse files

PCI: cadence: Add shutdown callback to host driver



Add shutdown callback to host driver which will disable PHY and
PM runtime.

Signed-off-by: default avatarAlan Douglas <adouglas@cadence.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
parent ee12c9ef
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -343,6 +343,20 @@ static int cdns_pcie_host_probe(struct platform_device *pdev)
	return ret;
	return ret;
}
}


static void cdns_pcie_shutdown(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct cdns_pcie *pcie = dev_get_drvdata(dev);
	int ret;

	ret = pm_runtime_put_sync(dev);
	if (ret < 0)
		dev_dbg(dev, "pm_runtime_put_sync failed\n");

	pm_runtime_disable(dev);
	cdns_pcie_disable_phy(pcie);
}

static struct platform_driver cdns_pcie_host_driver = {
static struct platform_driver cdns_pcie_host_driver = {
	.driver = {
	.driver = {
		.name = "cdns-pcie-host",
		.name = "cdns-pcie-host",
@@ -350,5 +364,6 @@ static struct platform_driver cdns_pcie_host_driver = {
		.pm	= &cdns_pcie_pm_ops,
		.pm	= &cdns_pcie_pm_ops,
	},
	},
	.probe = cdns_pcie_host_probe,
	.probe = cdns_pcie_host_probe,
	.shutdown = cdns_pcie_shutdown,
};
};
builtin_platform_driver(cdns_pcie_host_driver);
builtin_platform_driver(cdns_pcie_host_driver);