Repository navigation
Neo: take the jack codec's register restore off the wake (400 kHz bus, card-resume restore) - #1700
Merged
Merged
Conversation
The ADT gives each I2C device an SCL period in ns: 2500 for the codecs, speaker amps and backlight controllers of the J700, J414s and J714s, 10000 for slower parts such as the SD card reader and the DisplayPort converter. The J700's i2c0 carries the CS42L83 alone, and macOS runs it at 400 kHz. Linux took the 100 kHz default, and the codec's register restore after a sleep, single writes over a paged regmap, took 94 ms of the wake. Signed-off-by: Diljit Singh <hey@djdev.me>
The register restore after a sleep is about 100 ms of I2C writes, done in the device's resume, which the PM core waits for before user space thaws: the longest device resume of a J700 wake. ASoC resumes the card from deferred work, so that a slow codec doesn't hold up the system resume, and keeps user space off the card until it has finished. When ASoC suspended the codec, power it up in the device's resume as before and leave the restore to the component's resume, which that deferred work calls before DAPM and before the card is usable. The interrupt masks reset to masked, so the codec signals nothing until then. Either may come first; the restore runs once, on a powered codec, and a sleep that comes before it runs it first. defer_restore=0 restores in the device's resume, as before. Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr
marked this pull request as ready for review
November 12, 2026 16:25
The deferred restore was measured on the J700 alone. On the T8103 machines that use the same codec, ASoC gets the component driver without suspend and resume hooks, so the device's resume restores the registers itself, as before. Signed-off-by: Diljit Singh <hey@djdev.me>
This was referenced Nov 12, 2026
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.
Waking from a DRAM-kept sleep, the Neo (J700) used to spend 101 ms on the jack codec, the longest step of the resume phase after #1658. This takes it off the wake's critical path, and makes the work itself about 2.6 times faster.
Commits (on integration
cae47c00)4f556ae5arm64: dts: apple: t8140-j700: run the jack codec's bus at 400 kHzecdc0b67ASoC: cs42l83: restore the registers from the card's resumesnd_soc_cs42l83_i2c.defer_restore=0restores in the device's resume, as before.489291aaASoC: cs42l83: defer the register restore on T8140 onlyapple,t8140, the one machine it was measured on.Measured on the Neo (J700), 2026-11-12
Kit: the first two commits plus a debug-only commit (#1682's diagnostic line) on
cae47c00, aura main Stage 2, one boot (f48fc579). The booted DT hasclock-frequency = <400000>on i2c@385010000.dpm_resumephaseregcache_sync(kprobes)The "before" column is the #1658 measurements, on an earlier integration head.
Wake timing on the same boot, 16 DRAM-kept wakes alternating
defer_restore(both arms at 400 kHz). Medians, seconds after the PMU RTC alarm:Safety, same boot:
489291aawas build-checked only. On the J700 it changes nothing, since the root there is"apple,j700", "apple,t8140". It hasn't been run on a T8103 machine; there, it keeps the code path from before this PR.Playback right after a wake
Separate boot (2026-11-12 11:20), same kit: 3 DRAM-kept RTC wakes. At each wake, 1 s of silence was played on the jack's PCM (card AppleJ700, device 0 "Primary"; never the speakers) the moment user space thawed:
aplayrc 0;aplayreturned 1214, 1105 and 1104 ms after the thaw for 1 s of audio, so the card was usable within about 0.1–0.2 s, including its deferred register restore.🤖 Generated with Claude Code