[PATCH v2 00/21] Add speaker and headset jack support for Apple Silicon Macs
From: James Calligeros
Date: Sun Oct 04 2026 - 02:04:53 EST
Hi folks,
This series adds the machine driver and related bindings for the
primary audio subsystem on Apple Silicon Macs. The macaudio
machine driver is based on an RFC sent many years ago
by Martin Povišer[1].
The driver uses the DPCM model to dynamically
glue a backend DAI (combination of MCA ports and codecs) to a
frontend PCM. While this theoretically allows us to route any
backend to any frontend, this is not used in practice; the "Primary"
frontend is always used for the headset codec and the "Secondary"
is always used for the speakers.
The audio subsystem on Apple Silicon Macs is rather complicated and
the speaker arrangement is highly variable; some machines have a
single mono woofer while others pull together multiple woofers
and tweeters into a single stereo pair. Every machine also includes
a headset jack, and some also have their own builtin microphones which
are handled by a separate coprocessor with its own driver.
Many functions which are handled by firmware on other platforms
must be handled by the kernel or by userspace. Most notably, speaker
protection is handled by speakersafetyd[2], a userspace daemon.
Speaker protection is handled in userspace due to the expensive
floating point calculations and amount of per-machine configuration
data required.
The machine driver facilitates this by exposing a capture
PCM from which the voltage and current across each speaker's voice
coil can be read. Given that there are absolutely no hardware or
firmware level failsafes preventing permanent damage to the fragile
speakers found on these machines, the driver also implements a
failsafe that will significantly attenuate and lock the gains
of every connected speaker unless speakersafetyd is running.
Version 2 of this series drops numerous fixes and semi-related
patches that are not strictly necessary for the machine driver
to function correctly. These will be resubmitted at a later date.
Adding the required Devicetree updates for M3 series devices would
have bloated this series to an unreasonable size as they are still
missing most prerequisite hardware nodes. They will be added in a
future series.
Regards,
James
[1] https://lore.kernel.org/asahi/20220606191910.16580-1-povik+lin@xxxxxxxxxxx/
[2] https://github.com/AsahiLinux/speakersafetyd
---
Changes in v2:
- Drop patches that are only tangentially related (will be submitted
later)
- Drop wildcard-matching API for kctls
- Relabel J473 sound model to Mac mini
- Align Devicetree changes with upstream bindings
- Relax Cirrus CS42L42 required properties to keep DT style checker happy
- Define missing properties in CS42L{42,84} bindings
- Fix mistyped DT properties
- Improve macaudio DT binding description
- Drop generic fallback compatible for apple,macaudio
- Drop now-redundant descriptions from other compatibles
- Constrain DAI link link-name property with an enum of valid values
- Drop MCA node from macaudio binding example
- Fix heading comment style in macaudio
- Drop obsolete module parameter
- Replace string functions with safer variants
- Replace dropped wildcard API with searching for full kctl name
- Rework idle props parsing to better surface errors/invalid Devicetree entries
- Add additional locking to backend setup
- Take controls_rwsem when safety functions are called from workqueues
- Replace all mutex{,un}lock calls with guard/scoped_guard
- Fix incorrect amp gain value for j37x config struct
- static const-ify all config structs
- Cancel control lock update workqueue on teardown
- Drop unused DAPM widget
- Fix commented-out safe volume calculations
- Drop speaker lock kcontrol ownership checks and related core API extension
- Link to v1: https://patch.msgid.link/20260920-macaudio-v1-0-741cc20a74e5@xxxxxxxxx
To: David Rhodes <david.rhodes@xxxxxxxxxx>
To: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>
To: Martin Povišer <povik+lin@xxxxxxxxxxx>
To: Liam Girdwood <lgirdwood@xxxxxxxxx>
To: Mark Brown <broonie@xxxxxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
To: James Calligeros <jcalligeros99@xxxxxxxxx>
To: Jaroslav Kysela <perex@xxxxxxxx>
To: Takashi Iwai <tiwai@xxxxxxxx>
To: Matthias Brugger <matthias.bgg@xxxxxxxxx>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
To: Shenghao Ding <shenghao-ding@xxxxxx>
To: Kevin Lu <kevin-lu@xxxxxx>
To: Baojun Xu <baojun.xu@xxxxxx>
To: Sen Wang <sen@xxxxxx>
To: Sven Peter <sven@xxxxxxxxxx>
To: Janne Grunau <j@xxxxxxxxxx>
To: Neal Gompa <neal@xxxxxxxxx>
Cc: asahi@xxxxxxxxxxxxxxx
Cc: linux-sound@xxxxxxxxxxxxxxx
Cc: patches@xxxxxxxxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-mediatek@xxxxxxxxxxxxxxxxxxx
---
James Calligeros (16):
ASoC: dt-bindings: cs42l84: Document sound-name-prefix property
ASoC: dt-bindings: cs42l42: Do not require chip power supplies
ASoC: dt-bindings: cs42l42: Document #sound-dai-cells property
ASoC: dt-bindings: cs42l42: Document sound-name-prefix property
arm64: dts: apple: t8103-j274: Add speaker/headset jack nodes
arm64: dts: apple: t8103-j313: Add speaker/headset jack nodes
arm64: dts: apple: t8103-j293: Add speaker/headset jack nodes
arm64: dts: apple: t8103-j45x: Add headset jack nodes
arm64: dts: apple: t8112-j413: Add speaker/headset jack nodes
arm64: dts: apple: t8112-j415: Add speaker/headset jack nodes
arm64: dts: apple: t8112-j473: Add speaker/headset jack nodes
arm64: dts: apple: t8112-j493: Add speaker/headset jack nodes
arm64: dts: apple: t600x-j31x: Add speaker/headset jack nodes
arm64: dts: apple: t600x-j375: Add speaker/headset jack nodes
arm64: dts: apple: t602x-j41x: Add speaker/headset jack nodes
arm64: dts: apple: t602x-j47x: Add speaker/headset jack nodes
Martin Povišer (5):
ASoC: dt-bindings: Add binding for Apple Silicon Mac audio
ASoC: ops: Introduce 'snd_soc_deactivate_kctl'
ASoC: ops: Introduce 'soc_set_enum_kctl'
ASoC: card: Let 'fixup_controls' return errors
ASoC: apple: Add macaudio machine driver
.../bindings/sound/apple,macaudio.yaml | 210 +++
.../bindings/sound/cirrus,cs42l42.yaml | 11 +-
.../bindings/sound/cirrus,cs42l84.yaml | 3 +
.../arm64/boot/dts/apple/t6000-j314s.dts | 5 +
.../arm64/boot/dts/apple/t6000-j316s.dts | 5 +
.../arm64/boot/dts/apple/t6001-j314c.dts | 5 +
.../arm64/boot/dts/apple/t6001-j316c.dts | 5 +
.../arm64/boot/dts/apple/t6001-j375c.dts | 5 +
.../arm64/boot/dts/apple/t6002-j375d.dts | 5 +
.../boot/dts/apple/t600x-j314-j316.dtsi | 135 ++
.../arm64/boot/dts/apple/t600x-j375.dtsi | 65 +
.../arm64/boot/dts/apple/t6020-j414s.dts | 5 +
.../arm64/boot/dts/apple/t6020-j416s.dts | 5 +
.../arm64/boot/dts/apple/t6020-j474s.dts | 5 +
.../arm64/boot/dts/apple/t6021-j414c.dts | 5 +
.../arm64/boot/dts/apple/t6021-j416c.dts | 5 +
.../arm64/boot/dts/apple/t6021-j475c.dts | 5 +
.../arm64/boot/dts/apple/t6022-j475d.dts | 5 +
.../boot/dts/apple/t602x-j414-j416.dtsi | 35 +
.../boot/dts/apple/t602x-j474-j475.dtsi | 10 +
arch/arm64/boot/dts/apple/t8103-j274.dts | 67 +
arch/arm64/boot/dts/apple/t8103-j293.dts | 111 ++
arch/arm64/boot/dts/apple/t8103-j313.dts | 82 ++
arch/arm64/boot/dts/apple/t8103-j456.dts | 38 +
arch/arm64/boot/dts/apple/t8103-j457.dts | 38 +
arch/arm64/boot/dts/apple/t8112-j413.dts | 108 ++
arch/arm64/boot/dts/apple/t8112-j415.dts | 132 ++
arch/arm64/boot/dts/apple/t8112-j473.dts | 62 +
arch/arm64/boot/dts/apple/t8112-j493.dts | 108 ++
include/sound/soc-card.h | 2 +-
include/sound/soc.h | 6 +-
sound/soc/apple/Kconfig | 18 +
sound/soc/apple/Makefile | 4 +
sound/soc/apple/macaudio.c | 1699 +++++++++++++++++++++++++
.../soc/mediatek/mt8188/mt8188-mt6359.c | 4 +-
sound/soc/soc-card.c | 12 +-
sound/soc/soc-core.c | 5 +-
sound/soc/soc-ops.c | 103 ++
38 files changed, 3121 insertions(+), 12 deletions(-)
---
base-commit: 74612d0b448fe745e80cda87fe49ac3c102ccc1f
change-id: 20260915-macaudio-33c1c4f304da
Best regards,
--
James Calligeros <jcalligeros99@xxxxxxxxx>