]> git.baikalelectronics.ru Git - kernel.git/commitdiff
HID: multitouch: Disable event reporting on suspend when the device is not a wakeup...
authorHans de Goede <hdegoede@redhat.com>
Sat, 29 May 2021 15:14:24 +0000 (17:14 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 25 Jun 2021 12:02:59 +0000 (14:02 +0200)
Disable event reporting on suspend when the hid device is not
a wakeup-source. This should help save some extra power in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-multitouch.c

index 2e4fb76c45f3d2fe24f9f73eb3244aee618b3088..3ea7cb1cda84c391111292d6e3457c53ce79ac56 100644 (file)
@@ -1768,7 +1768,8 @@ static int mt_suspend(struct hid_device *hdev, pm_message_t state)
        struct mt_device *td = hid_get_drvdata(hdev);
 
        /* High latency is desirable for power savings during S3/S0ix */
-       if (td->mtclass.quirks & MT_QUIRK_DISABLE_WAKEUP)
+       if ((td->mtclass.quirks & MT_QUIRK_DISABLE_WAKEUP) ||
+           !hid_hw_may_wakeup(hdev))
                mt_set_modes(hdev, HID_LATENCY_HIGH, false, false);
        else
                mt_set_modes(hdev, HID_LATENCY_HIGH, true, true);