]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
HID: multitouch: take cls->maxcontacts into account for Apple Touch Bar even without...
authorKerem Karabay <kekrby@gmail.com>
Tue, 27 May 2025 16:43:15 +0000 (22:13 +0530)
committerJiri Kosina <jkosina@suse.com>
Wed, 11 Jun 2025 09:25:26 +0000 (11:25 +0200)
In Apple Touch Bar, the HID_DG_CONTACTMAX is not present, but the maximum
contact count is still greater than the default. Add quirks for the same.

Acked-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Kerem Karabay <kekrby@gmail.com>
Co-developed-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-multitouch.c

index e3382afc74c946f8c0ebac08e8b91627124189b9..756136f84168160644b7c2d599fcf69ab7584077 100644 (file)
@@ -1335,6 +1335,13 @@ static int mt_touch_input_configured(struct hid_device *hdev,
        struct input_dev *input = hi->input;
        int ret;
 
+       /*
+        * HID_DG_CONTACTMAX field is not present on Apple Touch Bars,
+        * but the maximum contact count is greater than the default.
+        */
+       if (cls->quirks & MT_QUIRK_APPLE_TOUCHBAR && cls->maxcontacts)
+               td->maxcontacts = cls->maxcontacts;
+
        if (!td->maxcontacts)
                td->maxcontacts = MT_DEFAULT_MAXCONTACT;