Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v2 1/3] HID: pulsar: keep battery online across RF standby
@ 2026-11-24 14:13 Aaron Ma
  2026-11-24 14:13 ` [PATCH v2 2/3] HID: pulsar: resume device for raw command execution Aaron Ma
  2026-11-24 14:13 ` [PATCH v2 3/3] HID: pulsar: add support for Akko Gaming Mouse Aaron Ma
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Ma @ 2026-11-24 14:13 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, Nikolas Koesling, linux-input

Wireless mice can enter RF standby and wake on motion without sending a
power event. Reporting ONLINE as 0 when CMD_STATUS indicates that the
mouse is unavailable makes UPower stop polling, so it can miss the
mouse becoming available again.

Report ONLINE as 1 while the receiver is bound so userspace can keep
polling. Keep PRESENT and STATUS tied to battery availability so an
unavailable mouse is reported as absent rather than showing a stale
charging or discharging state.

Fixes: e55cf379e822 ("HID: pulsar: add driver for Pulsar gaming mice")
Signed-off-by: Aaron Ma <mapengyu@gmail.com>
---
Changes in v2:
- Keep PRESENT and STATUS tied to battery.available; change only ONLINE.

v1: https://lore.kernel.org/all/20261123141542.8128-1-mapengyu@gmail.com/

 drivers/hid/hid-pulsar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-pulsar.c b/drivers/hid/hid-pulsar.c
index a1f0dcda92df..86b1050230e9 100644
--- a/drivers/hid/hid-pulsar.c
+++ b/drivers/hid/hid-pulsar.c
@@ -378,9 +378,11 @@ static int battery_get_property(struct power_supply *psy,
 		val->intval = drvdata->battery.voltage * 1000;
 		break;
 	case POWER_SUPPLY_PROP_PRESENT:
-	case POWER_SUPPLY_PROP_ONLINE:
 		val->intval = drvdata->battery.available;
 		break;
+	case POWER_SUPPLY_PROP_ONLINE:
+		val->intval = 1;
+		break;
 	case POWER_SUPPLY_PROP_SCOPE:
 		val->intval = POWER_SUPPLY_SCOPE_DEVICE;
 		break;
-- 
2.55.0


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

end of thread, other threads:[~2026-11-24 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 14:13 [PATCH v2 1/3] HID: pulsar: keep battery online across RF standby Aaron Ma
2026-11-24 14:13 ` [PATCH v2 2/3] HID: pulsar: resume device for raw command execution Aaron Ma
2026-11-24 14:13 ` [PATCH v2 3/3] HID: pulsar: add support for Akko Gaming Mouse Aaron Ma

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