power: add charge-aware auto sleep mode for Pocket EVO - #273
Open
jesherman wants to merge 1 commit into
Open
Conversation
Deep sleep powers down the ADSP, killing the PD contract and the battery-manager firmware: a plugged-in EVO drains instead of charging (0 W in, ~1.5 A out) and the UCSI firmware can come back in source mode on wake. s2idle keeps the ADSP alive, so charging continues through sleep with a clean wake. Add an 'auto adjust' sleep mode that resolves per suspend: s2idle when a charger is present, deep otherwise. device-env resolves the choice from the qcom-battmgr USB supply so every consumer (suspend-dispatch, device-quirks) sees only a concrete mode; the armada-control backend and decky menu advertise the new option. Verified on-device (Pocket EVO, hybrid 7.2.0-rc7): plugged s2idle holds ~15-20 W through sleep with charging continuing and a clean wake; unplugged deep preserves the battery; attaching a charger during deep sleep no longer wedges the device.
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
Adds an "Auto adjust" sleep-mode option to armada-control that resolves per suspend: s2idle when a charger is present, deep sleep otherwise.
Why
Deep sleep powers down the ADSP on the Pocket EVO, which kills the PD contract and the battery-manager firmware:
"Auto adjust" picks per-suspend so the charge state can't be misconfigured: plugged → s2idle (charging continues), unplugged → deep (battery savings).
Design
The choice is resolved at suspend time, not stored as a kernel mode:
device-env— acceptsautoin/etc/armada/sleep.confand resolves it tos2idle/deepfrom the qcom-battmgr USB supply (online=1→ s2idle, else deep). Every existing consumer (suspend-dispatch, device-quirks) sees only a concrete mode — no change to the suspend path.armada-control— advertises the new option inavailable_sleep_modes();select_mem_sleep()deliberately skips writing/sys/power/mem_sleepfor it (it is a resolution layer, not a kernel mode).system.py— adds the "Auto adjust" entry to the sleep-mode menu.No kernel changes; no behavior change when the option is not selected (existing modes unchanged).
Verification (on-device, hybrid 7.2.0-rc7)
Closes the sleep-charging gap for Pocket EVO owners without forcing a single sleep mode on everyone.