PCI: rockchip: dw: remove wakeup if attached device is down

device_init_wakeup is used for PD driver to leave power-domain
opened during suspend. This feature was originally designed for
Wi-Fi. Check Wi-Fi's power to see if we need to remove wakeup
support before into suspend.

Change-Id: I468157b1d5f9775e3c961d1d059b167c0bb95395
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
Shawn Lin
2024-10-14 10:39:40 +08:00
committed by Tao Huang
parent 666775e30a
commit e15707617c

View File

@@ -1580,7 +1580,8 @@ static int rk_pcie_really_probe(void *p)
dw_pcie_dbi_ro_wr_dis(pci);
/* 7. framework misc settings */
device_init_wakeup(dev, true);
if (rk_pcie->skip_scan_in_resume)
device_init_wakeup(dev, true);
device_enable_async_suspend(dev); /* Enable async system PM for multiports SoC */
return 0;
@@ -1747,8 +1748,10 @@ static int __maybe_unused rockchip_dw_pcie_suspend(struct device *dev)
*/
if (rk_pcie->skip_scan_in_resume) {
rfkill_get_wifi_power_state(&power);
if (!power)
if (!power) {
device_init_wakeup(dev, false);
goto no_l2;
}
}
/* 2. Broadcast PME_Turn_Off Message */
@@ -1862,6 +1865,8 @@ static int __maybe_unused rockchip_dw_pcie_resume(struct device *dev)
dw_pcie_dbi_ro_wr_dis(rk_pcie->pci);
rk_pcie->in_suspend = false;
if (rk_pcie->skip_scan_in_resume)
device_init_wakeup(dev, true);
return 0;
err: