diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2021-12-02 10:53:33 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2021-12-02 15:42:46 +0100 |
commit | 9e3562080950b6e3fe38a5e34ddd5b1c618f2019 (patch) | |
tree | da0537417266aa409ada15f7db968d21cc1ca7b8 /include/linux/hid.h | |
parent | 740bebf42104d2f082514b1545a14056f3b1b56c (diff) | |
download | lwn-9e3562080950b6e3fe38a5e34ddd5b1c618f2019.tar.gz lwn-9e3562080950b6e3fe38a5e34ddd5b1c618f2019.zip |
HID: add suspend/resume helpers
There is a lot of duplication of code in the HID low level drivers.
Better have everything in one place so we can eventually extend it
in a generic way.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20211202095334.14399-4-benjamin.tissoires@redhat.com
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 9e067f937dbc..ebe3ec98db6b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -923,6 +923,16 @@ s32 hid_snto32(__u32 value, unsigned n); __u32 hid_field_extract(const struct hid_device *hid, __u8 *report, unsigned offset, unsigned n); +#ifdef CONFIG_PM +int hid_driver_suspend(struct hid_device *hdev, pm_message_t state); +int hid_driver_reset_resume(struct hid_device *hdev); +int hid_driver_resume(struct hid_device *hdev); +#else +static inline int hid_driver_suspend(struct hid_device *hdev, pm_message_t state) { return 0; } +static inline int hid_driver_reset_resume(struct hid_device *hdev) { return 0; } +static inline int hid_driver_resume(struct hid_device *hdev) { return 0; } +#endif + /** * hid_device_io_start - enable HID input during probe, remove * |