diff options
author | Jiri Kosina | 2021-06-30 09:15:15 +0200 |
---|---|---|
committer | Jiri Kosina | 2021-06-30 09:15:15 +0200 |
commit | b3e29642548258c7cd2cb3326a776fff84cd6b69 (patch) | |
tree | 1c5da8119d9792ebf4d11ea4787c7529e97c8e53 /include/linux | |
parent | 8f4ef88ebadefcf16b7f616f8af940465c44bea2 (diff) | |
parent | 498d0ddc6ae931e4e79a57c56b6dd4576aa435b6 (diff) |
Merge branch 'for-5.14/multitouch' into for-linus
- patch series that ensures that hid-multitouch driver disables touch and
button-press reporting on hid-mt devices during suspend when the device is
not configured as a wakeup-source, from Hans de Goede
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hid.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index f05bf96a0d21..9e067f937dbc 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -801,6 +801,7 @@ struct hid_driver { * @raw_request: send raw report request to device (e.g. feature report) * @output_report: send output report to device * @idle: send idle request to device + * @may_wakeup: return if device may act as a wakeup source during system-suspend */ struct hid_ll_driver { int (*start)(struct hid_device *hdev); @@ -825,6 +826,7 @@ struct hid_ll_driver { int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len); int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype); + bool (*may_wakeup)(struct hid_device *hdev); }; extern struct hid_ll_driver i2c_hid_ll_driver; @@ -1151,6 +1153,22 @@ static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle, } /** + * hid_may_wakeup - return if the hid device may act as a wakeup source during system-suspend + * + * @hdev: hid device + */ +static inline bool hid_hw_may_wakeup(struct hid_device *hdev) +{ + if (hdev->ll_driver->may_wakeup) + return hdev->ll_driver->may_wakeup(hdev); + + if (hdev->dev.parent) + return device_may_wakeup(hdev->dev.parent); + + return false; +} + +/** * hid_hw_wait - wait for buffered io to complete * * @hdev: hid device |