From 40d69205f4ffe54214c6ad36d0cbb112a8b4cb63 Mon Sep 17 00:00:00 2001 From: huzhixuan Date: Thu, 25 Jul 2024 18:13:06 +0800 Subject: [PATCH 120/222] feat:PCIe Controller PM support power on/off. Changelogs: 1.PCIe Controller PM support power on/off. Signed-off-by: huzhixuan --- drivers/pci/controller/dwc/pcie-eswin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c index 498a26304aea..e8d60d183d2b 100644 --- a/drivers/pci/controller/dwc/pcie-eswin.c +++ b/drivers/pci/controller/dwc/pcie-eswin.c @@ -409,14 +409,15 @@ static const struct of_device_id eswin_pcie_of_match[] = { static int eswin_pcie_suspend(struct device *dev) { struct eswin_pcie *pcie = dev_get_drvdata(dev); - int err = 0; dev_dbg(dev, "%s\n", __func__); if (!pm_runtime_status_suspended(dev)) { - err = eswin_pcie_clk_disable(pcie); + win2030_tbu_power(pcie->pci.dev, false); + eswin_pcie_power_off(pcie); + eswin_pcie_clk_disable(pcie); } - return err; + return 0; } static int eswin_pcie_resume(struct device *dev) @@ -426,7 +427,7 @@ static int eswin_pcie_resume(struct device *dev) dev_dbg(dev, "%s\n", __func__); if (!pm_runtime_status_suspended(dev)) { - err = eswin_pcie_clk_enable(pcie); + err = eswin_pcie_host_init(&pcie->pci.pp); } return err; -- 2.47.0