From a2f1d82d198f177c48be5cec71819b428507716f Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:17 -0500 Subject: [PATCH 1/4] 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 2/4] 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 cf918cbdb25c92e4368415170d3112d1430940ee Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:18 -0500 Subject: [PATCH 3/4] ASoC: apple: macaudio: add the Mac mini M4 (J773g) speaker One SN012776 on the AOP's speaker stream: the J713's 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. Its playback waits for a protection lease (macaudio_spk_admitted()), which only speakerguardd v2 takes, with a feed-forward unit compiled from the Mac's own tuning: the J773g's AID36 graph protects the speaker with atsp, one channel, no sense. Without the lease the speaker stays silent. 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. Nothing was played. Signed-off-by: Diljit Singh --- sound/soc/apple/macaudio.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c index 16488315b3995..a82527dbf2ff0 100644 --- a/sound/soc/apple/macaudio.c +++ b/sound/soc/apple/macaudio.c @@ -4286,6 +4286,32 @@ struct macaudio_platform_cfg macaudio_j575c_j773_cfg = { .route_only_fes = BIT(0), }; +/* + * J773g (T8132, Mac mini M4): one SN012776 on the AOP's speaker stream, the + * J713's frame (250 BCLKs of 12 MHz, six 32-bit playback slots, which the + * firmware runs whole although the ADT's audio-speaker lists one), the amp on + * the first slot. The stream has no sense channel (the ADT's audio-speaker + * lists no RX channel and the amp's speaker-protection is 0), so there is no + * V/I to read: playback waits for a protection lease (macaudio_spk_admitted()), + * which only speakerguardd v2 takes, with a feed-forward unit compiled from + * this Mac's own tuning. Without it the speaker stays silent. + */ +struct macaudio_platform_cfg macaudio_j773g_cfg = { + .enable_speakers = true, + .amp = AMP_SN012776, + .speakers = SPKR_1W, + .stereo = false, + .safe_vol = -20, + .fe_dai_names = { "j616-pcm-0", "j616-pcm-1", "j616-pcm-2" }, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBC_CFC | + SND_SOC_DAIFMT_GATED | SND_SOC_DAIFMT_NB_IF, + .secondary_bclk_ratio = 250, + .fe_cpu_is_platform = true, + /* No headphone codec on this card: the jack is a card of its own. */ + .route_only_fes = BIT(0), + .speaker_fe_channels = 6, +}; + /* * J713 (T8132, MacBook Air 13" M4): the J616s stream, six 32-bit playback * and twelve 16-bit sense slots in the same 250-bit frame, with four @@ -4443,6 +4469,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_j773g_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 eb26359fe1b13067927ad2d2ec2973ee76b1d9af Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 19 Nov 2026 07:48:19 -0500 Subject: [PATCH 4/4] 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"; }; };