Skip to content

Commit 2c31ec9

Browse files
kekrbyJiri Kosina
authored andcommitted
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]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 45ca23c commit 2c31ec9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ config HID_MULTITOUCH
771771
Say Y here if you have one of the following devices:
772772
- 3M PCT touch screens
773773
- ActionStar dual touch panels
774+
- Apple Touch Bar on x86 MacBook Pros
774775
- Atmel panels
775776
- Cando dual touch panels
776777
- Chunghwa panels

drivers/hid/hid-multitouch.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
221221
#define MT_CLS_GOOGLE 0x0111
222222
#define MT_CLS_RAZER_BLADE_STEALTH 0x0112
223223
#define MT_CLS_SMART_TECH 0x0113
224+
#define MT_CLS_APPLE_TOUCHBAR 0x0114
224225
#define MT_CLS_SIS 0x0457
225226

226227
#define MT_DEFAULT_MAXCONTACT 10
@@ -406,6 +407,12 @@ static const struct mt_class mt_classes[] = {
406407
MT_QUIRK_CONTACT_CNT_ACCURATE |
407408
MT_QUIRK_SEPARATE_APP_REPORT,
408409
},
410+
{ .name = MT_CLS_APPLE_TOUCHBAR,
411+
.quirks = MT_QUIRK_HOVERING |
412+
MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE |
413+
MT_QUIRK_APPLE_TOUCHBAR,
414+
.maxcontacts = 11,
415+
},
409416
{ .name = MT_CLS_SIS,
410417
.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
411418
MT_QUIRK_ALWAYS_VALID |
@@ -1858,6 +1865,11 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
18581865
if (ret != 0)
18591866
return ret;
18601867

1868+
if (mtclass->name == MT_CLS_APPLE_TOUCHBAR &&
1869+
!hid_find_field(hdev, HID_INPUT_REPORT,
1870+
HID_DG_TOUCHPAD, HID_DG_TRANSDUCER_INDEX))
1871+
return -ENODEV;
1872+
18611873
if (mtclass->quirks & MT_QUIRK_FIX_CONST_CONTACT_ID)
18621874
mt_fix_const_fields(hdev, HID_DG_CONTACTID);
18631875

@@ -2349,6 +2361,11 @@ static const struct hid_device_id mt_devices[] = {
23492361
MT_USB_DEVICE(USB_VENDOR_ID_XIROKU,
23502362
USB_DEVICE_ID_XIROKU_CSR2) },
23512363

2364+
/* Apple Touch Bar */
2365+
{ .driver_data = MT_CLS_APPLE_TOUCHBAR,
2366+
HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
2367+
USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) },
2368+
23522369
/* Google MT devices */
23532370
{ .driver_data = MT_CLS_GOOGLE,
23542371
HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE,

0 commit comments

Comments
 (0)