From: Marek Szyprowski Date: Fri, 7 Dec 2018 11:21:14 +0000 (+0100) Subject: LOCAL / PCI: exynos: add simple suspend/resume methods X-Git-Tag: accepted/tizen/unified/20190330.030053~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c7519dff2a9ddeaee84f6a8bd8f16d79958444b;p=platform%2Fkernel%2Flinux-exynos.git LOCAL / PCI: exynos: add simple suspend/resume methods Signed-off-by: Marek Szyprowski Change-Id: I255983c0cbd6ee19b39c9c229d21139a46dc22f4 --- diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c index 7fd435f..e7474ae 100644 --- a/drivers/pci/dwc/pci-exynos.c +++ b/drivers/pci/dwc/pci-exynos.c @@ -598,6 +598,32 @@ static int __exit exynos_pcie_remove(struct platform_device *pdev) return 0; } +static int __maybe_unused exynos_pcie_suspend_noirq(struct device *dev) +{ + struct exynos_pcie *ep = dev_get_drvdata(dev); + + phy_power_off(ep->phy); + phy_exit(ep->phy); + + return 0; +} + +static int __maybe_unused exynos_pcie_resume_noirq(struct device *dev) +{ + struct exynos_pcie *ep = dev_get_drvdata(dev); + struct dw_pcie *pci = ep->pci; + struct pcie_port *pp = &pci->pp; + + exynos_pcie_host_init(pp); + + return 0; +} + +static const struct dev_pm_ops exynos_pcie_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos_pcie_suspend_noirq, + exynos_pcie_resume_noirq) +}; + static const struct of_device_id exynos_pcie_of_match[] = { { .compatible = "samsung,exynos5440-pcie", @@ -615,6 +641,7 @@ static struct platform_driver exynos_pcie_driver = { .driver = { .name = "exynos-pcie", .of_match_table = exynos_pcie_of_match, + .pm = &exynos_pcie_pm_ops, }, }; builtin_platform_driver(exynos_pcie_driver);