Skip to contentSkip to conversation

HID: apple: Report Magic Keyboard 2021 battery over USB

PATCH New José Expósito 1 participant 1 message Jan 2, 2022 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/hid/hid-apple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-apple.c +1 -1
index 2bd8276411e0..afbee7c3b2e1 100644
@@ -719,7 +719,7 @@ static const struct hid_device_id apple_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
 		.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
-		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
 	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
 		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 
Signature · 1 line
2.25.1