* [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support
@ 2026-08-31 11:32 James Calligeros
2026-08-31 11:32 ` [PATCH 1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon James Calligeros
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: James Calligeros @ 2026-08-31 11:32 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai
Cc: linux-arm-kernel, linux-kernel, linux-sound, asahi,
James Calligeros
Hi folks,
On Apple Silicon Macs, every speaker codec's software shutdown pin
is connected to the same GPIO line. This line must be pulled high
whenever any codec asserts it so.
This makes power management impossible. When we goe through the list of
codecs and call each suspend/resume, the GPIO line is asserted low or high
by the first suspended/resumed codec. This causes issues for the subsequent
codecs; they are already shut off by the time we try to cache the register
state on suspend.
In the downstream Asahi Linux kernel[1], we were previously (ab)using the
regulator API to work around this safely. We replaced the shutdown-gpios
property in the codec Devicetree nodes with a virtual regulator which acts
as a proxy for the GPIO line. The regulator will not deassert the pin until
every consumer wants it off, and it will assert it as soon as any one
codec requires it.
Now that the kernel has shared GPIO support, this has become unnecessary.
The first commit in this series enables shared GPIO for ARCH_APPLE so
that we can take advantage of this new(ish) infrastructure.
The shared GPIO infrastructure considers the first state change of a
line to be the "default" state, which is the state that it will allow
to be asserted without all consumers agreeing. Currently the TAS2764 and
TAS2770 drivers initialise the shutdown GPIO high, which means the first
change is to low. This does not help us, as the line will not be reasserted
on resume until all codecs have tried to assert it. Since both drivers
explicitly pull the line high on codec probe, we can initialise it low,
causing the first state change to be from low to high. This makes the
shared GPIO proxy behave as we intend. The second and third commits in this
series implement this.
This has been enabled in the Asahi Linux kernel since 7.1.9, and addresses
the last obstacle to attempting to upstream the machine driver for this
platform.
We intend to take the Kconfig patch via our soc tree. The two codec driver
changes should be taken via asoc.
Regards,
James
[1] https://github.com/AsahiLinux/linux
---
James Calligeros (3):
arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon
ASoC: tas2764: Initialise SDZ GPIO low
ASoC: tas2770: Initialise SDZ GPIO low
arch/arm64/Kconfig.platforms | 1 +
sound/soc/codecs/tas2764.c | 2 +-
sound/soc/codecs/tas2770.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
---
base-commit: cf72cbb39da84b6f02f90c07f33b102fc10b16f0
change-id: 20260829-apple-shared-gpio-60f86e74e35a
Best regards,
--
James Calligeros <jcalligeros99@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
@ 2026-08-31 11:32 ` James Calligeros
2026-08-31 11:32 ` [PATCH 2/3] ASoC: tas2764: Initialise SDZ GPIO low James Calligeros
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: James Calligeros @ 2026-08-31 11:32 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai
Cc: linux-arm-kernel, linux-kernel, linux-sound, asahi,
James Calligeros
Apple Silicon Macs use a shared GPIO line for all speaker codec
shutdown pins.
Select HAVE_SHARED_GPIOS for ARCH_APPLE so that we can use the
shared GPIO proxy infrastructure for this.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
---
arch/arm64/Kconfig.platforms | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index d2acfac73003..76a6a0e6ae4f 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -37,6 +37,7 @@ config ARCH_APPLE
bool "Apple Silicon SoC family"
select APPLE_AIC
select APPLE_PMGR_PWRSTATE if PM
+ select HAVE_SHARED_GPIOS
help
This enables support for Apple's in-house ARM SoC family, such
as the Apple M1.
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] ASoC: tas2764: Initialise SDZ GPIO low
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
2026-08-31 11:32 ` [PATCH 1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon James Calligeros
@ 2026-08-31 11:32 ` James Calligeros
2026-08-31 11:32 ` [PATCH 3/3] ASoC: tas2770: " James Calligeros
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: James Calligeros @ 2026-08-31 11:32 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai
Cc: linux-arm-kernel, linux-kernel, linux-sound, asahi,
James Calligeros
On Apple Silicon machines integrating TAS2764, the SDZ pin of all
codecs is connected to a shared GPIO line. The kernel's shared
GPIO infrastructure relies on the first change of the GPIO state
being marked as its "default" state, and allows any consumer of the
shared line to assert that state without consensus from other
consumers.
If the pin is initialised high, the shared GPIO core does not
allow the line to be asserted without consensus. This breaks
resuming from suspend on Apple Silicon machines; the driver attempts
to restore the codec's register state and fails because other
codecs are still holding the line low.
Initialise the SDZ GPIO low so that the first state change on probe
asserts it high, allowing any codec to pull the line up when it
needs to.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
---
sound/soc/codecs/tas2764.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c
index f9c65c9f6d0a..b3c08d106dd7 100644
--- a/sound/soc/codecs/tas2764.c
+++ b/sound/soc/codecs/tas2764.c
@@ -960,7 +960,7 @@ static int tas2764_parse_dt(struct device *dev, struct tas2764_priv *tas2764)
}
}
- tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH);
+ tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_LOW);
if (IS_ERR(tas2764->sdz_gpio)) {
if (PTR_ERR(tas2764->sdz_gpio) == -EPROBE_DEFER)
return -EPROBE_DEFER;
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] ASoC: tas2770: Initialise SDZ GPIO low
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
2026-08-31 11:32 ` [PATCH 1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon James Calligeros
2026-08-31 11:32 ` [PATCH 2/3] ASoC: tas2764: Initialise SDZ GPIO low James Calligeros
@ 2026-08-31 11:32 ` James Calligeros
2026-08-31 12:12 ` (subset) [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support Mark Brown
2026-09-01 20:11 ` Sven Peter
4 siblings, 0 replies; 6+ messages in thread
From: James Calligeros @ 2026-08-31 11:32 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai
Cc: linux-arm-kernel, linux-kernel, linux-sound, asahi,
James Calligeros
On Apple Silicon machines integrating TAS2770, the SDZ pin of all
codecs is connected to a shared GPIO line. The kernel's shared
GPIO infrastructure relies on the first change of the GPIO state
being marked as its "default" state, and allows any consumer of the
shared line to assert that state without consensus from other
consumers.
If the pin is initialised high, the shared GPIO core does not
allow the line to be asserted without consensus. This breaks
resuming from suspend on Apple Silicon machines; the driver attempts
to restore the codec's register state and fails because other
codecs are still holding the line low.
Initialise the SDZ GPIO low so that the first state change on probe
asserts it high, allowing any codec to pull the line up when
it needs to.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
---
sound/soc/codecs/tas2770.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index e79754edac5c..ecc37d4ac00b 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -886,7 +886,7 @@ static int tas2770_parse_dt(struct device *dev, struct tas2770_priv *tas2770)
if (rc)
tas2770->pdm_slot = -1;
- tas2770->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH);
+ tas2770->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_LOW);
if (IS_ERR(tas2770->sdz_gpio)) {
if (PTR_ERR(tas2770->sdz_gpio) == -EPROBE_DEFER)
return -EPROBE_DEFER;
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
` (2 preceding siblings ...)
2026-08-31 11:32 ` [PATCH 3/3] ASoC: tas2770: " James Calligeros
@ 2026-08-31 12:12 ` Mark Brown
2026-09-01 20:11 ` Sven Peter
4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-08-31 12:12 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, James Calligeros
Cc: linux-arm-kernel, linux-kernel, linux-sound, asahi
On Mon, 31 Aug 2026 21:32:38 +1000, James Calligeros wrote:
> Enable shared GPIO for Apple Silicon audio support
>
> Hi folks,
>
> On Apple Silicon Macs, every speaker codec's software shutdown pin
> is connected to the same GPIO line. This line must be pulled high
> whenever any codec asserts it so.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[2/3] ASoC: tas2764: Initialise SDZ GPIO low
https://git.kernel.org/broonie/sound/c/e152ac60589b
[3/3] ASoC: tas2770: Initialise SDZ GPIO low
https://git.kernel.org/broonie/sound/c/87e41baa36fc
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
` (3 preceding siblings ...)
2026-08-31 12:12 ` (subset) [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support Mark Brown
@ 2026-09-01 20:11 ` Sven Peter
4 siblings, 0 replies; 6+ messages in thread
From: Sven Peter @ 2026-09-01 20:11 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shenghao Ding,
Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, James Calligeros
Cc: Sven Peter, linux-arm-kernel, linux-kernel, linux-sound, asahi
On Mon, 31 Aug 2026 21:32:38 +1000, James Calligeros wrote:
> On Apple Silicon Macs, every speaker codec's software shutdown pin
> is connected to the same GPIO line. This line must be pulled high
> whenever any codec asserts it so.
>
> This makes power management impossible. When we goe through the list of
> codecs and call each suspend/resume, the GPIO line is asserted low or high
> by the first suspended/resumed codec. This causes issues for the subsequent
> codecs; they are already shut off by the time we try to cache the register
> state on suspend.
>
> [...]
Applied to git@github.com:AsahiLinux/linux.git (apple-soc/drivers-7.4), thanks!
[1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon
https://github.com/AsahiLinux/linux/commit/a416a347931f
Best regards,
--
Sven Peter <sven@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-01 20:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 11:32 [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support James Calligeros
2026-08-31 11:32 ` [PATCH 1/3] arm64: Kconfig: Select HAVE_SHARED_GPIOS for Apple Silicon James Calligeros
2026-08-31 11:32 ` [PATCH 2/3] ASoC: tas2764: Initialise SDZ GPIO low James Calligeros
2026-08-31 11:32 ` [PATCH 3/3] ASoC: tas2770: " James Calligeros
2026-08-31 12:12 ` (subset) [PATCH 0/3] Enable shared GPIO for Apple Silicon audio support Mark Brown
2026-09-01 20:11 ` Sven Peter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox