HID: hyperx: Add battery support for the Cloud Alpha Wireless headset
Subsystems (2)
PATCH 1/1 HID: hyperx: Add battery support for the Cloud Alpha Wireless headset
The HyperX Cloud Alpha Wireless dongle (03f0:098d) reports the headset's battery level and charging state through vendor-defined reports on page 0xff43, report id 0x21. Expose them as a power_supply so UPower and desktop battery indicators pick them up, while normal HID input (the consumer control keys) keeps working.
The dongle answers queries for the connection state (0x03), battery level (0x0b) and charging state (0x0c), and announces connection and charging changes unsolicited with their own codes (0x24, 0x26) and the same values. The battery level is not announced, so it is polled every 60 seconds, and immediately after the headset connects and on resume.
The battery is registered only while the headset is connected, and only once its first level is known: UPower treats a device-scope supply whose capacity cannot be read as an AC adapter and never re-reads it.
Tested on a Cloud Alpha Wireless: power on/off and plugging/unplugging the charging cable are reflected within about a second, and the state is refreshed after suspend/resume, including when the headset was switched off while suspended.
The headset support was written with the help of an AI coding assistant (Claude Opus 5.5, Claude Code), based on reverse engineering the protocol from the dongle's report descriptor and hidraw traces; the QuadCast 2 code is unchanged apart from being restricted to its device.
--- drivers/hid/Kconfig | 17 +- drivers/hid/hid-hyperx.c | 407 ++++++++++++++++++++++++++++++++++++++- drivers/hid/hid-ids.h | 1 + 3 files changed, 414 insertions(+), 11 deletions(-)
drivers/hid/Kconfig +12 -5
@@ -434,17 +434,24 @@ config HOLTEK_FF and want to have force feedback support for it. config HID_HYPERX - tristate "HyperX microphones" + tristate "HyperX microphones and headsets" depends on USB_HID + select POWER_SUPPLY help - Support for the mute button of HyperX microphones. + Support for the mute button of HyperX microphones and the battery + of HyperX wireless headsets. + + The microphone mute button is handled in the device firmware and only + reports the resulting mute state through a vendor-defined collection, + so without this driver userspace never learns that the microphone was + muted. - The button is handled in the device firmware and only reports the - resulting mute state through a vendor-defined collection, so without - this driver userspace never learns that the microphone was muted. + The headset battery level and charging state are reported through + vendor-defined reports and exposed as a power supply. Supported devices: - HyperX QuadCast 2 + - HyperX Cloud Alpha Wireless config HID_VIVALDI_COMMON tristate
drivers/hid/hid-hyperx.c +401 -6
481 lines not on this page · raw message
drivers/hid/hid-ids.h +1 -0
@@ -710,6 +710,7 @@#define USB_VENDOR_ID_HP 0x03f0#define USB_PRODUCT_ID_HP_HYPERX_QUADCAST_2 0x07b4 +#define USB_PRODUCT_ID_HP_HYPERX_CLOUD_ALPHA_WIRELESS 0x098d#define USB_PRODUCT_ID_HP_ELITE_PRESENTER_MOUSE_464A 0x464a#define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A 0x0a4a#define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a
Signature · 1 line
2.56.1