HID: magicmouse: Report battery level over USB
authorJosé Expósito <jose.exposito89@gmail.com>
Thu, 18 Nov 2021 16:52:08 +0000 (17:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:27 +0000 (11:04 +0100)
commite6ad399596bd234be4722022146e33e15c7e424d
tree2528c4642e109f1a27c6059afe2cbee16f206f59
parentc350fcc74035f48ee5a7226faee7079dd0ce9565
HID: magicmouse: Report battery level over USB

[ Upstream commit 0b91b4e4dae63cd43871fc2012370b86ee588f91 ]

When connected over USB, the Apple Magic Mouse 2 and the Apple Magic
Trackpad 2 register multiple 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.

Fix the battery report descriptor and add a timer to fetch the battery
level.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-magicmouse.c