]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: apple: avoid setting up battery timer for devices without battery
authorAditya Garg <gargaditya08@live.com>
Mon, 30 Jun 2025 12:37:13 +0000 (12:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:30:56 +0000 (18:30 +0200)
commitdfa79be0b45bb4b32f545b854b7a68e599345f51
tree4d5cbfdf6660ee0ca3855fa4fe5e29f4c2ea6f55
parent16decac6ed8fda6ea4010f55087823e2599d601a
HID: apple: avoid setting up battery timer for devices without battery

commit c061046fe9ce3ff31fb9a807144a2630ad349c17 upstream.

Currently, the battery timer is set up for all devices using hid-apple,
irrespective of whether they actually have a battery or not.

APPLE_RDESC_BATTERY is a quirk that indicates the device has a battery
and needs the battery timer. This patch checks for this quirk before
setting up the timer, ensuring that only devices with a battery will
have the timer set up.

Fixes: 6e143293e17a ("HID: apple: Report Magic Keyboard battery over USB")
Cc: stable@vger.kernel.org
Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-apple.c