From b8c4606c8ec7dd59ab75a8b09c285abc5118bf88 Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Sun, 18 Sep 2016 16:26:07 +0800 Subject: [PATCH] hid: usbhid: enable hid to wakeup system if it supports remote wakeup Refer to E.2 (P67) of Device Class Definition for Human Interface Devices V1.11, the bmAttributes field of the standard configuration descriptor bit 5 should be set if the HID support Remote Wakeup. This patch enable the usb HID to wake up the system if the HID supports remote wakeup. Change-Id: I169c49ff6187b6400b91633332a72964caca1a94 Signed-off-by: Frank Wang --- drivers/hid/usbhid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 17a29ee0ac6c..6bb15885997e 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1191,6 +1191,9 @@ static int usbhid_start(struct hid_device *hid) device_set_wakeup_enable(&dev->dev, 1); } + if (dev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) + device_set_wakeup_enable(&dev->dev, 1); + mutex_unlock(&usbhid->mutex); return 0;