
The HID core code with the upcoming Linux 7.1 kernel is set to support multiple batteries per device. The HID device structure rather than being able to point to just one battery will now have a list of batteries with unique report IDs. API compatibility is retained for code expecting the "get battery" call to point just to a single battery to avoid any possible breakage.
This commit adjusting the hid-core and hid-input code is queued now into HID's for-next Git branch ahead of the Linux 7.1 merge window in April.
That followed a restructuring of the HID battery code as part of the fore-next Git branch as well.
Lucas Zampieri has been working through the Linux HID code for being able to properly handle HID devices with multiple batteries. Among the multi-battery device scenarios noted in the patch series include gaming headsets with batteries in both the headset and charging dock, wireless earbuds with per-earbud batteries and charging case, and split keyboards with per-side barries. Now beginning with Linux 7.1, these devices with multiple batteries will be able to properly report their state.
While the kernel work is complete, user-space software can be better adapted to deal with multi-battery scenarios for enumerating all batteries, desktop environments can improve labeling of multiple-battery devices, and systemd entry updates for device-specific battery role mappings. More details within the prior v7 patch series .