Skip to contentSkip to conversation

USB: ehci-pci: Check and enable wakeup capability

PATCH In review Sameer Nanda 2 participants 2 messages Sep 13, 2011 – Sep 14, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: ehci-pci: Check and enable wakeup capability

If the PORTWAK register is implemented and at least one of the physical ports is enabled for wakeup, enable wakeup for the ehci-pci device.

---
 drivers/usb/host/ehci-pci.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-pci.c +10 -0
index 1102ce6..ce6f784 100644
@@ -285,6 +285,16 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 			dev_warn(&pdev->dev, "Enabling legacy PCI PM\n");
 			device_set_wakeup_capable(&pdev->dev, 1);
 		}
+	} else {
+		u16	port_wake;
+
+		pci_read_config_word(pdev, 0x62, &port_wake);
+
+		/* If PORTWAK register is implemented and at least one USB
+		 * port is enabled for wakeup, enable wakeup.
+		 */
+		if (port_wake & 0x0001 && port_wake & 0xfffe)
+			device_set_wakeup_enable(&pdev->dev, 1);
 	}
 
 #ifdef	CONFIG_USB_SUSPEND
Signature · 1 line
1.7.3.1
maintainer
#1 lore raw
Quoted 2 lines · Sameer Nanda

If the PORTWAK register is implemented and at least one of the physical ports is enabled for wakeup, enable wakeup for the ehci-pci device.

NAK. Our current policy is that devices do not get enabled for wakeup by default unless users expect it (things like keyboards and power buttons, maybe LAN interfaces).

One certainly can question this policy. It might make sense to enable wakeup for devices that don't generate wakeup events on their own but merely act as bridges for other devices. By this reasoning, all USB host controllers should always be enabled for wakeup by default -- not just some of the PCI-based controllers. But this is a separate matter and should be discussed on the mailing list.

Alan Stern