summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-04-02 13:21:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 10:30:23 -0700
commit2c43858d67b0474fde66cf50469438242ba17a3e (patch)
treec8e39c778e7e184ad274ae81457c7874257fa737
parent01b9cd5d1870fb45aa398124366fe872255b523c (diff)
HID: usbhid: enable remote wakeup for keyboards
commit 3d61510f4ecacfe47c75c0eb51c0659dfa77fb1b upstream. This patch (as1365) enables remote wakeup by default for USB keyboard devices. Keyboards in general are supposed to be wakeup devices, but the correct place to enable it depends on the device's bus; no single approach will work for all keyboard devices. In particular, this covers only USB keyboards (and then only those supporting the boot protocol). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/hid/usbhid/hid-core.c7
-rw-r--r--drivers/hid/usbhid/usbkbd.c1
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 7b85b696fdab..5242684e1b0b 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1019,12 +1019,15 @@ static int usbhid_start(struct hid_device *hid)
/* Some keyboards don't work until their LEDs have been set.
* Since BIOSes do set the LEDs, it must be safe for any device
* that supports the keyboard boot protocol.
+ * In addition, enable remote wakeup by default for all keyboard
+ * devices supporting the boot protocol.
*/
if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
interface->desc.bInterfaceProtocol ==
- USB_INTERFACE_PROTOCOL_KEYBOARD)
+ USB_INTERFACE_PROTOCOL_KEYBOARD) {
usbhid_set_leds(hid);
-
+ device_set_wakeup_enable(&dev->dev, 1);
+ }
return 0;
fail:
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index f843443ba5c3..b2fd0b00de92 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -313,6 +313,7 @@ static int usb_kbd_probe(struct usb_interface *iface,
goto fail2;
usb_set_intfdata(iface, kbd);
+ device_set_wakeup_enable(&dev->dev, 1);
return 0;
fail2: