lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] HID: usbhid: set mouse as a wakeup resource
Date
USB HID transport layer doesn't set mouse as a wakeup resource by default
so user can't wake system from s0i3 using wired USB mouse. However, users
can wake the same system from s0i3 with the same wired USB mouse
on Windows.

To work around this wakeup issue on Linux, the user must manually enable
wakeup via the following command:
echo enabled > /sys/bus/usb/device/*/power/wakeup

The mouse is set to wake resource by default to ensure the same behavior
across operating systems.

Signed-off-by: Richard Gong <richard.gong@amd.com>
---
drivers/hid/usbhid/hid-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 54752c85604b..571dded02b3d 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1183,8 +1183,10 @@ static int usbhid_start(struct hid_device *hid)
* devices supporting the boot protocol.
*/
if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
- interface->desc.bInterfaceProtocol ==
- USB_INTERFACE_PROTOCOL_KEYBOARD) {
+ ((interface->desc.bInterfaceProtocol ==
+ USB_INTERFACE_PROTOCOL_KEYBOARD)
+ || (interface->desc.bInterfaceProtocol ==
+ USB_INTERFACE_PROTOCOL_MOUSE))) {
usbhid_set_leds(hid);
device_set_wakeup_enable(&dev->dev, 1);
}
--
2.25.1
\
 
 \ /
  Last update: 2022-04-05 00:43    [W:0.046 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site