]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: multitouch: specify that Apple Touch Bar is direct
authorKerem Karabay <kekrby@gmail.com>
Tue, 27 May 2025 16:43:16 +0000 (22:13 +0530)
committerJiri Kosina <jkosina@suse.com>
Wed, 11 Jun 2025 09:25:26 +0000 (11:25 +0200)
Currently the driver determines the device type based on the
application, but this value is not reliable on Apple Touch Bar, where
the application is HID_DG_TOUCHPAD even though this device is direct,
so add a quirk 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 756136f84168160644b7c2d599fcf69ab7584077..31b88eb43527fa88aa9e12da431f7a5b9ca8b616 100644 (file)
@@ -1349,6 +1349,13 @@ static int mt_touch_input_configured(struct hid_device *hdev,
        if (td->serial_maybe)
                mt_post_parse_default_settings(td, app);
 
+       /*
+        * The application for Apple Touch Bars is HID_DG_TOUCHPAD,
+        * but these devices are direct.
+        */
+       if (cls->quirks & MT_QUIRK_APPLE_TOUCHBAR)
+               app->mt_flags |= INPUT_MT_DIRECT;
+
        if (cls->is_indirect)
                app->mt_flags |= INPUT_MT_POINTER;