Skip to content

Commit 6a9e76f

Browse files
tuxedo-wseBenjamin Tissoires
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent a98e892 commit 6a9e76f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,16 @@ static void mt_remove(struct hid_device *hdev)
18871887
hid_hw_stop(hdev);
18881888
}
18891889

1890+
static void mt_on_hid_hw_open(struct hid_device *hdev)
1891+
{
1892+
mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_ALL);
1893+
}
1894+
1895+
static void mt_on_hid_hw_close(struct hid_device *hdev)
1896+
{
1897+
mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
1898+
}
1899+
18901900
/*
18911901
* This list contains only:
18921902
* - VID/PID of products not working with the default multitouch handling
@@ -2354,5 +2364,7 @@ static struct hid_driver mt_driver = {
23542364
.suspend = pm_ptr(mt_suspend),
23552365
.reset_resume = pm_ptr(mt_reset_resume),
23562366
.resume = pm_ptr(mt_resume),
2367+
.on_hid_hw_open = mt_on_hid_hw_open,
2368+
.on_hid_hw_close = mt_on_hid_hw_close,
23572369
};
23582370
module_hid_driver(mt_driver);

0 commit comments

Comments
 (0)