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)
committerJiri Kosina <jkosina@suse.com>
Thu, 3 Jul 2025 07:41:40 +0000 (09:41 +0200)
commitc061046fe9ce3ff31fb9a807144a2630ad349c17
treee7fe4551fec5340cb12dd124110bf7451870a0fd
parent8a20830f2dd180064f25254d9c55beb243fe9223
HID: apple: avoid setting up battery timer for devices without battery

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>
drivers/hid/hid-apple.c