Repository navigation
power: supply: macsmc: hold the charge with CHLS where CHTE and CH0C are absent - #1474
Merged
Merged
Conversation
…are absent The SMC firmware of the M4 Pro MacBook Pros has neither CHTE nor CH0C (and no CH0I), so charge_behaviour offers no inhibit-charge and no force-discharge there. It has the CHLS charge limit word and the CH0J inflow key. - inhibit-charge: where neither CHTE nor CH0C exists, set CHLS to the current charge (clamped to 10-99 %) with CHLS_HOLD (bit 9: hold at the limit instead of charging through to full) and no drain. The user's own limit is kept while the hold lasts: the end threshold still reads and sets it, and auto or auto-discharge writes it back. - force-discharge: where CH0I is absent, write 1 to CH0J to cut the external power inflow; 0 restores it. CH0J is a command key, so the state is read from CH0R bit 5. Macs with CHTE or CH0C keep their inhibit key, and bit 9 is left alone there. KUnit covers the hold, the restore of the user's limit, the CHTE precedence and CH0J. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This was referenced Nov 11, 2026
Merged
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.
The SMC firmware of the M4 Pro MacBook Pros has no CHTE, CH0C or CH0I, so
charge_behaviourthere offers onlyautoandauto-discharge. It does have the CHLS limit word and the CH0J inflow key.inhibit-chargewhere neither CHTE nor CH0C exists: CHLS = current charge (10-99 %) withCHLS_HOLD(bit 9, hold at the limit instead of charging through to full), no drain. The user's own limit is kept while the hold lasts (the end threshold reads and sets it) and is written back byauto/auto-discharge.force-dischargewhere CH0I is absent: CH0J = 1 cuts the external power inflow, 0 restores it. CH0J is a command key; the state comes from CH0R bit 5.Testing
KUnit (arm64 QEMU,
macsmc*): 24/24, including three new cases (hold and restore of the user's limit, CHTE precedence, CH0J).J616s (M4 Pro), 7.3.0-aurora-fleet53, this driver as a module, on external power:
[auto] auto-discharge[auto] inhibit-charge force-discharge auto-discharge[force-discharge][auto][inhibit-charge][auto]The end threshold read 100 throughout. s2idle x3 woken by the apple-pmu-rtc wakealarm: 3/3. SELinux enforcing, 0 AVCs, 0 speaker amp fault lines.
M2 (J413), same build, fleet53:
force-dischargeis now offered (CH0J) and runs the Mac from the battery on external power (Discharging, -1206 mA);autoreturns to Full;inhibit-chargestays on CHTE. s2idle 3/3, 0 AVCs.