From e89ad368f4cf534e24477a25433169c2543d5606 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 01:07:13 -0500 Subject: [PATCH 1/6] arm64: dts: apple: t8132-j773g: the headphone jack The Mac mini has no microphones, so the AOP audio node was deleted; but like the M4 Pro Mac mini (J773s) its headphone jack is a CS42L84 on the AOP's jack back-end. Describe the jack's streams, "cout" and "cin" on base-ns ADMAC channels 4 and 5 (ADT audio-codec-output and audio-codec-input), with no "dma" channel so the AOP audio component attaches no microphone, and a jack card of its own. The speaker stays without a card. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j773g.dts | 40 ++++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j773g.dts b/arch/arm64/boot/dts/apple/t8132-j773g.dts index baf3e3ffcfecb..9fe251a2cca63 100644 --- a/arch/arm64/boot/dts/apple/t8132-j773g.dts +++ b/arch/arm64/boot/dts/apple/t8132-j773g.dts @@ -32,6 +32,31 @@ gpios = <&pinctrl_ap 15 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + /* + * The headphone jack: the AOP audio component's jack back-end (DAI 4) + * to the CS42L84 (ADT /arm-io/i2c1/audio-codec-output), a card of its + * own as on the M4 Pro Mac mini. The speaker has no card yet. + */ + sound_jack: sound-jack { + compatible = "apple,j773-macaudio-jack", "apple,macaudio"; + model = "Mac mini J773g Jack"; + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + reg = <0>; + link-name = "Headphone Jack"; + + cpu { + sound-dai = <&aop_audio 4>; + }; + + codec { + sound-dai = <&jack_codec>; + }; + }; + }; }; /* @@ -53,12 +78,17 @@ }; /* - * The AOP audio component always runs a microphone stream, and this Mac - * has no microphones (ADT iop-audio-controller has no audio-hp) and no - * speaker sense, so it has no sound card yet. The AOP registers its audio - * service by itself: without the node, no driver binds it. + * No microphones (ADT iop-audio-controller has no audio-hp): only the jack's + * streams, "cout" and "cin" on base-ns ADMAC channels 4 and 5 (ADT + * audio-codec-output and audio-codec-input), as on the M4 Pro Mac mini. + * Without a "dma" channel the AOP audio component attaches no PDM device. */ -/delete-node/ &aop_audio; +&aop_audio { + dmas = <&admac1 4>, <&admac1 5>; + dma-names = "cout", "cin"; + apple,chassis-name = "J773g"; + apple,machine-kind = "Mac mini"; +}; /* * The SN012776 speaker amp (ADT /arm-io/i2c3/audio-speaker at 0x38, mono, From a2f1d82d198f177c48be5cec71819b428507716f Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:17 -0500 Subject: [PATCH 2/6] ASoC: apple: aop_spkr: a speaker stream without a sense channel The speaker service always took a V/I sense ring, armed on the sense DMA channel before every power-up. The Mac mini M4 (J773g) has none: its ADT audio-speaker stream lists a TX channel only (its RX entry is unused), and its amp's speaker-protection is 0. Its speaker would fail to start. Give the speaker service its sense ring only when the audio node names a "sense" DMA channel. Every user of the ring already handles a service without one (the jack's); the sense front-end then fails to open with -ENODEV, as it would without the channel. Tested on a J773g: the speaker card binds with the "spkr" channel alone, its playback front-end opens, and opening Speaker Sense fails with -ENODEV. Nothing was played (playback waits for a protection lease). Signed-off-by: Diljit Singh --- sound/soc/apple/aop_spkr.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/apple/aop_spkr.rs b/sound/soc/apple/aop_spkr.rs index b01158a65ccd1..73167327fb580 100644 --- a/sound/soc/apple/aop_spkr.rs +++ b/sound/soc/apple/aop_spkr.rs @@ -1679,7 +1679,13 @@ pub(crate) struct SpeakerComponent { impl SpeakerComponent { pub(crate) fn register(aop: Arc) -> Result { - let spkr = Service::new(aop.clone(), AUDIO_DEV_SPKR, "spkr", PWRD_OUTPUT, true)?; + // A Mac whose speaker stream has no sense channel (the Mac mini: its ADT + // audio-speaker stream lists no RX channel) runs the speakers without the ring. + let has_sense = aop + .fwnode + .property_match_string(c_str!("dma-names"), c_str!("sense")) + .is_ok(); + let spkr = Service::new(aop.clone(), AUDIO_DEV_SPKR, "spkr", PWRD_OUTPUT, has_sense)?; let cout = Service::new(aop.clone(), AUDIO_DEV_COUT, "cout", PWRD_OUTPUT, false)?; let cin = Service::new(aop.clone(), AUDIO_DEV_CIN, "cin", PWRD_INPUT, false)?; let services = [&spkr, &cout, &cin]; From 4e1833b8d599ca4437c08174edf678a09505f698 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:18 -0500 Subject: [PATCH 3/6] dt-bindings: sound: apple,macaudio: Add J773g The Mac mini M4 (J773g) has its own speaker configuration (one SN012776 without V/I sense on the AOP), unlike the M4 Pro Mac mini's J773. Signed-off-by: Diljit Singh --- Documentation/devicetree/bindings/sound/apple,macaudio.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml index 37956f0a3a343..20cf622f3ed1f 100644 --- a/Documentation/devicetree/bindings/sound/apple,macaudio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,macaudio.yaml @@ -52,6 +52,7 @@ properties: - apple,j715-macaudio-jack - apple,j773-macaudio - apple,j773-macaudio-jack + - apple,j773g-macaudio - apple,j813-macaudio - apple,j815-macaudio - apple,j873-macaudio From b20419b18d64027c4e9dfee1297d96961103095f Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:18 -0500 Subject: [PATCH 4/6] ASoC: apple: macaudio: add the Mac mini M4 (J773g) speaker One SN012776 on the AOP's speaker stream: the J616s/J713 frame (250 BCLKs of 12 MHz, six 32-bit playback slots, which the firmware runs whole), the amp on the first slot, and no sense channel. Derive has_sense on AOP-fed cards from whether the speaker CPU DAI node names a "sense" DMA channel (matching aop_spkr), so J773g does not expose a broken Speaker Sense PCM and shares macaudio_j575c_cfg with J575c rather than duplicating the config struct. Update the spk_fixed_ceiling comment to document how no-sense models governed by a feed-forward protection daemon run at 0 dB under a lease and return to the muted floor via spk_lease_timer / spk_stop_worker / spk_expire_work if the daemon stops renewing. Tested on a J773g: the card "Mac mini J773g" registers with its Secondary (speaker) playback device next to the jack's card; with no protection owner, playback is not admitted. Signed-off-by: Diljit Singh --- sound/soc/apple/macaudio.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c index 16488315b3995..14a1f882c783b 100644 --- a/sound/soc/apple/macaudio.c +++ b/sound/soc/apple/macaudio.c @@ -184,10 +184,15 @@ struct macaudio_platform_cfg { */ bool spk_secondary_only; /* - * No voltage or current sense reaches the AP, so no protection daemon - * can govern the speakers: their SN012776 volumes stay under safe_vol, - * locked, unlocked or granted alike, and there is no sense PCM. A - * granted lease runs them at safe_vol, its operating gain. + * Keep SN012776 speaker volumes capped at safe_vol even under a + * granted lease, and omit the sense PCM, for models without a + * full-scale protection model. Models without V/I sense that leave + * this false (e.g. J773g) run at 0 dB under a granted lease while a + * feed-forward protection daemon governs the signal path in software + * and renews the lease; if the daemon dies or stops renewing, + * spk_lease_timer closes the start gate, spk_stop_worker stops active + * streams, and spk_expire_work returns the amp to the muted floor (0) + * within the lease window. */ bool spk_fixed_ceiling; }; @@ -2674,9 +2679,6 @@ static int macaudio_parse_of(struct macaudio_snd_data *ma) } } ma->has_speakers = 1; - if (ma->cfg->amp != AMP_SSM3515 && ma->cfg->safe_vol != 0 && - !ma->cfg->spk_fixed_ceiling) - ma->has_sense = 1; } cpu = of_get_child_by_name(np, "cpu"); @@ -2756,6 +2758,13 @@ static int macaudio_parse_of(struct macaudio_snd_data *ma) link_props->is_speakers = speakers; link_props->is_headphones = !speakers; + if (speakers && ma->cfg->amp != AMP_SSM3515 && + ma->cfg->safe_vol != 0 && !ma->cfg->spk_fixed_ceiling) { + if (!ma->cfg->fe_cpu_is_platform || + of_property_match_string(link->cpus->of_node, + "dma-names", "sense") >= 0) + ma->has_sense = 1; + } if (speakers && ma->cfg->spk_dai_fmt) link->dai_fmt = ma->cfg->spk_dai_fmt; @@ -4246,13 +4255,12 @@ struct macaudio_platform_cfg macaudio_j604_cfg = { }; /* - * J575c (Mac Studio, M4 Max): the J616s stream, six 32-bit playback and - * twelve 16-bit sense slots in the same 250-bit frame (the firmware runs it - * so, although the ADT's audio-speaker lists one playback slot), with one - * SN012776 on the first two playback slots (it downmixes them) and the - * first two sense slots (current, then voltage), which speakersafetyd's - * J575 model reads. The front-end carries all six channels; the last four - * are silent. + * J575c (Mac Studio, M4 Max) and J773g (Mac mini, M4): the J616s AOP speaker + * stream (six 32-bit playback slots in a 250-BCLK frame, with one SN012776 on + * the front slots). Whether V/I sense is exposed is derived from the speaker + * CPU DAI node's "sense" DMA channel: J575c provides it, while J773g has no + * sense channel and is governed under a lease by a feed-forward protection + * daemon. The headphone jack is a separate card. */ struct macaudio_platform_cfg macaudio_j575c_cfg = { .enable_speakers = true, @@ -4443,6 +4451,8 @@ static const struct of_device_id macaudio_snd_device_id[] = { { .compatible = "apple,j773-macaudio", .data = &macaudio_j575c_j773_cfg }, /* j773 - cs42l84 - the jack, a card of its own (AOP-fed) */ { .compatible = "apple,j773-macaudio-jack", .data = &macaudio_j616_jack_cfg }, + /* j773g - sn012776 15 1x 1W (AOP-fed, no V/I sense) */ + { .compatible = "apple,j773g-macaudio", .data = &macaudio_j575c_cfg }, /* j873 AID48 sn012776 15 1x 1W (AOP-fed, no protection) */ { .compatible = "apple,j873-macaudio", .data = &macaudio_j873_cfg }, /* j813 AID? sn012776 15 2x 1W+1T (AOP-fed, V/I sense) */ From 898c0927cde1da573892e51822496aee35f37bbb Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Sat, 21 Nov 2026 15:41:25 -0500 Subject: [PATCH 5/6] dt-bindings: sound: apple,t6041-aop-audio: allow speaker without sense On Macs whose AOP speaker stream has no V/I sense channel (such as the Mac mini M4, J773g), the audio node lists only "spkr", "cout", and "cin" in dma-names. Allow that combination in the binding. Signed-off-by: Diljit Singh --- .../devicetree/bindings/sound/apple,t6041-aop-audio.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/apple,t6041-aop-audio.yaml b/Documentation/devicetree/bindings/sound/apple,t6041-aop-audio.yaml index 8c0b1928ef207..292a66f15c297 100644 --- a/Documentation/devicetree/bindings/sound/apple,t6041-aop-audio.yaml +++ b/Documentation/devicetree/bindings/sound/apple,t6041-aop-audio.yaml @@ -70,6 +70,13 @@ properties: - const: sense - const: cout - const: cin + - description: + The speakers without V/I sense and the headset jack, on a Mac without + microphones + items: + - const: spkr + - const: cout + - const: cin - description: The microphones and the headset jack items: - const: dma From 5047b15c3aef234e0ec4f489677ba25301a8e243 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:19 -0500 Subject: [PATCH 6/6] arm64: dts: apple: t8132-j773g: the speaker The speaker card: the AOP audio component's speaker back-end (DAI 3) to the SN012776 (ADT /arm-io/i2c3/audio-speaker at 0x38), on base-ns ADMAC channel 0 ("spkr", ADT audio-speaker; no "sense", its RX entry is unused). The amp is enabled and takes no sound-name-prefix: a mono speaker's controls go unprefixed, as macaudio expects (it refused the card with "Speaker HPF Corner Frequency"). Playback waits for a protection lease. Tested on a J773g together with the previous commits: card 0 "Mac mini J773g" (speaker) and card 1 the jack. Nothing was played. Signed-off-by: Diljit Singh --- arch/arm64/boot/dts/apple/t8132-j773g.dts | 47 +++++++++++++++++------ 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8132-j773g.dts b/arch/arm64/boot/dts/apple/t8132-j773g.dts index 9fe251a2cca63..8d8278c299f87 100644 --- a/arch/arm64/boot/dts/apple/t8132-j773g.dts +++ b/arch/arm64/boot/dts/apple/t8132-j773g.dts @@ -33,10 +33,34 @@ enable-active-high; }; + /* + * The speaker: the AOP audio component's speaker back-end (DAI 3) to + * the SN012776. Its playback waits for a protection lease (macaudio). + */ + sound: sound { + compatible = "apple,j773g-macaudio", "apple,macaudio"; + model = "Mac mini J773g"; + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + reg = <0>; + link-name = "Speaker"; + + cpu { + sound-dai = <&aop_audio 3>; + }; + + codec { + sound-dai = <&speaker>; + }; + }; + }; + /* * The headphone jack: the AOP audio component's jack back-end (DAI 4) * to the CS42L84 (ADT /arm-io/i2c1/audio-codec-output), a card of its - * own as on the M4 Pro Mac mini. The speaker has no card yet. + * own as on the M4 Pro Mac mini. */ sound_jack: sound-jack { compatible = "apple,j773-macaudio-jack", "apple,macaudio"; @@ -78,22 +102,24 @@ }; /* - * No microphones (ADT iop-audio-controller has no audio-hp): only the jack's - * streams, "cout" and "cin" on base-ns ADMAC channels 4 and 5 (ADT - * audio-codec-output and audio-codec-input), as on the M4 Pro Mac mini. - * Without a "dma" channel the AOP audio component attaches no PDM device. + * No microphones (ADT iop-audio-controller has no audio-hp): the speaker's + * stream, "spkr" on base-ns ADMAC channel 0 (ADT audio-speaker, which lists + * no RX channel, so no "sense"), and the jack's, "cout" and "cin" on + * channels 4 and 5 (ADT audio-codec-output and audio-codec-input), as on the + * M4 Pro Mac mini. Without a "dma" channel the AOP audio component attaches + * no PDM device. */ &aop_audio { - dmas = <&admac1 4>, <&admac1 5>; - dma-names = "cout", "cin"; + dmas = <&admac1 0>, <&admac1 4>, <&admac1 5>; + dma-names = "spkr", "cout", "cin"; apple,chassis-name = "J773g"; apple,machine-kind = "Mac mini"; }; /* * The SN012776 speaker amp (ADT /arm-io/i2c3/audio-speaker at 0x38, mono, - * speaker-protection 0): interrupt on AP GPIO 14, level low. Disabled - * until the speaker has a sound card and a protection profile. + * speaker-protection 0): interrupt on AP GPIO 14, level low, held in + * hardware shutdown until the sound card enables it. */ &i2c3 { status = "okay"; @@ -105,11 +131,10 @@ apple,sdz-group-fail-closed; apple,deferred-shutdown; #sound-dai-cells = <0>; - sound-name-prefix = "Speaker"; + /* No sound-name-prefix: a mono speaker's controls go unprefixed (macaudio). */ interrupts-extended = <&pinctrl_ap 14 IRQ_TYPE_LEVEL_LOW>; ti,imon-slot-no = <0>; ti,vmon-slot-no = <2>; - status = "disabled"; }; };