[PATCH 1/2] HID: sony: handle RB4 PS5 guitars that do not report a battery level

From: Sanjay Govind

Date: Mon Nov 30 2026 - 21:08:03 EST


Rock Band 4 PS5 guitars report their battery state in byte 30 of the
input report, with the charging status in the high nibble and the
battery level, from 0 to 10, in the low nibble. A level of 0x0c means
that the guitar does not report its battery level, which is what the
CRKD Gibson SG and the RedOctane Games Gibson Kramer always send when
connected over USB. SDL handles this level the same way for PS5
controllers.

This is currently decoded as a discharging battery at 100%, as the
capacity is clamped. Report an unknown status instead whenever the
level is 0x0c. Keep the capacity at 100% so that this does not cause
low battery warnings.

Fixes: e4bdeaef0351 ("HID: sony: add battery status support for Rock Band 4 PS5 guitars")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Sanjay Govind <sanjay.govind9@xxxxxxxxx>
---

Notes:
Tested with a Gibson SG (3651:8600) and a Gibson Kramer (3958:5600),
both in PS5 mode over USB, which always report 0x0c in byte 30. Before
this patch their batteries were reported as discharging at 100%; with
it, they are reported as unknown at 100%.

Built hid-sony.ko with W=1 against the 7.3.6 headers, no warnings;
checkpatch clean.

The patch and changelog were written with the help of an AI coding
assistant (Claude Opus 5.5).

drivers/hid/hid-sony.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 50f5ad6bbeb4..7a25f5acce88 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1159,6 +1159,16 @@ static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
charging_status = (rd[30] >> 4) & 0x0F;
battery_data = rd[30] & 0x0F;

+ /*
+ * A level of 0x0c means that the guitar does not report its battery
+ * level. Keep the capacity at 100% to avoid low battery warnings.
+ */
+ if (battery_data == 0x0c) {
+ battery_capacity = 100;
+ battery_status = POWER_SUPPLY_STATUS_UNKNOWN;
+ goto out;
+ }
+
switch (charging_status) {
case 0x0:
battery_capacity = min(battery_data * 10 + 5, 100);
@@ -1178,6 +1188,7 @@ static int rb4_ps5_guitar_raw_event(struct sony_sc *sc, u8 *rd, int size)
break;
}

+out:
scoped_guard(spinlock_irqsave, &sc->lock) {
sc->battery_capacity = battery_capacity;
sc->battery_status = battery_status;
--
2.56.1