From d9fde25f99f6f96edd8853f86c27c49954161cfa Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 11 Nov 2026 09:30:07 +0700 Subject: [PATCH] arm64: dts: apple: t8142-j815: Add the speakers and the sound card J815 has six SN012776 speaker amplifiers where J813 has four. Add the two woofers at 0x3a and 0x3d and name all six as in speakersafetyd's j815.conf. Feed them in ADT speaker-config order, and tell the AOP audio service it has six amplifiers (apple,speaker-amps). The card is apple,j815-macaudio. Enable the AOP audio service and the card. The speakers stay at macaudio's safe level until speakersafetyd holds them. That needs the J815 profile. Depends on the J815 audio series on top of Linux #1423 (the apple,j815-macaudio and apple,speaker-amps bindings). Tested on J815 (MacBook Air 15-inch, M5) with the equivalent node set in a J815 tree that included the whole J813 board. All six amplifiers probe and each speaker answers on its own sense pair. Capped speaker playback and the microphones work. The headphone jack codec probes; wired headphones have not been tried. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- arch/arm64/boot/dts/apple/t8142-j815.dts | 76 +++++++++++++++++++----- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index 741bfa2c0e5d2..4b9ae5e207580 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -152,6 +152,13 @@ apple,platform-id = <0x72>; }; +&aop_audio { + /* The microphone card's name: AppleJ815HPAI. */ + apple,chassis-name = "J815"; + /* ADT iop-audio-controller/audio-speaker: 6 slots, 12 sense words. */ + apple,speaker-amps = <6>; +}; + /* * Ambient light sensor, the AOP's "als" service: an ST VD6286, as on the * M4 Pro, not T8140's CT817. aop_als sends it the per-device calibration @@ -165,6 +172,61 @@ }; }; +/* Names as in speakersafetyd's j815.conf; slots from ADT speaker-config. */ +&speaker_left_woofer { + sound-name-prefix = "Left Woofer 1"; +}; + +&speaker_right_woofer { + sound-name-prefix = "Right Woofer 1"; +}; + +&i2c3 { + speaker_left_woofer_2: codec@3a { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3a>; + shutdown-gpios = <&pinctrl_ap 151 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <0>; + sound-name-prefix = "Left Woofer 2"; + ti,imon-slot-no = <18>; + ti,vmon-slot-no = <16>; + ti,bclk-ratio = <250>; + }; + + speaker_right_woofer_2: codec@3d { + compatible = "ti,sn012776", "ti,tas2764"; + reg = <0x3d>; + shutdown-gpios = <&pinctrl_ap 151 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <0>; + sound-name-prefix = "Right Woofer 2"; + ti,imon-slot-no = <22>; + ti,vmon-slot-no = <20>; + ti,bclk-ratio = <250>; + }; +}; + +/ { + sound { + compatible = "apple,j815-macaudio", "apple,macaudio"; + model = "MacBook Air J815"; + + dai-link@1 { + /* + * ADT speaker-config order: macaudio gives codec k playback + * slot k (left in 0, 2, 4; right in 1, 3, 5) as macOS does. + * The TX idle masks are J813's: J815's amp-tx-zd-config has + * the same words (left amps drive slots 0-3, 8-11, 16-19 on + * line 0, right amps 4-7, 12-15, 20-23 on line 1). + */ + codec { + sound-dai = <&speaker_left_woofer>, <&speaker_right_woofer>, + <&speaker_left_tweeter>, <&speaker_right_tweeter>, + <&speaker_left_woofer_2>, <&speaker_right_woofer_2>; + }; + }; + }; +}; + /* * N1 functions behind apcie port 0 (0000:00:00.0 -> 01:00.{0,1,2}), so the * loader has somewhere to put the factory addresses: it copies ADT /chosen @@ -356,17 +418,3 @@ &pinctrl_nub { gpio-reserved-ranges = <0 18>, <19 17>, <37 3>; }; - -/* - * J815 has six speaker amplifiers, not J813's four. Keep J813's sound card - * and the AOP audio service off until the J815 speaker layout is described. - */ -&aop_audio { - status = "disabled"; -}; - -/ { - sound { - status = "disabled"; - }; -};