[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240522092257.19373-1-huanglei814@163.com>
Date: Wed, 22 May 2024 17:22:57 +0800
From: huanglei814 <huanglei814@....com>
To: jikos@...nel.org,
bentiss@...nel.org
Cc: linux-usb@...r.kernel.org,
linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org,
huanglei <huanglei@...inos.cn>
Subject: [PATCH] HID: usbhid: enable remote wakeup for mouse
From: huanglei <huanglei@...inos.cn>
This patch enables remote wakeup by default for USB mouse
devices. Mouse can used to be wakeup devices, but the correct
place to enable it depends on the device's bus; no single
approach will work for all mouse devices. In particular, this
covers only USB mouse (and then only those supporting the boot
protocol).
Signed-off-by: huanglei <huanglei@...inos.cn>
---
drivers/hid/usbhid/hid-core.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index a90ed2ceae84..7ed3ab36426d 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1189,6 +1189,15 @@ static int usbhid_start(struct hid_device *hid)
device_set_wakeup_enable(&dev->dev, 1);
}
+ /* enable remote wakeup by default for all mouse
+ * devices supporting the boot protocol.
+ */
+ if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
+ interface->desc.bInterfaceProtocol ==
+ USB_INTERFACE_PROTOCOL_MOUSE) {
+ device_set_wakeup_enable(&dev->dev, 1);
+ }
+
mutex_unlock(&usbhid->mutex);
return 0;
--
2.17.1
Powered by blists - more mailing lists