Skip to content

J616s audio: #406 review follow-ups (tas2764 sleep scope, speaker lock trigger, AOP regions from memory-region) - #419

Merged
RyanTheTide merged 6 commits into
integration/aurorafrom
ryan/j616s-audio-406
Oct 24, 2026
Merged

RyanTheTide merged 6 commits into
integration/aurorafrom
ryan/j616s-audio-406

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-ups to #406 (jgoyvaerts, J616s audio, merged as 1a49c3e), from our review and our J616s testing.

  • tas2764: keep SDZ high across sleep only within an SDZ group. soc: apple: aop, ASoC: J616s (MacBook Pro M4 Pro) audio: microphones, speakers and headphone jack #406 changed suspend and resume for every TAS2764/SN012776 amp, but that had only run on the J616s. M1/M2 amps keep the old behaviour. After a group failure, codec_remove skips the regulator disable, since that supply was already forced off.
  • macaudio: refuse playback starts after a failed speaker lock. The front-end trigger now refuses START/RESUME/PAUSE_RELEASE once the lock has failed, so a stream prepared just before the failure can't start. The stop walk skips back-end links.
  • aop_audio: the comments describe the T6040 microphone setup without naming macOS symbols.
  • apple,t6041-aop-audio binding: select only T6041 nodes. With the apple,t6030-aop-audio fallback in its compatible list, dtbs_check also applied it to the T6030/T6031/T8122 AOP audio nodes.
  • apple,t6041-aop binding: memory-region (filled in by the bootloader).
  • aop: take the T6040 firmware segments from memory-region. This goes with kboot: Reserve the T6040 AOP's DRAM firmware segments m1n1#41: m1n1 reserves __ETEXT and __OS_LOG with iommu-addresses, and the IOMMU core maps them. The node-name lookup and the raw iommu_map()/unmap are gone. Other AOP generations are unchanged.

Tested:

  • Universal-config builds 73s/73s3, 0 warnings.
  • KUnit 59/59 (dockchannel, AOP ring, T8140 AOP audio).
  • Neo 73s smoke and s2idle: speakerguardd fine; across suspend it logs "Speaker volumes locked: System suspend" and then "unlocked".
  • M1 Pro 73s against 73t: speakersafetyd and mic fine, and a pm_test freeze cycle works.
  • J616s 73s3 with m1n1#41: the AOP boots clean and the three cards appear. The microphones record. The UCM from alsa-ucm-conf-asahi#5 parses. The speakers stay locked because there's no J616 speakersafetyd config yet.

🤖 Generated with Claude Code

"ASoC: tas2764: keep SDZ high across system sleep" changed suspend and
resume for every TAS2764 and SN012776 amp, but it has only run on the
J616s, whose six amps share one SDZ supply as an SDZ group. The M1 and
M2 machines also use this driver and have not been tested with the
amps left in software shutdown across sleep.

Leave SDZ high only for amps in an SDZ group. Amps outside a group
drop SDZ on suspend and raise it on resume, as before. Losing the
page-0xfd quirk writes over sleep on those machines stays a separate
fix.

When a group has failed, its supply was forced off and no enable is
left for codec_remove() to balance, so skip the disable there.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…lock

When a speaker volume lock fails, prepares are refused and the stop
work moves every running playback stream to XRUN. A stream whose
prepare passed just before the failure was recorded, and which was not
yet PREPARED when the stop work walked the card, could still be
started. Refuse START, RESUME and PAUSE_RELEASE of any playback stream
in the front-end trigger once the lock has failed.

The stop walk also visited back-end runtimes, whose substream shares
the front-end's runtime. That was only harmless because the front-end
links come first in the card's list. Skip no_pcm links there.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…acOS symbols

The comments on the T6040 microphone flow named a macOS class and
method. Say what is sent instead: the property and the ADT masks it
carries are the facts the code relies on.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The schema lists the apple,t6030-aop-audio fallback, so dtbs_check
also applied it to the T6030, T6031 and T8122 AOP audio nodes, which
carry that fallback but only a microphone stream. They then failed on
the T6041 compatible, the DMA list and #sound-dai-cells. Select the
schema by the T6041 compatible only.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The AOP firmware runs its external code and its log from DRAM. Describe
those segments as memory-region entries, which the bootloader fills in
from the ADT, with the address the firmware uses for each one in the
region's iommu-addresses, as for the other Apple coprocessors whose
firmware the bootloader loads.

This replaces the aop-etext and aop-oslog reserved-memory nodes that the
description named, which no binding defined and nothing referred to.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the T6040 the driver found the firmware's external code and log
segments by looking for /reserved-memory nodes named aop-etext and
aop-oslog, and mapped them with iommu_map() into the device's DMA API
domain, without its IOVA allocator knowing about them.

Take them from the AOP's memory-region instead, which is how the
bootloader describes the firmware of the other Apple coprocessors. Each
region's iommu-addresses gives the IOVA the firmware uses. The IOMMU core
already maps such regions in the default domain when the device is
added, one to one for the log and translated for the external code, and
keeps their IOVAs out of the allocator, so the driver no longer maps or
unmaps anything itself.

Before the firmware is started, check that every page of every region is
mapped where the DT says, that one region sits at EC0p and that any
other one is mapped at its physical address, and refuse to start it
otherwise. The check now runs before anything is set up, so a missing
region no longer ends in a failed shutdown of an AOP that never ran.

The other AOP generations are unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 4b9fd27 into integration/aurora Oct 24, 2026
@RyanTheTide
RyanTheTide deleted the ryan/j616s-audio-406 branch October 24, 2026 06:03
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.

1 participant