Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 0/2] HID: battery reporting for Compx and Keychron Link mouse receivers
@ 2026-12-01  4:15 Zamiul Rashid via B4 Relay
  2026-12-01  4:15 ` [PATCH 1/2] HID: compx: add battery reporting for Compx 2.4 GHz receivers Zamiul Rashid via B4 Relay
  2026-12-01  4:15 ` [PATCH 2/2] HID: keychron: add battery reporting for the Keychron Link receiver Zamiul Rashid via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Zamiul Rashid via B4 Relay @ 2026-12-01  4:15 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-kernel, linux-input, Zamiul Rashid

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@gmail.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01  4:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  4:15 [PATCH 0/2] HID: battery reporting for Compx and Keychron Link mouse receivers Zamiul Rashid via B4 Relay
2026-12-01  4:15 ` [PATCH 1/2] HID: compx: add battery reporting for Compx 2.4 GHz receivers Zamiul Rashid via B4 Relay
2026-12-01  4:15 ` [PATCH 2/2] HID: keychron: add battery reporting for the Keychron Link receiver Zamiul Rashid via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox