Skip to content

ASoC: apple: J713 (M4 MacBook Air) headphone jack on the AOP (depends on #434) - #437

Closed
erikwb wants to merge 9 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/aop-jack
Closed

erikwb wants to merge 9 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/aop-jack

Conversation

@erikwb

@erikwb erikwb commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The headphone jack on the J713 (MacBook Air 13" M4): playback, the headset microphone, and plug detection, all through the AOP the same way as on the J616s.

Depends on #434. The first five commits are that PR; this one adds the last four. Rebased onto the reworked #434 (bootloader AOP handoff); these four commits are unchanged.

Commits

  1. ASoC: apple: aop_audio: Register the jack without a speaker stream. Until now the jack component was only registered along with the speaker one, so a machine whose audio node lists cout/cin but not spkr got no jack. Now each component registers where the node lists its own channels. Creating the services doesn't reach the firmware, and nothing changes on the J616s, which lists all of them.

  2. ASoC: dt-bindings: apple,macaudio: Add the J713 jack

  3. ASoC: apple: macaudio: Add the J713 jack. This reuses the J616s jack configuration, including its −6 dB cap on the headphone DAC; this board's analog full scale is unmeasured too.

  4. arm64: dts: apple: t8132-j713: Add the headphone jack. It adds:

    • the CS42L84 on i2c1 at 0x4b, with reset on nub GPIO 17 and the interrupt on AP GPIO 98, level-low (from the ADT audio-codec-output);
    • the jack's ADMAC channels on the AOP audio node (base-ns TX2/RX2, as on the J616s);
    • the jack's own card.

    It also enables ps_i2c1 in the J713 power-domain policy. That policy keeps every i2c domain disabled until it has a consumer. Without it, i2c-apple times out (−110) and the codec never probes.

No speaker stream, amp nodes or speaker card are added. The speakers still can't be driven.

Testing

J713 with #434 and this PR on integration/aurora 420a1c8. The test kernel also carries #429, #432 and the #389 hash.

  • cs42l84 0-004b: Cirrus Logic CS42L84, Revision: 36; the "MacBook Air J713 Jack" card registers.
  • The cap holds: Jack DAC Playback Volume tops out at step 244, i.e. −6 dB.
  • Playback: a 440 Hz tone at −20 dBFS with the DAC at −30 dB is audible. The DMA runs in real time and the DAPM path from Headphone Playback Mux through Jack HP to Headphone is on.
  • Stereo: a left-only tone then a right-only tone came out of the left then the right earcup. The cout slots line up; the J616s PR left that open.
  • Plug detection: unplugging and replugging flips Headphone Jack and Headset Mic Jack off and back on, with one codec interrupt per event.
  • Headset microphone (cin): captures speech at about −10 dBFS over a −50 dBFS floor, at 0 dB PGA and +10 dB preamp. It clipped at +10 dB, so it's back at 0.
  • No DART or AOP errors during any of it.

Checks:

  • checkpatch --strict is clean on all four commits.
  • rustfmt is clean.
  • dt_binding_check passes for apple,macaudio.yaml.
  • dtbs_check on t8132-j713.dtb reports nothing for the codec, the jack card or the AOP.

Not tested:

  • The jack across system sleep (J713 suspend is still refused).
  • Headphone impedance detection, which this driver doesn't do, as on the J616s.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the four commits above #434, including paired cout/cin channel detection, optional component registration, teardown ownership, the codec DT wiring and reuse of the J616s jack configuration. Constructing the unused speaker service does not reach firmware. The J713 jack retains the existing minus 6 dB DAC cap, and no speaker card or amp nodes are added. The attribution check found no additional Gravity-derived implementation in these four commits.

The commits are checkpatch-clean. The combined tree passed targeted binding/DTB checks without diagnostics, apple-dcp 63/63 and Asahi KUnit 86/86. The first defconfig plus asahi.config WERROR build passed; the shipping and final fixup-tree builds are still running. I have no J713 jack runtime result of my own.

This is not merge-ready because it includes the unresolved loader and mapping-ownership work from #434. The common config dependency in #438 also needs review.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Final software gates now pass on the combined tree containing these heads and the proposed common config correction in #438. Both defconfig plus asahi.config and the Fedora-base recipe build Image, modules and DTBs with WERROR enabled. The Fedora recipe also covers KUNIT=m. Every requested asahi.config setting survives resolution. Asahi KUnit passes 86/86 and apple-dcp host tests pass 63/63. The targeted J713/J616s binding and DTB checks have no diagnostics.

The code and binding gates pass. This still inherits the unresolved loader/mapping-ownership dependency in #434 and is not merge-ready.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Final qualification for 9c4f0fa9a7f07ba82410d445bca92a28d2881215. The combined test source is 031f7dec92a1bef6b72509b08c5c597f50474adb, tree 36854d3a72e4efdf2c352166498ab436adaf3c48.

Both defconfig plus asahi.config and the Fedora-base shipping recipe pass the full Image/modules/DTB build with WERROR enabled. Every requested fragment value survives olddefconfig. Asahi KUnit passes 86/86, apple-dcp host tests pass 63/63, and targeted J713/J616s binding/DTB checks have no diagnostics. Strict source-style checks pass; commit sign-offs are checked separately. The attribution audit found no new material Gravity implementation blocks. Existing GPL-2.0-only Cody Ho and Niklas Sheth credit is preserved.

The jack-specific review passes, but this PR still inherits the unresolved loader/mapping-ownership hold in #434. Not merge-ready for that dependency and #438. No J713 runtime result is claimed.

The T8132 (M4) AOP runs the same firmware transport as the T6041 one, and
its bootloader hands it over the same way. It also programs the AOP DART's
address filter (DAPF) and reserves the filter's windows, which the firmware
reaches through its DART at their physical addresses. The windows come in
memory-region with the firmware segments, up to 16 of them.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8132 AOP audio service is the T6041 one: the same LPAI microphone
flow, and the same ADMAC channel map for the speakers and the jack. Allow
"apple,t8132-aop-audio" in front of the T6041 compatible.

A machine brought up in steps lists only the streams it has so far, so
allow the microphones alone, and the microphones with the jack, besides
the speaker layouts.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8132 (M4) AOP takes the T6040 boot arguments (EC0p 0x100_0000_0000,
nCal 0, alig 64, AOPt 0): iBoot leaves the boot-argument table at its
defaults in the AOP SRAM and the AOP halted, and the ADT gives __ETEXT the
DART address 0x100_0000_0000. The bootloader programs the AOP DART's DAPF
and reserves the firmware segments and the DAPF windows, so the T6040
configuration applies unchanged.

Tested on J713 (MacBook Air 13" M4) with m1n1 handing the AOP over (its
memory-region holds __ETEXT, __OS_LOG and the 15 DAPF windows): the AOP
starts, and the microphones capture (3 channels, 48 kHz) through
aop_audio.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Describe the T8132 AOP with its mailbox and DART, and the audio fabric's
two ADMACs (admac-leap-ns on DART stream 10, admac-base-ns on stream 8),
all disabled. Addresses and interrupts are the ADT's; the ADMAC channel
map is the T6041 one: the microphones on LEAP channel 1.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Enable the AOP, its DART and mailbox, and the ADMACs on the MacBook Air
13" M4, with the AOP audio service for the three microphones.

/chosen already asks for the AOP's handoff: m1n1 programs the AOP DART's
DAPF and adds the firmware segments and the DAPF windows to the AOP's
memory-region, or disables the AOP.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The jack component was only registered along with the speaker one, so a
machine whose audio node lists the jack's DMA channels but not yet the
speakers' got no jack. Register the speaker component only where the node
lists "spkr", and the jack's where it lists "cout" and "cin", each on its
own. Creating the services does not reach the firmware; nothing changes
for the J616s, which lists all of them.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The MacBook Air 13" M4 (J713) headphone jack is a card of its own on the
AOP, like the J616s one.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The J713 jack runs on the AOP firmware's MCA cluster 2 with the same
CS42L84 setup as the J616s jack. Use the J616s jack configuration,
including its -6 dB cap on the headphone DAC: this board's analog full
scale is unmeasured too.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Add the CS42L84 on i2c1 (reset on nub GPIO 17, interrupt on AP GPIO 98,
from the ADT), the jack's ADMAC channels on the AOP audio node (base-ns
TX2 and RX2, as on the J616s) and the jack's own card.

The codec is the first consumer of the i2c1 power domain, so the J713
power-domain policy now enables it; it has no parent domains.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@RyanTheTide

RyanTheTide commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The four commits above #434 register speaker and jack components only when their own DMA channels exist, so jack-only bring-up no longer needs a speaker stream. The J713 configuration reuses the minus 6 dB CS42L84 DAC cap. The reported stereo playback, plug interrupts and headset capture are the J713 proof.

The stacked kernel at 5b6f5515e2f8 passed both full universal and Fedora-base WERROR builds (Image, modules and DTBs); both preserve all 131 common-config settings. ARM64 16 KiB KUnit passed 275/275. DCP host tests passed 63/63, and the PMGR and radio SID checks passed. The M4 host suite has the same five failing groups as the pinned base (18/23 on each); the AFKv2 HPD harness also fails on both. These are recorded failures, not a full host-suite pass. All six T8132 DTBs were checked: 13 schema diagnostics against 11 on the base, with exactly two new DCP dma-noncoherent binding errors from #429. The seven targeted binding checks passed. These software gates do not replace the required shared-code boots.

No new jack-specific code issue found. Merge after the corrected m1n1 #47 and Linux #434 handoff chain, with U-Boot #13 for the per-kernel DTB route. The shared component-registration change needs the Neo and M1 Pro or M2 audio regression boot. #439 follows this.

@erikwb

erikwb commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #820, which carries these four jack commits unchanged (6–9) on top of #819. The jack evidence from here is in its description.

@erikwb erikwb closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants