-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch
88 lines (83 loc) · 3.76 KB
/
4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
From 8a980335aa7495020760fb507bb906975b864ada Mon Sep 17 00:00:00 2001
From: Aditya Garg <[email protected]>
Date: Tue, 18 Mar 2025 21:27:25 +0530
Subject: [PATCH 5/5] HID: magicmouse: Add MacBookPro15,1 replacement trackpad
support
This commit adds support for third party replacement trackpad for
MacBookPro15,1 with a different PID in hid-magicmouse.
Signed-off-by: Aditya Garg <[email protected]>
---
drivers/hid/hid-magicmouse.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index eb62752d7..769c31706 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -150,6 +150,17 @@ MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state fie
#define J680_TP_RES_Y \
((J680_TP_MAX_Y - J680_TP_MIN_Y) / (J680_TP_DIMENSION_Y / 100))
+#define J680_ALT_TP_DIMENSION_X (float)16000
+#define J680_ALT_TP_MIN_X -7456
+#define J680_ALT_TP_MAX_X 7976
+#define J680_ALT_TP_RES_X \
+ ((J680_ALT_TP_MAX_X - J680_ALT_TP_MIN_X) / (J680_ALT_TP_DIMENSION_X / 100))
+#define J680_ALT_TP_DIMENSION_Y (float)10000
+#define J680_ALT_TP_MIN_Y -163
+#define J680_ALT_TP_MAX_Y 9283
+#define J680_ALT_TP_RES_Y \
+ ((J680_ALT_TP_MAX_Y - J680_ALT_TP_MIN_Y) / (J680_ALT_TP_DIMENSION_Y / 100))
+
#define J213_TP_DIMENSION_X (float)13500
#define J213_TP_MIN_X -6243
#define J213_TP_MAX_X 6749
@@ -311,6 +322,7 @@ static int magicmouse_enable_multitouch(struct hid_device *hdev)
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680_ALT:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223:
@@ -1204,6 +1216,7 @@ static const struct magicmouse_t2_properties magicmouse_t2_configs[] = {
T2_TOUCHPAD_ENTRY(J140K),
T2_TOUCHPAD_ENTRY(J132),
T2_TOUCHPAD_ENTRY(J680),
+ T2_TOUCHPAD_ENTRY(J680_ALT),
T2_TOUCHPAD_ENTRY(J213),
T2_TOUCHPAD_ENTRY(J214K),
T2_TOUCHPAD_ENTRY(J223),
@@ -1439,6 +1452,7 @@ static int magicmouse_probe(struct hid_device *hdev,
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680_ALT:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223:
@@ -1471,6 +1485,7 @@ static int magicmouse_probe(struct hid_device *hdev,
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680_ALT:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223:
@@ -1552,6 +1567,7 @@ static int magicmouse_probe(struct hid_device *hdev,
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680:
+ case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680_ALT:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K:
case USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223:
@@ -1659,6 +1675,8 @@ static const struct hid_device_id magic_mice[] = {
USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132), .driver_data = 0 },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680), .driver_data = 0 },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680_ALT), .driver_data = 0 },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213), .driver_data = 0 },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE,
--
2.43.0