[PATCH 0/2] HID: battery reporting for Compx and Keychron Link mouse receivers

From: Zamiul Rashid via B4 Relay

Date: Mon Nov 30 2026 - 23:15:43 EST


Two common 2.4 GHz mouse receivers do not describe the mouse battery
with standard HID usages, so the battery level never reaches userspace.
Each uses its own vendor protocol. I worked both out while writing
whiskerd [1], a small userspace daemon that reads these batteries
through hidraw today. These patches move that into the kernel so the
batteries show up in UPower without extra software.

Patch 1 adds hid-compx for Compx receivers (248a:5b2f), sold with
Ajazz, Delux, Genesis, Inphic and other mice. They answer a status
query on feature report 0x0c, which the driver polls.

Patch 2 adds hid-keychron for the Keychron Link receiver (3434:d031).
It pushes the battery level in input report 0x54 when the mouse
connects or wakes, and the driver listens for it.

Both drivers register a power_supply with scope Device once the first
reading has arrived. Tested on 7.0 with an Ajazz AJ179P and a Keychron
M6: the levels match what whiskerd reads, and UPower picks them up.

One note: both receivers also expose keyboard interfaces, and the
Keychron Link a joystick, so UPower currently labels the batteries
"keyboard" and "gaming-input". That comes from UPower's sibling-type
heuristic, not from these drivers.

[1] https://github.com/Zamiul-rashid/whiskerd

---
Zamiul Rashid (2):
HID: compx: add battery reporting for Compx 2.4 GHz receivers
HID: keychron: add battery reporting for the Keychron Link receiver

drivers/hid/Kconfig | 22 +++
drivers/hid/Makefile | 2 +
drivers/hid/hid-compx.c | 330 +++++++++++++++++++++++++++++++++++++++++++++
drivers/hid/hid-ids.h | 2 +
drivers/hid/hid-keychron.c | 236 ++++++++++++++++++++++++++++++++
5 files changed, 592 insertions(+)
---
base-commit: bb9d297a5b045256691b68ddd3aedd25595f527f
change-id: 20261201-compx-keychron-battery-97caad05a9f0

Best regards,
--
Zamiul Rashid <zamiulrashid1@xxxxxxxxx>