aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorWerner Sembach <wse@tuxedocomputers.com>2025-02-11 14:39:06 +0100
committerBenjamin Tissoires <bentiss@kernel.org>2025-05-13 15:59:29 +0200
commit6a9e76f75c1a8fffbf45d4665daaf24e7d30095f (patch)
treeb808df8954ad01c99d8f27cabab7f24cfe2962bc /drivers/hid
parentHID: core: Add functions for HID drivers to react on first open and last close call (diff)
downloadlinux-rng-6a9e76f75c1a8fffbf45d4665daaf24e7d30095f.tar.xz
linux-rng-6a9e76f75c1a8fffbf45d4665daaf24e7d30095f.zip
HID: multitouch: Disable touchpad on firmware level while not in use
Using the new on_hid_hw_open and on_hid_hw_close functions to disable the touchpad on firmware level while not being in use. This safes some battery and triggers touchpad-disabled-leds hardwired to the touchpads firmware, that exist for example on some TongFang barebones. For a lengthy discussion with all the details see https://gitlab.freedesktop.org/libinput/libinput/-/issues/558 Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Link: https://patch.msgid.link/20250211133950.422232-2-wse@tuxedocomputers.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-multitouch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e50887a6d22c..a8d0ef04d5aa 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1887,6 +1887,16 @@ static void mt_remove(struct hid_device *hdev)
hid_hw_stop(hdev);
}
+static void mt_on_hid_hw_open(struct hid_device *hdev)
+{
+ mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_ALL);
+}
+
+static void mt_on_hid_hw_close(struct hid_device *hdev)
+{
+ mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
+}
+
/*
* This list contains only:
* - VID/PID of products not working with the default multitouch handling
@@ -2354,5 +2364,7 @@ static struct hid_driver mt_driver = {
.suspend = pm_ptr(mt_suspend),
.reset_resume = pm_ptr(mt_reset_resume),
.resume = pm_ptr(mt_resume),
+ .on_hid_hw_open = mt_on_hid_hw_open,
+ .on_hid_hw_close = mt_on_hid_hw_close,
};
module_hid_driver(mt_driver);