HID: apple: Report Magic Keyboard 2021 battery over USB
authorJosé Expósito <jose.exposito89@gmail.com>
Tue, 8 Feb 2022 18:50:09 +0000 (19:50 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 16 Feb 2022 15:49:45 +0000 (16:49 +0100)
commit8ae5c16c9d421d43f32f66d2308031f1bd3f9336
treee39417c27cc224d9595370a501df93783775e4b1
parent250b369ed2380ba9accda31931e63ae351ab9f6d
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>
drivers/hid/hid-apple.c