Linux Input/HID development
 help / color / mirror / Atom feed
From: Nikolas Koesling <nikolas@koesling.info>
To: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux-input@vger.kernel.org, Aaron Ma <mapengyu@gmail.com>
Subject: Re: [PATCH 1/3] HID: pulsar: keep battery online across RF standby
Date: Mon, 23 Nov 2026 20:40:51 +0100	[thread overview]
Message-ID: <ppdppF9HS6q1hX_QC0gzmA@koesling.info> (raw)
In-Reply-To: <20261123141542.8128-1-mapengyu@gmail.com>

Hi Aaron,

thank you for the patch.

> 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.

I can confirm this. With ONLINE reported as 0, upower 1.91.5 stops polling the
battery and does not notice when the mouse comes back.
 
> 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.

I don't think keeping the cached state is the right trade-off. When the
mouse is switched off, it keeps reporting "discharging" with the same
level for hours, and if it was switched off while charging it would
report "charging" until it is turned on again or the receiver is
unplugged.

>  	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;

I tested a variant that keeps STATUS and PRESENT tied to
battery.available and only reports ONLINE as 1: 

        case POWER_SUPPLY_PROP_PRESENT:
                val->intval = drvdata->battery.available;
                break;
        case POWER_SUPPLY_PROP_ONLINE:
                val->intval = 1;
                break;

With upower 1.91.5 the battery keeps being polled, and while the mouse
is in standby or switched off it is shown as absent instead of with
stale values. Could you send a v2 with only the ONLINE change and
update the commit message accordingly?

Thanks,
Nikolas





      parent reply	other threads:[~2026-11-23 19:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 14:15 [PATCH 1/3] HID: pulsar: keep battery online across RF standby Aaron Ma
2026-11-23 14:15 ` [PATCH 2/3] HID: pulsar: resume device for raw command execution Aaron Ma
2026-11-23 14:15 ` [PATCH 3/3] HID: pulsar: add support for Akko Gaming Mouse Aaron Ma
2026-11-23 19:40 ` Nikolas Koesling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ppdppF9HS6q1hX_QC0gzmA@koesling.info \
    --to=nikolas@koesling.info \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mapengyu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox