]> git.baikalelectronics.ru Git - kernel.git/commit
HID: core: Add hid_hw_may_wakeup() function
authorHans de Goede <hdegoede@redhat.com>
Sat, 29 May 2021 15:14:21 +0000 (17:14 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 25 Jun 2021 12:02:58 +0000 (14:02 +0200)
commitbcffaf755cd16c232b9a99e8995764bffff98d39
tree742acbeb0c903086fc3008ad795c7a15ee40705d
parentf65fec46ff04730c7837dde76e36c8727d2ef4ae
HID: core: Add hid_hw_may_wakeup() function

Add a hid_hw_may_wakeup() function, which is the equivalent of
device_may_wakeup() for hid devices.

In most cases this just returns device_may_wakeup(hdev->dev.parent), but for
some ll-drivers this is not correct. E.g. 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,
which is the usb-interface's parent.

For these special cases a new may_wakeup callback is added to
hid_ll_driver, so that ll-drivers can override the default behavior.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/hid.h