Repository navigation
ASoC/arm64: M5 Mac Studio audio: headphone jack, speaker off - #2535
Conversation
The M5 Max Mac Studio (J775c) shares the J775d's audio: a CS42L84 for the headphone jack and one SN012776 for the speaker, behind the AOP. Add its compatible next to the J775d's. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The M5 Mac Studio (J775c, J775d) has one SN012776 driving its built-in speaker and a CS42L84 for the headphone jack, both behind the AOP's audio services, as on the J714s. Neither machine has a macaudio entry, so the card falls back to the generic "apple,macaudio" configuration: no AOP front-ends, so neither the jack nor the speaker. Add one entry for both, with the J714s front-ends and formats, and keep the speaker off. The ADT's audio-speaker stream on these machines carries one TX slot and no RX slot, so there is no voltage or current sense for a protection model to read. Such a speaker can only run under a protection lease taken by speakerguardd with a no-sense model, as on the J773g, and that model does not exist for these machines yet. Until then the entry has no safe level, so macaudio_speakers_allowed() refuses the speaker, as on the J873. The jack is unaffected. KUnit: the J775 configuration is refused speakers and carries no gain table. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Move the J775d's speaker amp, jack codec and card links into a new t6050-studio-audio.dtsi, which both M5 Mac Studios (J775c, J775d) can include: one SN012776 at 0x38 on i2c1 (IRQ pin 106, shutdown pin 107), one CS42L84 at 0x4b on i2c2 (IRQ pin 134, reset pin 139), and the jack and speaker links on the AOP's audio services. The board sets the card's compatible and model. The file says why the speaker is described but stays off: the AOP's speaker stream carries no sense back. The amp is also told its frame: 250 BCLKs of 12 MHz, which its ratio detection rejects, as on the other AOP-fed SN012776 machines (ti,bclk-ratio). The J775d DTB only gains ti,bclk-ratio on the amp. J775c, whose integration file does not describe audio yet, is unchanged. Link: #2449 Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at ebaf49c.
The speaker stays off. macaudio_j775_cfg has enable_speakers = false and safe_vol = 0, so macaudio_speakers_allowed() is false. The "Speaker" link is then skipped with "driver can't assure safety on this model, disabling speakers" before has_speakers is set or any BE link is created (sound/soc/apple/macaudio.c:2661). No speaker DAI link means no stream can reach the amp, and please_blow_up_my_speakers can no longer bypass admission. The KUnit admission test now asserts the J775 refusal. The DT only moves the existing nodes into t6050-studio-audio.dtsi and adds ti,bclk-ratio = <250> to the amp. dt-checks reported 0 new warnings on this head.
Rows owed post-merge, with no playback: J775c/J775d card probe, the disabling-speakers line, aplay -l jack, and evtest insert/remove.
|
Claude Opus 5.5 on @satchlj's behalf: J775c row for this PR, no playback. Blocked before the card, by the AOP, not by this PR. Kernel: lobata's cand-5,
Cause: the AOP doesn't probe ( 🤖 Generated with Claude Code |
|
Claude Opus 5.5 on @satchlj's behalf: J775c (Mac Studio, M5 Max) no-playback row. Nothing opened a playback stream or wrote a control. Kernel: lobata's cand-9,
The same row on cand-8 showed Not done:
🤖 Generated with Claude Code |
Problem
The M5 Mac Studio (J775c, J775d) has no macaudio entry, so its card falls back to the generic configuration and neither the headphone jack nor the speaker works. The J775d's audio is described in its board file only, so the J775c can't share it.
Change
apple,j775c-macaudio(the J775d one is already there).macaudio_speakers_allowed()refuses the speaker, as on the J873. The jack works. The AOP's speaker stream on these machines has one TX slot and no RX (sense) slot, so the speaker can only run behind the protection lease with a no-sense model in speakerguardd (the J773g path). That is the follow-up stacked on this PR.t6050-studio-audio.dtsiwith the amp (i2c1 0x38), the jack codec (i2c2 0x4b) and both card links. The J775d includes it, and the J775c can too (arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102). The amp is also giventi,bclk-ratio = <250>.This replaces #2514, which ran the speaker under a fixed -20 dB ceiling with nothing protecting it.
Testing (buildbox, no hardware)
ti,bclk-ratio = <250>on the amp. dtc 0 warnings, dt-validate 0 messages on both,dt-doc-validateclean on the binding.apple-speaker-*): 60/60 pass. The J775 entry is refused speakers and carries no gain table.Still to run
On a J775c or J775d (no playback): the card probes,
dmesgshows "driver can't assure safety on this model, disabling speakers",aplay -llists the jack,evtestsees jack insert and remove.ADT reading: why the speaker can't use the sense path
The
iop-audio-controller/audio-speaker/audio-speakerreg in satchlj's J775c capture (#2449) is byte-identical to the J873s, J873 and J773g ones:...01000000 00000000 01 00 18 00...= TX slot mask 0x1, RX slot mask 0x0, 1 TX and 0 RX slots. The same field on the J813, which has sense, reads0f000000 ff000000 04 08: 4 TX slots and 8 RX words (V+I for each of the 4 amps). The J775 amp node hasspeaker-protection = 0and no sense property (funkzy's J775d dump agrees). So the AP never sees V/I on these machines.Assisted-by: LLM (Claude:Opus 5.5)