kernel/0120-feat-PCIe-Controller-PM-support-power-on-off.patch

49 lines
1.4 KiB
Diff

From b988fcd7467121680cc887930ae8b04556c87253 Mon Sep 17 00:00:00 2001
From: huzhixuan <huzhixuan@eswincomputing.com>
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 <huzhixuan@eswincomputing.com>
---
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