batteryplus: snap the visible percent on resume in PMIC mode - #3325
Merged
porschemad911 merged 1 commit intoSep 14, 2026
Merged
Conversation
The daemon's long-gap snap only exists in voltage mode. In PMIC mode a resume goes through the ordinary step limiter, one point at a time and never counting down while charging, so a kernel gauge that corrected itself across a sleep stays hidden from the UI: after a 10 h suspend on an RG353M the kernel read 63 % while /tmp/battery.percent, and so ES, sat at 87 % because the device woke on the charger. In PMIC mode the kernel value is the authority and has already done its own reconciliation. Snap to it whenever a resume is detected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Jacob-Matthew-Cook
marked this pull request as ready for review
September 14, 2026 05:09
Contributor
Author
|
@porschemad911 ready for review — small batteryplus patch, validated on the RG353M (details in the description). #3324 is the companion for the RK3566 sleep drain. |
Contributor
|
@Jacob-Matthew-Cook are you going to open a PR to https://github.com/Mikhailzrick/knubat.components with these changes? Edit: Also for the changes in https://github.com/ROCKNIX/distribution/blob/next/projects/ROCKNIX/packages/tools/batteryplus/patches/0001-discover-voltage_avg-fallback.patch |
Contributor
Author
|
@porschemad911 Opened upstream with both ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
/tmp/battery.percent, and so ES, stayed at 87 % because the device woke on the charger. Fixed daemon run in place of the stock one, then a built image with the patch./tmp/battery.percenttracking the kernel afterwards. Restart of the daemon with a stale value also resyncs immediately.Additional Context
/tmp/battery.percent, so this affects every RK817 handheld withBATTERYPLUS_SUPPORTregardless of the setting.AI Usage
Did you use AI tools to help write this code? YES
🤖 Generated with Claude Code