Files
BPI-CM9-Linux/build/patch/kernel/archive/uefi-x86-6.19/4005-HID-magicmouse-fix-regression-breaking-support-for-M.patch

54 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aditya Garg <[email protected]>
Date: Wed, 8 Oct 2025 01:48:18 +0000
Subject: HID: magicmouse: fix regression breaking support for Magic Trackpad 1
The case HID_ANY_ID and default are technically the same, but the first
one was assigning no report to the Magic Trackpad 1, while the second
one assigns the correct report. Since the first case is matched first,
the Magic Trackpad 1 was not being assigned any report, breaking
support for it.
Signed-off-by: Aditya Garg <[email protected]>
---
drivers/hid/hid-magicmouse.c | 15 ++++------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 111111111111..222222222222 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -1589,7 +1589,7 @@ static int magicmouse_probe(struct hid_device *hdev,
report = hid_register_report(hdev, HID_INPUT_REPORT,
TRACKPAD2_USB_REPORT_ID, 0);
break;
- case HID_ANY_ID:
+ default:
switch (id->bus) {
case BUS_HOST:
report = hid_register_report(hdev, HID_INPUT_REPORT, MTP_REPORT_ID, 0);
@@ -1597,15 +1597,12 @@ static int magicmouse_probe(struct hid_device *hdev,
case BUS_SPI:
report = hid_register_report(hdev, HID_INPUT_REPORT, SPI_REPORT_ID, 0);
break;
- default:
- break;
+ default: /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */
+ report = hid_register_report(hdev, HID_INPUT_REPORT,
+ TRACKPAD_REPORT_ID, 0);
+ report = hid_register_report(hdev, HID_INPUT_REPORT,
+ DOUBLE_REPORT_ID, 0);
}
- break;
- default: /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */
- report = hid_register_report(hdev, HID_INPUT_REPORT,
- TRACKPAD_REPORT_ID, 0);
- report = hid_register_report(hdev, HID_INPUT_REPORT,
- DOUBLE_REPORT_ID, 0);
}
if (!report) {
--
Armbian