Skip to content

Commit b587daf

Browse files
committed
hid: apple: Bind to HOST devices for MTP
We use BUS_HOST for MTP HID subdevices Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 4d7e9ec commit b587daf

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

drivers/hid/hid-apple.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,16 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
518518
else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
519519
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
520520
table = macbookair_fn_keys;
521-
else if (hid->vendor == SPI_VENDOR_ID_APPLE &&
522-
hid->product == SPI_DEVICE_ID_APPLE_MACBOOK_PRO13_2020)
523-
table = apple_fn_keys_mbp13;
524-
else if (hid->vendor == SPI_VENDOR_ID_APPLE)
525-
table = apple_fn_keys_spi;
521+
else if (hid->bus == BUS_HOST || hid->bus == BUS_SPI)
522+
switch (hid->product) {
523+
case SPI_DEVICE_ID_APPLE_MACBOOK_PRO13_2020:
524+
case HOST_DEVICE_ID_APPLE_MACBOOK_PRO13_2022:
525+
table = apple_fn_keys_mbp13;
526+
break;
527+
default:
528+
table = apple_fn_keys_spi;
529+
break;
530+
}
526531
else if (hid->product < 0x21d || hid->product >= 0x300)
527532
table = powerbook_fn_keys;
528533
else
@@ -877,7 +882,7 @@ static int apple_probe(struct hid_device *hdev,
877882
struct apple_sc *asc;
878883
int ret;
879884

880-
if (id->bus == BUS_SPI && id->vendor == SPI_VENDOR_ID_APPLE &&
885+
if ((id->bus == BUS_SPI || id->bus == BUS_HOST) && id->vendor == SPI_VENDOR_ID_APPLE &&
881886
hdev->type != HID_TYPE_SPI_KEYBOARD)
882887
return -ENODEV;
883888

@@ -1127,6 +1132,8 @@ static const struct hid_device_id apple_devices[] = {
11271132
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
11281133
{ HID_SPI_DEVICE(SPI_VENDOR_ID_APPLE, HID_ANY_ID),
11291134
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
1135+
{ HID_DEVICE(BUS_HOST, HID_GROUP_ANY, HOST_VENDOR_ID_APPLE, HID_ANY_ID),
1136+
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
11301137

11311138
{ }
11321139
};

0 commit comments

Comments
 (0)