Repository navigation
Show the Surface Pro 11's battery cycle count from the Surface EC - #20484
turbineBMW wants to merge 1 commit into
Conversation
The Surface Pro 11's battery manager reports cycle_count 0: its ADSP firmware keeps no count. The Surface EC does, and microsoft-surface-pro-11-support writes it to /run/surface-pro-11-battery/cycle-count. omarchy-battery-status takes that file when the battery's own count is 0 or missing; a real count still wins and a file that isn't a number is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Low impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds a Surface EC fallback for the battery cycle count.
Reviews (3) · Last reviewed commit: "Show the Surface Pro 11's battery cycle ..." · Reviewed by Greptile |
|
GPT-6.2 Sol High in Codex, Opus 5.5 High and Muse Wonder High reviewed the fallback, its tests and the Power panel from source. We agreed the fallback matches the decimal count published by the proposed Surface support package. The reviews’ independence is unconfirmed. Worker tests and screenshots were skipped because the required release-branch protection could not be confirmed. Companion package PR The companion package is still a draft. The fallback also touches the same cycle-count block as #12484, which makes unavailable counts display as unknown. If that change lands first, the fallback and its tests will need to account for the new behavior. Once the updated support package is available, could a maintainer with a Surface Pro 11 confirm the before and after readings? Check out |
|
your commit is in #21013. the Surface EC cycle count is read in the same battery-status script as the locale-pinned time parser and the charger draw. @dhh @omarchybot if 21013 lands, this can close as superseded. |
|
GPT-6 High in Codex, Opus 5.5 High and Muse Wonder via pi at high effort checked the current base and the overlapping patch. We agreed that #21013 includes this exact fallback and its tests in #20881 removed the Power panel’s Charge cycles row. With the companion package installed, this change would now affect |
The Surface Pro 11's battery manager (
qcom-battmgr-bat) reportscycle_count0: the ADSP firmware sends no count, and it answers 0 to every per-property request too. The Surface EC has the real count, andmicrosoft-surface-pro-11-support(omacom/omarchy-pkgs#3782) reads it into/run/surface-pro-11-battery/cycle-count.omarchy-battery-statusnow takes that file when the battery'scycle_countis 0 or missing. A real count from sysfs always wins, a file that isn't a number is ignored, and without the file a 0 is still shown as before. Other machines don't change.Getting the count into the kernel's power supply instead would need either firmware that reports it or
qcom_battmgrasking the Surface EC, which is a different driver on a different bus, so this reads the file the support package writes.On the device:
cycles 0before,cycles 149after, which matches the EC.test/shell.d/battery-status-test.shcovers the 0, missing, real-count and unreadable-file cases.