diff options
author | Alan Douglas <adouglas@cadence.com> | 2018-06-25 04:30:53 -0400 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-07-12 07:46:41 -0400 |
commit | 0ae7383e83c6b1cea1e31173e362765dc24068c7 (patch) | |
tree | 9573d6788dab05538df8c7e25e882a0a89e582aa | |
parent | ee12c9efe685428ebfae1bf5347b5375f54ce44e (diff) |
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>
-rw-r--r-- | drivers/pci/controller/pcie-cadence-host.c | 15 |
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) | |||
343 | return ret; | 343 | return ret; |
344 | } | 344 | } |
345 | 345 | ||
346 | static void cdns_pcie_shutdown(struct platform_device *pdev) | ||
347 | { | ||
348 | struct device *dev = &pdev->dev; | ||
349 | struct cdns_pcie *pcie = dev_get_drvdata(dev); | ||
350 | int ret; | ||
351 | |||
352 | ret = pm_runtime_put_sync(dev); | ||
353 | if (ret < 0) | ||
354 | dev_dbg(dev, "pm_runtime_put_sync failed\n"); | ||
355 | |||
356 | pm_runtime_disable(dev); | ||
357 | cdns_pcie_disable_phy(pcie); | ||
358 | } | ||
359 | |||
346 | static struct platform_driver cdns_pcie_host_driver = { | 360 | static struct platform_driver cdns_pcie_host_driver = { |
347 | .driver = { | 361 | .driver = { |
348 | .name = "cdns-pcie-host", | 362 | .name = "cdns-pcie-host", |
@@ -350,5 +364,6 @@ static struct platform_driver cdns_pcie_host_driver = { | |||
350 | .pm = &cdns_pcie_pm_ops, | 364 | .pm = &cdns_pcie_pm_ops, |
351 | }, | 365 | }, |
352 | .probe = cdns_pcie_host_probe, | 366 | .probe = cdns_pcie_host_probe, |
367 | .shutdown = cdns_pcie_shutdown, | ||
353 | }; | 368 | }; |
354 | builtin_platform_driver(cdns_pcie_host_driver); | 369 | builtin_platform_driver(cdns_pcie_host_driver); |