summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAlan Douglas <adouglas@cadence.com>2018-06-25 09:30:53 +0100
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2018-07-12 12:46:41 +0100
commit0ae7383e83c6b1cea1e31173e362765dc24068c7 (patch)
tree9573d6788dab05538df8c7e25e882a0a89e582aa /drivers/pci
parentee12c9efe685428ebfae1bf5347b5375f54ce44e (diff)
downloadtalos-op-linux-0ae7383e83c6b1cea1e31173e362765dc24068c7.tar.gz
talos-op-linux-0ae7383e83c6b1cea1e31173e362765dc24068c7.zip
PCI: cadence: Add shutdown callback to host driver
Add shutdown callback to host driver which will disable PHY and PM runtime. Signed-off-by: Alan Douglas <adouglas@cadence.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/controller/pcie-cadence-host.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/controller/pcie-cadence-host.c b/drivers/pci/controller/pcie-cadence-host.c
index e3e9b7de8592..ec394f6a19c8 100644
--- a/drivers/pci/controller/pcie-cadence-host.c
+++ b/drivers/pci/controller/pcie-cadence-host.c
@@ -343,6 +343,20 @@ static int cdns_pcie_host_probe(struct platform_device *pdev)
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 = {
.driver = {
.name = "cdns-pcie-host",
@@ -350,5 +364,6 @@ static struct platform_driver cdns_pcie_host_driver = {
.pm = &cdns_pcie_pm_ops,
},
.probe = cdns_pcie_host_probe,
+ .shutdown = cdns_pcie_shutdown,
};
builtin_platform_driver(cdns_pcie_host_driver);
OpenPOWER on IntegriCloud