HID: corsair-sabre: Add Corsair Sabre v2 Pro battery driver
PATCH 1/1 HID: corsair-sabre: Add Corsair Sabre v2 Pro battery driver
The Corsair Sabre v2 Pro Ultralight wireless receiver (1b1c:2b2a) does not use Corsair's Bragi protocol. Its vendor interface takes output report 0x08 with a command byte and a checksum that makes all 17 bytes sum to 0x55, and answers with input report 0x08 in the same layout. Command 0x03 reports whether the mouse is connected, and command 0x04 returns the battery level in percent, a charging flag and the battery voltage in mV.
Add a driver that exposes this as a device-scope power_supply with present, online, status, capacity and voltage_now, so that UPower and desktop environments show the mouse battery.
The receiver does not report the mouse being switched off, or going to sleep after about 3 minutes without input. Both look the same: the status command reports it as disconnected. The driver therefore polls every 30 seconds, or every 5 seconds while the mouse is disconnected. It also refreshes right away when the receiver sends its unsolicited power event (charging cable plugged or unplugged, mouse switched on). Polling stops across system suspend. The battery is read once in probe, before it is registered, so that its first values are real ones. Capacity keeps the last known value while the mouse is disconnected, because UPower ignores a device battery whose capacity cannot be read when it first appears; online is cleared instead.
The charging flag stays set at 100% while the cable is plugged in, so the driver never reports POWER_SUPPLY_STATUS_FULL.
hidraw keeps working alongside the driver. The mouse and keyboard interfaces are passed through unchanged.
Tested with a Sabre v2 Pro on 7.3.5, and on hid/for-next with lockdep, KASAN, UBSAN, debug objects and kmemleak enabled: level, charging state and voltage match the vendor protocol; charging cable plug and unplug, mouse power off and on, idle sleep, receiver hot-plug, module reload and unbind/rebind loops, S3 and s2idle suspend. No reports from the debug options.
The protocol was reverse-engineered by sniffing the receiver's vendor interface. The driver and this changelog were written with the help of an AI coding assistant (Claude Code, Claude Opus 5.5), then reviewed and tested on hardware by the author.
--- drivers/hid/Kconfig | 2 + drivers/hid/Makefile | 2 +- drivers/hid/hid-corsair-sabre.c | 482 ++++++++++++++++++++++++++++++++ drivers/hid/hid-ids.h | 1 + 4 files changed, 486 insertions(+), 1 deletion(-) create mode 100644 drivers/hid/hid-corsair-sabre.c
drivers/hid/Kconfig +2 -0
@@ -251,11 +251,13 @@ config HID_CORSAIR Support for Corsair devices that are not fully compliant with the HID standard. Support for Corsair Void headsets. + Support for the Corsair Sabre v2 Pro mouse battery. Supported devices: - Vengeance K90 - Scimitar PRO RGB - Corsair Void headsets + - Sabre v2 Pro Ultralight wireless receiver config HID_COUGAR tristate "Cougar devices"
drivers/hid/Makefile +1 -1
@@ -41,7 +41,7 @@ obj-$(CONFIG_HID_BIGBEN_FF) += hid-bigbenff.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o obj-$(CONFIG_HID_CHICONY) += hid-chicony.o obj-$(CONFIG_HID_CMEDIA) += hid-cmedia.o -obj-$(CONFIG_HID_CORSAIR) += hid-corsair.o hid-corsair-void.o +obj-$(CONFIG_HID_CORSAIR) += hid-corsair.o hid-corsair-void.o hid-corsair-sabre.o obj-$(CONFIG_HID_COUGAR) += hid-cougar.o obj-$(CONFIG_HID_CP2112) += hid-cp2112.o obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
drivers/hid/hid-corsair-sabre.c new file +482 -0
482 lines not on this page · raw message
drivers/hid/hid-ids.h +1 -0
@@ -385,6 +385,7 @@#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e +#define USB_DEVICE_ID_CORSAIR_SABRE_V2_PRO_RECEIVER 0x2b2a#define USB_VENDOR_ID_CREATIVELABS 0x041e#define USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51 0x322c
Signature · 1 line
2.56.1