summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2021-02-23 11:36:19 +0100
committerJiri Kosina <jkosina@suse.cz>2021-02-23 11:36:19 +0100
commit31d31fa52cec5da73f6c2c8908db3cfed7a88099 (patch)
tree42c5225a8b664615f2535389dd71c37f41547ce7 /drivers/hid/hid-multitouch.c
parentfc590a35d54cde8a6c8f44b447987648f0375623 (diff)
parentc7aa374e0000daa89201fc29912b60081b269339 (diff)
Merge branch 'for-5.12/multitouch' into for-linus
- hid-multitouch devices should be put into high-latency mode when suspended in order to be in line with Windows Precision Touchpad guidelines. From Blaž Hrastnik.
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 8429ebe7097e..9d9f3e1bd5f4 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1747,6 +1747,13 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
}
#ifdef CONFIG_PM
+static int mt_suspend(struct hid_device *hdev, pm_message_t state)
+{
+ /* High latency is desirable for power savings during S3/S0ix */
+ mt_set_modes(hdev, HID_LATENCY_HIGH, true, true);
+ return 0;
+}
+
static int mt_reset_resume(struct hid_device *hdev)
{
mt_release_contacts(hdev);
@@ -1762,6 +1769,8 @@ static int mt_resume(struct hid_device *hdev)
hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE);
+ mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true);
+
return 0;
}
#endif
@@ -2155,6 +2164,7 @@ static struct hid_driver mt_driver = {
.event = mt_event,
.report = mt_report,
#ifdef CONFIG_PM
+ .suspend = mt_suspend,
.reset_resume = mt_reset_resume,
.resume = mt_resume,
#endif