aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/dwc
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2017-09-20 01:24:15 -0400
committerBjorn Helgaas <bhelgaas@google.com>2017-10-11 15:30:13 -0400
commit9c049bea083fea21373b8baf51fe49acbe24e105 (patch)
tree2737c8a0159f5b7afdb87c3afb4a5055cecf0669 /drivers/pci/dwc
parent9e66317d3c92ddaab330c125dfe9d06eee268aff (diff)
PCI: dra7xx: Add shutdown handler to cleanly turn off clocks
Add shutdown handler to cleanly turn off clocks. This will help in cases of kexec where in a new kernel can boot abruptly. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/pci/dwc')
-rw-r--r--drivers/pci/dwc/pci-dra7xx.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
index 34427a6a15af..d0848006945a 100644
--- a/drivers/pci/dwc/pci-dra7xx.c
+++ b/drivers/pci/dwc/pci-dra7xx.c
@@ -794,6 +794,22 @@ static int dra7xx_pcie_resume_noirq(struct device *dev)
794} 794}
795#endif 795#endif
796 796
797void dra7xx_pcie_shutdown(struct platform_device *pdev)
798{
799 struct device *dev = &pdev->dev;
800 struct dra7xx_pcie *dra7xx = dev_get_drvdata(dev);
801 int ret;
802
803 dra7xx_pcie_stop_link(dra7xx->pci);
804
805 ret = pm_runtime_put_sync(dev);
806 if (ret < 0)
807 dev_dbg(dev, "pm_runtime_put_sync failed\n");
808
809 pm_runtime_disable(dev);
810 dra7xx_pcie_disable_phy(dra7xx);
811}
812
797static const struct dev_pm_ops dra7xx_pcie_pm_ops = { 813static const struct dev_pm_ops dra7xx_pcie_pm_ops = {
798 SET_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend, dra7xx_pcie_resume) 814 SET_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend, dra7xx_pcie_resume)
799 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend_noirq, 815 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dra7xx_pcie_suspend_noirq,
@@ -807,5 +823,6 @@ static struct platform_driver dra7xx_pcie_driver = {
807 .suppress_bind_attrs = true, 823 .suppress_bind_attrs = true,
808 .pm = &dra7xx_pcie_pm_ops, 824 .pm = &dra7xx_pcie_pm_ops,
809 }, 825 },
826 .shutdown = dra7xx_pcie_shutdown,
810}; 827};
811builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe); 828builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);