You've already forked linux-t2-patches
mirror of
https://github.com/t2linux/linux-t2-patches.git
synced 2026-04-30 13:52:11 -07:00
Use hid-magicmouse for trackpad
This commit is contained in:
@@ -1,175 +0,0 @@
|
|||||||
From 327e6e1d0f6e8db68c124dff4d6a326b381ccedb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aun-Ali Zaidi <admin@kodeit.net>
|
|
||||||
Date: Wed, 23 Mar 2022 17:12:21 +0530
|
|
||||||
Subject: [PATCH] Input: bcm5974 - Add support for the T2 Macs
|
|
||||||
|
|
||||||
---
|
|
||||||
drivers/input/mouse/bcm5974.c | 138 ++++++++++++++++++++++++++++++++++
|
|
||||||
1 file changed, 138 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
|
|
||||||
index 59a14505b..88f17f21a 100644
|
|
||||||
--- a/drivers/input/mouse/bcm5974.c
|
|
||||||
+++ b/drivers/input/mouse/bcm5974.c
|
|
||||||
@@ -83,6 +83,24 @@
|
|
||||||
#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273
|
|
||||||
#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274
|
|
||||||
|
|
||||||
+/* T2-Attached Devices */
|
|
||||||
+/* MacbookAir8,1 (2018) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K 0x027a
|
|
||||||
+/* MacbookPro15,2 (2018) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 0x027b
|
|
||||||
+/* MacbookPro15,1 (2018) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680 0x027c
|
|
||||||
+/* MacbookPro15,4 (2019) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213 0x027d
|
|
||||||
+/* MacbookPro16,2 (2020) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K 0x027e
|
|
||||||
+/* MacbookPro16,3 (2020) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223 0x027f
|
|
||||||
+/* MacbookAir9,1 (2020) */
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K 0x0280
|
|
||||||
+/* MacbookPro16,1 (2019)*/
|
|
||||||
+#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F 0x0340
|
|
||||||
+
|
|
||||||
#define BCM5974_DEVICE(prod) { \
|
|
||||||
.match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
|
|
||||||
USB_DEVICE_ID_MATCH_INT_CLASS | \
|
|
||||||
@@ -147,6 +165,22 @@ static const struct usb_device_id bcm5974_table[] = {
|
|
||||||
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI),
|
|
||||||
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ISO),
|
|
||||||
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
|
|
||||||
+ /* MacbookAir8,1 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K),
|
|
||||||
+ /* MacbookPro15,2 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132),
|
|
||||||
+ /* MacbookPro15,1 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680),
|
|
||||||
+ /* MacbookPro15,4 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213),
|
|
||||||
+ /* MacbookPro16,2 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K),
|
|
||||||
+ /* MacbookPro16,3 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223),
|
|
||||||
+ /* MacbookAir9,1 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K),
|
|
||||||
+ /* MacbookPro16,1 */
|
|
||||||
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F),
|
|
||||||
/* Terminating entry */
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
@@ -483,6 +517,110 @@ static const struct bcm5974_config bcm5974_config_table[] = {
|
|
||||||
{ SN_COORD, -203, 6803 },
|
|
||||||
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
},
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -6243, 6749 },
|
|
||||||
+ { SN_COORD, -170, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -6243, 6749 },
|
|
||||||
+ { SN_COORD, -170, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -7456, 7976 },
|
|
||||||
+ { SN_COORD, -1768, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -6243, 6749 },
|
|
||||||
+ { SN_COORD, -170, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -7823, 8329 },
|
|
||||||
+ { SN_COORD, -370, 7925 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -6243, 6749 },
|
|
||||||
+ { SN_COORD, -170, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -6243, 6749 },
|
|
||||||
+ { SN_COORD, -170, 7685 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F,
|
|
||||||
+ 0,
|
|
||||||
+ 0,
|
|
||||||
+ HAS_INTEGRATED_BUTTON,
|
|
||||||
+ 0, sizeof(struct bt_data),
|
|
||||||
+ 0x83, DATAFORMAT(TYPE4),
|
|
||||||
+ { SN_PRESSURE, 0, 300 },
|
|
||||||
+ { SN_WIDTH, 0, 2048 },
|
|
||||||
+ { SN_COORD, -8916, 9918 },
|
|
||||||
+ { SN_COORD, -1934, 9835 },
|
|
||||||
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
||||||
+ },
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
|||||||
|
From 165066841c211201b3f228f03e18e28423e98e94 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aditya Garg <gargaditya08@live.com>
|
||||||
|
Date: Mon, 10 Mar 2025 22:53:28 +0530
|
||||||
|
Subject: [PATCH 1/3] HID: quirks: remove T2 devices from hid_mouse_ignore_list
|
||||||
|
|
||||||
|
In order to use hid-magicmouse for T2 trackpads, we need to
|
||||||
|
remove them from hid_mouse_ignore_list
|
||||||
|
|
||||||
|
Signed-off-by: Aditya Garg <gargaditya08@live.com>
|
||||||
|
---
|
||||||
|
drivers/hid/hid-quirks.c | 8 --------
|
||||||
|
1 file changed, 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
|
||||||
|
index e0bbf0c63..2eb15a7ae 100644
|
||||||
|
--- a/drivers/hid/hid-quirks.c
|
||||||
|
+++ b/drivers/hid/hid-quirks.c
|
||||||
|
@@ -956,14 +956,6 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K) },
|
||||||
|
- { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
||||||
|
{ }
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
From cc2712238a3179b046f7cd36a24a9a606b99aa81 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aditya Garg <gargaditya08@live.com>
|
||||||
|
Date: Mon, 10 Mar 2025 23:03:29 +0530
|
||||||
|
Subject: [PATCH 2/3] HID: apple: ignore the trackpad on T2 Macs
|
||||||
|
|
||||||
|
In order to manage the trackpad on T2 Macs by hid-magicmouse driver
|
||||||
|
we need to ensure that it is not bound by the hid-apple driver. Use
|
||||||
|
the existing APPLE_IGNORE_MOUSE quirk for the same.
|
||||||
|
|
||||||
|
Signed-off-by: Aditya Garg <gargaditya08@live.com>
|
||||||
|
---
|
||||||
|
drivers/hid/hid-apple.c | 23 +++++++++++++++--------
|
||||||
|
1 file changed, 15 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
|
||||||
|
index a33260293..fdfbfe6ab 100644
|
||||||
|
--- a/drivers/hid/hid-apple.c
|
||||||
|
+++ b/drivers/hid/hid-apple.c
|
||||||
|
@@ -963,6 +963,9 @@ static int apple_probe(struct hid_device *hdev,
|
||||||
|
hdev->type != HID_TYPE_SPI_KEYBOARD)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
+ if (quirks & APPLE_IGNORE_MOUSE && hdev->type == HID_TYPE_USBMOUSE)
|
||||||
|
+ return -ENODEV;
|
||||||
|
+
|
||||||
|
asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL);
|
||||||
|
if (asc == NULL) {
|
||||||
|
hid_err(hdev, "can't alloc apple descriptor\n");
|
||||||
|
@@ -1180,21 +1183,25 @@ static const struct hid_device_id apple_devices[] = {
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
|
||||||
|
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK |
|
||||||
|
+ APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK |
|
||||||
|
+ APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK |
|
||||||
|
+ APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL | APPLE_ISO_TILDE_QUIRK |
|
||||||
|
+ APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F),
|
||||||
|
- .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||||
|
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_IGNORE_MOUSE },
|
||||||
|
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
|
||||||
|
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||||
|
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ CONFIG_BT_HCIUART=m
|
|||||||
CONFIG_HID_APPLETB_BL=m
|
CONFIG_HID_APPLETB_BL=m
|
||||||
CONFIG_HID_APPLETB_KBD=m
|
CONFIG_HID_APPLETB_KBD=m
|
||||||
CONFIG_HID_APPLE=m
|
CONFIG_HID_APPLE=m
|
||||||
|
CONFIG_HID_MAGICMOUSE=m
|
||||||
CONFIG_DRM_APPLETBDRM=m
|
CONFIG_DRM_APPLETBDRM=m
|
||||||
CONFIG_DRM_KUNIT_TEST=m
|
CONFIG_DRM_KUNIT_TEST=m
|
||||||
CONFIG_HID_SENSOR_ALS=m
|
CONFIG_HID_SENSOR_ALS=m
|
||||||
|
|||||||
Reference in New Issue
Block a user