BatteryPlus: RK817 discovery fallback and PMIC-mode resume snap - #1
Open
Jacob-Matthew-Cook wants to merge 2 commits into
Open
Jacob-Matthew-Cook wants to merge 2 commits into
Jacob-Matthew-Cook wants to merge 2 commits into
Conversation
Battery discovery only accepts a supply exposing voltage_now, so in voltage mode the daemon exits with "No battery voltage path detected" on PMICs whose driver reports the averaged reading instead. The Rockchip RK817 charger driver (RK3326/RK3566 handhelds) exposes voltage_avg only. Use voltage_avg when voltage_now is missing; the averaged value is, if anything, a better input for the daemon's own smoothing, and unit autodetection is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNwUueUVhNqodU1izyxqAK
The long-gap snap only exists in voltage mode. In PMIC mode a resume goes through the ordinary step limiter, which moves one point at a time and never counts down while charging, so a kernel gauge that corrected itself across a sleep is hidden from the UI: after a 10 h suspend on an RG353M the kernel read 63 % while /tmp/battery.percent, and with it the frontend, stayed 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; smoothing is there for jitter, not for corrections. Snap to it whenever a resume is detected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNwUueUVhNqodU1izyxqAK
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
voltage_avgwhenvoltage_nowis absent. The RK817 charger driver exposes only the averaged reading, so voltage mode exited with "No battery voltage path detected".Testing
/tmp/battery.percenttracking the kernel afterwards; a daemon restart with a stale value resyncs immediately.Additional Context
0001-discover-voltage_avg-fallback(merged, batteryplus: enable on RK3326 and RK3566 ROCKNIX/distribution#3311) and0002-pmic-mode-snap-visible-percent-on-resume(batteryplus: snap the visible percent on resume in PMIC mode ROCKNIX/distribution#3325). Opened at @porschemad911's request so ROCKNIX can drop the patches once this lands.AI Usage
Did you use AI tools to help write this code? YES
🤖 Generated with Claude Code
https://claude.ai/code/session_01RNwUueUVhNqodU1izyxqAK