[v15 2/6] usb: host: xhci-plat: Enable wakeup based on children wakeup status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



device_wakeup_path() tells if any of the children devices needs
wakeup. Use this hint to enable/disable wakeup of our device. This
helps the parent device of xhci-plat (like sysdev) to retrieve
the wakeup setting via device_wakeup_path().

Signed-off-by: Krishna Kurapati <quic_kriskura@xxxxxxxxxxx>
---
 drivers/usb/host/xhci-plat.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 649ffd8..ad585fa 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -415,6 +415,14 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
 	if (pm_runtime_suspended(dev))
 		pm_runtime_resume(dev);
 
+	if (device_wakeup_path(dev)) {
+		if (!device_may_wakeup(dev))
+			device_wakeup_enable(dev);
+	} else {
+		if (device_may_wakeup(dev))
+			device_wakeup_disable(dev);
+	}
+
 	ret = xhci_priv_suspend_quirk(hcd);
 	if (ret)
 		return ret;
-- 
2.7.4




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux