Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Blaž Hrastnik and committed by
Jiri Kosina
c7aa374e 2bbe17ae

+10
+10
drivers/hid/hid-multitouch.c
··· 1746 1746 } 1747 1747 1748 1748 #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 + 1749 1756 static int mt_reset_resume(struct hid_device *hdev) 1750 1757 { 1751 1758 mt_release_contacts(hdev); ··· 1767 1760 * Tested on 3M, Stantum, Cypress, Zytronic, eGalax, and Elan panels. */ 1768 1761 1769 1762 hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE); 1763 + 1764 + mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true); 1770 1765 1771 1766 return 0; 1772 1767 } ··· 2163 2154 .event = mt_event, 2164 2155 .report = mt_report, 2165 2156 #ifdef CONFIG_PM 2157 + .suspend = mt_suspend, 2166 2158 .reset_resume = mt_reset_resume, 2167 2159 .resume = mt_resume, 2168 2160 #endif