[PATCH 1/3] HID: pulsar: keep battery online across RF standby
From: Aaron Ma
Date: Mon Nov 23 2026 - 08:20:55 EST
Wireless mice using this protocol enter RF standby when idle, causing
CMD_STATUS to return 0, and may wake on motion without emitting
EVENT_PWR. Tying STATUS, PRESENT, and ONLINE to battery.available marks
the power supply offline and absent during standby, causing userspace
power managers to treat the device as disconnected, hide the battery,
and stop polling for updates.
Report ONLINE as 1 while the receiver is bound, matching hid-input, and
gate PRESENT and STATUS on battery.last_read so the battery stays absent
until the first valid reading and retains its cached state across RF
standby. Because CMD_STATUS does not distinguish RF standby from
power-off, the last reading remains visible until the receiver is
unplugged.
Fixes: e55cf379e822 ("HID: pulsar: add driver for Pulsar gaming mice")
Signed-off-by: Aaron Ma <mapengyu@xxxxxxxxx>
---
drivers/hid/hid-pulsar.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-pulsar.c b/drivers/hid/hid-pulsar.c
index a1f0dcda92df..e726dffb2f33 100644
--- a/drivers/hid/hid-pulsar.c
+++ b/drivers/hid/hid-pulsar.c
@@ -362,7 +362,7 @@ static int battery_get_property(struct power_supply *psy,
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
- if (!drvdata->battery.available)
+ if (!drvdata->battery.last_read)
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
else if (drvdata->battery.conn && drvdata->battery.level < 100)
val->intval = POWER_SUPPLY_STATUS_CHARGING;
@@ -378,8 +378,10 @@ static int battery_get_property(struct power_supply *psy,
val->intval = drvdata->battery.voltage * 1000;
break;
case POWER_SUPPLY_PROP_PRESENT:
+ val->intval = drvdata->battery.last_read != 0;
+ break;
case POWER_SUPPLY_PROP_ONLINE:
- val->intval = drvdata->battery.available;
+ val->intval = 1;
break;
case POWER_SUPPLY_PROP_SCOPE:
val->intval = POWER_SUPPLY_SCOPE_DEVICE;
--
2.55.0