84 lines
2.8 KiB
Diff
84 lines
2.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Kerem Karabay <[email protected]>
|
|
Date: Tue, 27 May 2025 22:13:17 +0530
|
|
Subject: HID: multitouch: add device ID for Apple Touch Bar
|
|
|
|
This patch adds the device ID of Apple Touch Bar found on x86 MacBook Pros
|
|
to the hid-multitouch driver.
|
|
|
|
Note that this is device ID is for T2 Macs. Testing on T1 Macs would be
|
|
appreciated.
|
|
|
|
Signed-off-by: Kerem Karabay <[email protected]>
|
|
Co-developed-by: Aditya Garg <[email protected]>
|
|
Signed-off-by: Aditya Garg <[email protected]>
|
|
---
|
|
drivers/hid/Kconfig | 1 +
|
|
drivers/hid/hid-multitouch.c | 17 ++++++++++
|
|
2 files changed, 18 insertions(+)
|
|
|
|
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/hid/Kconfig
|
|
+++ b/drivers/hid/Kconfig
|
|
@@ -754,6 +754,7 @@ config HID_MULTITOUCH
|
|
Say Y here if you have one of the following devices:
|
|
- 3M PCT touch screens
|
|
- ActionStar dual touch panels
|
|
+ - Apple Touch Bar on x86 MacBook Pros
|
|
- Atmel panels
|
|
- Cando dual touch panels
|
|
- Chunghwa panels
|
|
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/hid/hid-multitouch.c
|
|
+++ b/drivers/hid/hid-multitouch.c
|
|
@@ -216,6 +216,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
|
|
#define MT_CLS_GOOGLE 0x0111
|
|
#define MT_CLS_RAZER_BLADE_STEALTH 0x0112
|
|
#define MT_CLS_SMART_TECH 0x0113
|
|
+#define MT_CLS_APPLE_TOUCHBAR 0x0114
|
|
#define MT_CLS_SIS 0x0457
|
|
|
|
#define MT_DEFAULT_MAXCONTACT 10
|
|
@@ -401,6 +402,12 @@ static const struct mt_class mt_classes[] = {
|
|
MT_QUIRK_CONTACT_CNT_ACCURATE |
|
|
MT_QUIRK_SEPARATE_APP_REPORT,
|
|
},
|
|
+ { .name = MT_CLS_APPLE_TOUCHBAR,
|
|
+ .quirks = MT_QUIRK_HOVERING |
|
|
+ MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE |
|
|
+ MT_QUIRK_APPLE_TOUCHBAR,
|
|
+ .maxcontacts = 11,
|
|
+ },
|
|
{ .name = MT_CLS_SIS,
|
|
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
|
|
MT_QUIRK_ALWAYS_VALID |
|
|
@@ -1862,6 +1869,11 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
|
if (ret != 0)
|
|
return ret;
|
|
|
|
+ if (mtclass->name == MT_CLS_APPLE_TOUCHBAR &&
|
|
+ !hid_find_field(hdev, HID_INPUT_REPORT,
|
|
+ HID_DG_TOUCHPAD, HID_DG_TRANSDUCER_INDEX))
|
|
+ return -ENODEV;
|
|
+
|
|
if (mtclass->quirks & MT_QUIRK_FIX_CONST_CONTACT_ID)
|
|
mt_fix_const_fields(hdev, HID_DG_CONTACTID);
|
|
|
|
@@ -2349,6 +2361,11 @@ static const struct hid_device_id mt_devices[] = {
|
|
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
|
|
USB_DEVICE_ID_XIROKU_CSR2) },
|
|
|
|
+ /* Apple Touch Bar */
|
|
+ { .driver_data = MT_CLS_APPLE_TOUCHBAR,
|
|
+ HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
|
|
+ USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) },
|
|
+
|
|
/* Google MT devices */
|
|
{ .driver_data = MT_CLS_GOOGLE,
|
|
HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE,
|
|
--
|
|
Armbian
|
|
|