From: James Calligeros <jcalligeros99@gmail.com>
To: "David Rhodes" <david.rhodes@cirrus.com>,
"Richard Fitzgerald" <rf@opensource.cirrus.com>,
"Martin Povišer" <povik+lin@cutebit.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"James Calligeros" <jcalligeros99@gmail.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Shenghao Ding" <shenghao-ding@ti.com>,
"Kevin Lu" <kevin-lu@ti.com>, "Baojun Xu" <baojun.xu@ti.com>,
"Sen Wang" <sen@ti.com>, "Sven Peter" <sven@kernel.org>,
"Janne Grunau" <j@jannau.net>, "Neal Gompa" <neal@gompa.dev>
Cc: asahi@lists.linux.dev, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Hector Martin <marcan@marcan.st>,
Sasha Finkelstein <k@chaosmail.tech>
Subject: [PATCH v3 00/21] Add speaker and headset jack support for Apple Silicon Macs
Date: Sun, 18 Oct 2026 15:53:54 +1000 [thread overview]
Message-ID: <20261018-macaudio-v3-0-abdff7741dea@gmail.com> (raw)
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@cutebit.org/
[2] https://github.com/AsahiLinux/speakersafetyd
---
Changes in v3:
- Add TAS5770L compatible to TAS2770 driver to match binding
- Fix incorrect Right Tweeter prefix on J415
- Make reference to dai-common.yaml in cs42l{42,84} bindings for
common properties
- Fix Devicetree binding formatting in macaudio binding
- Sort macaudio compatible list by fallback compatible
- Add references to fixed regulators for machines with CS42L83
- Fix iMac model compatibles (they are compatible with each other)
- Fix Mac Mini J474 name
- Rework kctl activate/deactivate to be a more pure wrapper of snd_ctl_activate_id
- Check for kctl->put before iterating in soc_set_enum_kctl
- Allocate structs on heap in soc_set_enum_kctl
- Rework snd_soc_set_enum_kctl to be neater
- Refactor snd_soc_set_enum_kctl to eliminate ret assignment
- Set evalue.id and info.id in soc_set_enum_kctl
- Guard against pointer arithmetic errors/null pointer deref in volume limiter
- Replace stored snd_soc_card with static struct
- Mark speaker BEs/FEs as nonatomic
- Link to v2: https://patch.msgid.link/20261004-macaudio-v2-0-7b47ed6335a8@gmail.com
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@gmail.com
To: David Rhodes <david.rhodes@cirrus.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Martin Povišer <povik+lin@cutebit.org>
To: Liam Girdwood <lgirdwood@gmail.com>
To: Mark Brown <broonie@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: James Calligeros <jcalligeros99@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.com>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Shenghao Ding <shenghao-ding@ti.com>
To: Kevin Lu <kevin-lu@ti.com>
To: Baojun Xu <baojun.xu@ti.com>
To: Sen Wang <sen@ti.com>
To: Sven Peter <sven@kernel.org>
To: Janne Grunau <j@jannau.net>
To: Neal Gompa <neal@gompa.dev>
Cc: asahi@lists.linux.dev
Cc: linux-sound@vger.kernel.org
Cc: patches@opensource.cirrus.com
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
James Calligeros (16):
ASoC: dt-bindings: cs42l84: Document sound-name-prefix property
ASoC: dt-bindings: cs42l42: Document additional dai-common properties
ASoC: tas2770: Add compatible for TAS5770L
arm64: dts: apple: t8103-jxxx: Add regulators for CS42L83 power supply
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_ctl_activate'
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 | 212 +++
.../bindings/sound/cirrus,cs42l42.yaml | 7 +
.../bindings/sound/cirrus,cs42l84.yaml | 5 +
.../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 | 72 ++
arch/arm64/boot/dts/apple/t8103-j293.dts | 116 ++
arch/arm64/boot/dts/apple/t8103-j313.dts | 87 ++
arch/arm64/boot/dts/apple/t8103-j456.dts | 43 +
arch/arm64/boot/dts/apple/t8103-j457.dts | 43 +
.../arm64/boot/dts/apple/t8103-jxxx.dtsi | 32 +
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 | 1715 +++++++++++++++++++++++++
sound/soc/codecs/tas2770.c | 1 +
.../soc/mediatek/mt8188/mt8188-mt6359.c | 4 +-
sound/soc/soc-card.c | 12 +-
sound/soc/soc-core.c | 5 +-
sound/soc/soc-ops.c | 99 ++
40 files changed, 3196 insertions(+), 7 deletions(-)
---
base-commit: 74612d0b448fe745e80cda87fe49ac3c102ccc1f
change-id: 20260915-macaudio-33c1c4f304da
Best regards,
--
James Calligeros <jcalligeros99@gmail.com>
next reply other threads:[~2026-10-18 5:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 5:53 James Calligeros [this message]
2026-10-18 5:53 ` [PATCH v3 01/21] ASoC: dt-bindings: cs42l84: Document sound-name-prefix property James Calligeros
2026-10-18 5:53 ` [PATCH v3 02/21] ASoC: dt-bindings: cs42l42: Document additional dai-common properties James Calligeros
2026-10-18 5:53 ` [PATCH v3 03/21] ASoC: dt-bindings: Add binding for Apple Silicon Mac audio James Calligeros
2026-10-18 5:53 ` [PATCH v3 04/21] ASoC: ops: Introduce 'snd_soc_ctl_activate' James Calligeros
2026-10-18 5:53 ` [PATCH v3 05/21] ASoC: ops: Introduce 'soc_set_enum_kctl' James Calligeros
2026-10-18 5:54 ` [PATCH v3 06/21] ASoC: card: Let 'fixup_controls' return errors James Calligeros
2026-10-18 5:54 ` [PATCH v3 07/21] ASoC: tas2770: Add compatible for TAS5770L James Calligeros
2026-10-18 5:54 ` [PATCH v3 08/21] ASoC: apple: Add macaudio machine driver James Calligeros
2026-10-18 5:54 ` [PATCH v3 09/21] arm64: dts: apple: t8103-jxxx: Add regulators for CS42L83 power supply James Calligeros
2026-10-18 5:54 ` [PATCH v3 10/21] arm64: dts: apple: t8103-j274: Add speaker/headset jack nodes James Calligeros
2026-10-18 5:54 ` [PATCH v3 11/21] arm64: dts: apple: t8103-j313: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 12/21] arm64: dts: apple: t8103-j293: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 13/21] arm64: dts: apple: t8103-j45x: Add headset " James Calligeros
2026-10-18 5:54 ` [PATCH v3 14/21] arm64: dts: apple: t8112-j413: Add speaker/headset " James Calligeros
2026-10-18 5:54 ` [PATCH v3 15/21] arm64: dts: apple: t8112-j415: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 16/21] arm64: dts: apple: t8112-j473: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 17/21] arm64: dts: apple: t8112-j493: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 18/21] arm64: dts: apple: t600x-j31x: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 19/21] arm64: dts: apple: t600x-j375: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 20/21] arm64: dts: apple: t602x-j41x: " James Calligeros
2026-10-18 5:54 ` [PATCH v3 21/21] arm64: dts: apple: t602x-j47x: " James Calligeros
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261018-macaudio-v3-0-abdff7741dea@gmail.com \
--to=jcalligeros99@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=asahi@lists.linux.dev \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=devicetree@vger.kernel.org \
--cc=j@jannau.net \
--cc=k@chaosmail.tech \
--cc=kevin-lu@ti.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=matthias.bgg@gmail.com \
--cc=neal@gompa.dev \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=povik+lin@cutebit.org \
--cc=rf@opensource.cirrus.com \
--cc=robh@kernel.org \
--cc=sen@ti.com \
--cc=shenghao-ding@ti.com \
--cc=sven@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®