Skip to content

Commit 8ae5c16

Browse files
JoseExpositoJiri Kosina
authored andcommitted
HID: apple: Report Magic Keyboard 2021 battery over USB
Like the Apple Magic Keyboard 2015, when connected over USB, the 2021 version registers 2 different interfaces. One of them is used to report the battery level. However, unlike when connected over Bluetooth, the battery level is not reported automatically and it is required to fetch it manually. Add the APPLE_RDESC_BATTERY quirk to fix the battery report descriptor and manually fetch the battery level. Tested with the ANSI, ISO and JIS variants of the keyboard. Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 250b369 commit 8ae5c16

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hid/hid-apple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ static const struct hid_device_id apple_devices[] = {
800800
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
801801
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
802802
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
803-
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
803+
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
804804
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
805805
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
806806
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021),

0 commit comments

Comments
 (0)