Skip to content

Commit 978e786

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: usbhid: Implement may_wakeup ll-driver callback
Without a ll-driver callback hid_hw_may_wakeup() will return: device_may_wakeup(hdev->dev.parent), usb_hid_driver instantiated hid devices have their parent set to the usb-interface to which the usb_hid_driver is bound, but the power/wakeup* sysfs attributes are part of the usb-device. Add a may_wakeup ll-driver callback which calls device_may_wakeup() on the usb-device instead. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 24e166f commit 978e786

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/hid/usbhid/hid-core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,13 @@ static int usbhid_idle(struct hid_device *hid, int report, int idle,
13041304
return hid_set_idle(dev, ifnum, report, idle);
13051305
}
13061306

1307+
static bool usbhid_may_wakeup(struct hid_device *hid)
1308+
{
1309+
struct usb_device *dev = hid_to_usb_dev(hid);
1310+
1311+
return device_may_wakeup(&dev->dev);
1312+
}
1313+
13071314
struct hid_ll_driver usb_hid_driver = {
13081315
.parse = usbhid_parse,
13091316
.start = usbhid_start,
@@ -1316,6 +1323,7 @@ struct hid_ll_driver usb_hid_driver = {
13161323
.raw_request = usbhid_raw_request,
13171324
.output_report = usbhid_output_report,
13181325
.idle = usbhid_idle,
1326+
.may_wakeup = usbhid_may_wakeup,
13191327
};
13201328
EXPORT_SYMBOL_GPL(usb_hid_driver);
13211329

0 commit comments

Comments
 (0)