Re: [PATCH v2 0/4] HID: avoid setting up battery timer when not needed in hid-apple and magicmouse

From: Jiri Kosina
Date: Thu Jul 03 2025 - 03:43:12 EST


On Mon, 30 Jun 2025, Aditya Garg wrote:

> Both hid-apple and hid-magicmouse require set up a battery timer for
> certain devices in order to fetch battery status. However, the timer
> is being set unconditionally for all devices. This patch series
> introduces checks to ensure that the battery timer is only set up for
> devices that actually require it.
>
> v2: - Address the cases of out_err and err_stop_hw left in v1
> - Create a function to check if the device is a USB Magic Mouse 2 or Magic Trackpad 2
> to reduce code duplication.
> - Add 2 new patches that convert the battery timeout to use
> secs_to_jiffies() instead of msecs_to_jiffies().
>
> Aditya Garg (4):
> HID: apple: avoid setting up battery timer for devices without battery
> HID: magicmouse: avoid setting up battery timer when not needed
> HID: apple: use secs_to_jiffies() for battery timeout
> HID: magicmouse: use secs_to_jiffies() for battery timeout
>
> drivers/hid/hid-apple.c | 21 +++++++-----
> drivers/hid/hid-magicmouse.c | 66 ++++++++++++++++++++++--------------
> 2 files changed, 54 insertions(+), 33 deletions(-)

Now queued in hid.git#for-6.17/battery-timer-fixes.

Thanks,

--
Jiri Kosina
SUSE Labs