mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-30 02:16:59 +08:00
60 lines
2.1 KiB
Diff
60 lines
2.1 KiB
Diff
From aaee021a970f5f5fadabc4378c8260aee692e8ec Mon Sep 17 00:00:00 2001
|
|
From: Hector Martin <marcan@marcan.st>
|
|
Date: Fri, 8 Jul 2022 02:12:24 +0900
|
|
Subject: [PATCH 127/171] hid: apple: Bind to HOST devices for MTP
|
|
|
|
We use BUS_HOST for MTP HID subdevices
|
|
|
|
Signed-off-by: Hector Martin <marcan@marcan.st>
|
|
---
|
|
drivers/hid/hid-apple.c | 19 +++++++++++++------
|
|
1 file changed, 13 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
|
|
index 6700cbac2575..7dc7b8a6aea2 100644
|
|
--- a/drivers/hid/hid-apple.c
|
|
+++ b/drivers/hid/hid-apple.c
|
|
@@ -444,11 +444,16 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
|
else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
|
|
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
|
|
table = macbookair_fn_keys;
|
|
- else if (hid->vendor == SPI_VENDOR_ID_APPLE &&
|
|
- hid->product == SPI_DEVICE_ID_APPLE_MACBOOK_PRO13_2020)
|
|
- table = apple_fn_keys_mbp13;
|
|
- else if (hid->vendor == SPI_VENDOR_ID_APPLE)
|
|
- table = apple_fn_keys_spi;
|
|
+ else if (hid->bus == BUS_HOST || hid->bus == BUS_SPI)
|
|
+ switch (hid->product) {
|
|
+ case SPI_DEVICE_ID_APPLE_MACBOOK_PRO13_2020:
|
|
+ case HOST_DEVICE_ID_APPLE_MACBOOK_PRO13_2022:
|
|
+ table = apple_fn_keys_mbp13;
|
|
+ break;
|
|
+ default:
|
|
+ table = apple_fn_keys_spi;
|
|
+ break;
|
|
+ }
|
|
else if (hid->product < 0x21d || hid->product >= 0x300)
|
|
table = powerbook_fn_keys;
|
|
else
|
|
@@ -834,7 +839,7 @@ static int apple_probe(struct hid_device *hdev,
|
|
struct apple_sc *asc;
|
|
int ret;
|
|
|
|
- if (id->bus == BUS_SPI && id->vendor == SPI_VENDOR_ID_APPLE &&
|
|
+ if ((id->bus == BUS_SPI || id->bus == BUS_HOST) && id->vendor == SPI_VENDOR_ID_APPLE &&
|
|
hdev->type != HID_TYPE_SPI_KEYBOARD)
|
|
return -ENODEV;
|
|
|
|
@@ -1081,6 +1086,8 @@ static const struct hid_device_id apple_devices[] = {
|
|
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
|
{ HID_SPI_DEVICE(SPI_VENDOR_ID_APPLE, HID_ANY_ID),
|
|
.driver_data = APPLE_HAS_FN },
|
|
+ { HID_DEVICE(BUS_HOST, HID_GROUP_ANY, HOST_VENDOR_ID_APPLE,
|
|
+ HID_ANY_ID), .driver_data = APPLE_HAS_FN },
|
|
|
|
{ }
|
|
};
|
|
--
|
|
2.34.1
|
|
|