Skip to content

Commit c7aa374

Browse files
archseerJiri Kosina
authored andcommitted
HID: multitouch: Set to high latency mode on suspend.
Per Windows Precision Touchpad guidelines: > The latency mode feature report is sent by the host to a Windows > Precision Touchpad to indicate when high latency is desirable for > power savings and, conversely, when normal latency is desired for > operation. > > For USB-connected Windows Precision Touchpads, this enables the device > to disambiguate between being suspended for inactivity (runtime IDLE) > and being suspended because the system is entering S3 or Connected > Standby. The current implementation would set the latency to normal on device initialization, but we didn't set the device to high latency on suspend. Signed-off-by: Blaž Hrastnik <blaz@mxxn.io> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 2bbe17a commit c7aa374

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,13 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
17461746
}
17471747

17481748
#ifdef CONFIG_PM
1749+
static int mt_suspend(struct hid_device *hdev, pm_message_t state)
1750+
{
1751+
/* High latency is desirable for power savings during S3/S0ix */
1752+
mt_set_modes(hdev, HID_LATENCY_HIGH, true, true);
1753+
return 0;
1754+
}
1755+
17491756
static int mt_reset_resume(struct hid_device *hdev)
17501757
{
17511758
mt_release_contacts(hdev);
@@ -1761,6 +1768,8 @@ static int mt_resume(struct hid_device *hdev)
17611768

17621769
hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE);
17631770

1771+
mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true);
1772+
17641773
return 0;
17651774
}
17661775
#endif
@@ -2154,6 +2163,7 @@ static struct hid_driver mt_driver = {
21542163
.event = mt_event,
21552164
.report = mt_report,
21562165
#ifdef CONFIG_PM
2166+
.suspend = mt_suspend,
21572167
.reset_resume = mt_reset_resume,
21582168
.resume = mt_resume,
21592169
#endif

0 commit comments

Comments
 (0)