Linux 7.4 Improves Apple Silicon Audio Using Shared GPIO
Linux 7.4 improves Apple Silicon audio support, fixing power management via shared GPIO infrastructure.
Improvements to audio support for Apple Silicon are progressing ahead of the Linux 7.4 development cycle. According to reporting by Michael Larabel of Phoronix, changes leveraging shared GPIO infrastructure have been merged into the Apple SoC branch. The target is the speaker codecs for Macs equipped with M-series SoCs. This article is based on Phoronix (All Rights Reserved) and relies on fair quotation under Article 32 of the Japanese Copyright Act.
This change replaces a downstream workaround in Asahi Linux with an upstream mechanism. The development was led by James Calligeros, who works on Apple Silicon support. This week, he posted a series of patches to use shared GPIO for audio support. The changes cover the ASoC drivers for tas2764 and tas2770 and configuration on the ARCH_APPLE side. They have already been listed in the Apple SoC branch as integration targets for Linux 7.4.
Audio Architecture Sharing a Single GPIO Line
Macs with Apple Silicon have multiple speaker codecs. The software shutdown pin of each codec is connected to the same GPIO line. This line must be pulled high as long as any codec asserts it. Only when all codecs request shutdown is a transition to low allowed. This wiring differs from normal GPIO operation, which assumes individual control. Multiple users must collectively decide the state of a single line. The conventional GPIO infrastructure assumed exclusive control by a single owner. As a result, audio drivers were forced into special handling for power management. With shared GPIO infrastructure now in place in the kernel, the situation has changed. Multiple drivers and components can now safely share the same line.
Why Power Management Was Difficult:
Reasons and Background
The core of the problem lies in the order of suspend and resume. The kernel walks the list of codecs and calls suspend and resume in sequence. When the first codec drives the GPIO line low, the other codecs also shut down. Subsequent codecs are then asked to save state after they have already shut down. Register state cannot be saved correctly, causing inconsistency. The same applies on resume, with the line not returning until all codecs request it. Calligeros described this state as “impossible” power management. His explanation directly illustrates the conflict between wiring and control order.
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 [go] through the list of codecs and call each suspend/resume, the GPIO line is asserted low or high by the first suspended/resumed codec.
As the above quotation shows, the first state change propagates to the whole system. Individual codecs cannot control power independently. A design sharing shutdown pins is poorly suited to power-saving operation. Standby power consumption is especially important in portable devices. Shutdown in the wrong order can cause noise or initialization failures. Stable audio functionality requires strict management of the line state. This constraint long blocked upstream integration. The new shared GPIO support is an attempt to break through that bottleneck.
Workaround Using a Virtual Regulator
The downstream Asahi Linux kernel has used its own workaround. It repurposed the regulator API as a proxy, creating a virtual regulator. It replaced the shutdown-gpios property in the codecs’ device descriptions. Under this scheme, the virtual regulator acts as an agent for the GPIO line. If any single user requests it, the pin is held high. Only when all users request shutdown is a transition to low allowed. With behavior close to reference counting, it prevented premature shutdown of the line. In practice it operated safely and supported audio output. However, it was a use outside the regulator’s intended purpose. It created debt in terms of configuration readability and maintainability. The correspondence between device descriptions and drivers was also unintuitive. Such repurposing is difficult to accept in upstream review. The arrival of shared GPIO infrastructure has made this workaround unnecessary. The same collective behavior can now be achieved with a more proper mechanism.
In the broader trend of kernel-side optimization, Linux Cache-Aware Scheduling Extension, up to 360% Faster MySQL also demonstrated the benefits of upstream integration. This overlaps with the move to shift downstream-only improvements to upstream common infrastructure. Rather than accumulating individual fixes, the direction is to raise the whole through infrastructure improvements.
Changes for Linux 7.4
This series of changes consists of three components. The first change enables shared GPIO on ARCH_APPLE. It lays the groundwork for using the new infrastructure. The second and third changes fix the tas2764 and tas2770 drivers. They target amplifier codecs from Texas Instruments. Previously, both drivers initialized the shutdown GPIO high. The shared GPIO infrastructure treats the first state change of a line as the default state. Starting high, the first change would be from high to low. In that case, on resume the line would not return until all codecs’ requests are aligned. Both drivers explicitly pull the line high during codec probe. Therefore, by initializing the value low, the first change becomes from low to high. The proxy mechanism then behaves as intended, holding the line high immediately when requested. Calligeros’s explanation indicates that this inversion of the initial value is the key point.
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. 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 fix exploits the interaction between initialization order and the consensus condition. It improves consistency between driver probe handling and power management handling. There is no longer a need to rewrite device descriptions or maintain virtual regulators. Instead of handling each codec individually, decisions are left to the infrastructure’s consensus. The patches have been merged into the Apple SoC branch and await submission for the 7.4 cycle. Through the normal development process, they will move upstream in the next merge window. The target users are developers and testers using Linux on M-series Macs. It will be an improvement directly tied to audio stability and suspend-resume reliability.
Improved Maintainability Through Upstream
Integration
Narrowing the gap between downstream and upstream is highly significant for maintenance. Asahi Linux has pioneered Apple Silicon support. Its unique innovations were essential to achieving early operation. However, downstream-only layers create long-term maintenance costs. Replacing them with upstream common mechanisms reduces duplicated testing. It also facilitates knowledge sharing with drivers for other SoCs. More use cases for the shared GPIO infrastructure itself will also improve its quality. Applications to designs sharing lines in devices other than audio are also conceivable. It will also influence design guidelines for the boundary area between power management and GPIO. Device descriptions become more proper, helping newcomers understand them. There is also the benefit of refining the implementation through upstream review. Although small in scale, this change involves a structural shift. It can be positioned as a transition from a stopgap to infrastructure use.
Editorial Opinion
Looking at short-term impact. Over the next 3 to 6 months, we expect fewer reports of audio-related issues on Linux on M-series Macs. Testing that repeats suspend and resume may show improved reproducibility of noise or muting. We assess that removing the virtual regulator will improve the clarity of device descriptions. Downstream tracking work will also become lighter, making it easier to follow 7.4 and later. We assess that developers will be able to redirect resources to other unsupported features. Taking a long-term view. Over 1 to 3 years, we expect consensus management of shared resources to spread to other drivers. Sharing of power domains and signal lines is an increasing trend in highly integrated SoCs. We assess that consolidation into common infrastructure will reduce per-model workarounds. An upstream-first development culture will take hold, speeding up bring-up of new SoCs. From users’ standpoint, we assess that this will lead to expanded supported models and improved baseline stability. Questions from the editorial team. It is asked whether the definition of the default state for shared GPIO can be applied as-is to other shared lines. We see a need to verify whether the technique of inverting the initial value breaks if probe order changes. Whether consensus conditions can be maintained when codecs from multiple vendors are mixed is also an issue, we assess.
References
- “Linux 7.4 To Improve Apple Silicon Audio Support & Its “Impossible” Power Management”, by Michael Larabel — Phoronix, 2026-09-04T12:13:01.000Z (ARR)
- Source URL: https://www.phoronix.com/news/Linux-Apple-Audio-Shared-GPIO
Frequently Asked Questions
- What is the key point of the Apple Silicon audio improvement in Linux 7.4
- It collectively manages multiple speaker codecs sharing the same GPIO line via the shared GPIO infrastructure. It drops proxying via a virtual regulator and resolves power management inconsistency with an upstream common mechanism. It includes changing the initial value of the tas2764 and tas2770 drivers to low.
- How does it differ from the previous Asahi Linux workaround
- Previously, it repurposed the regulator API and proxy-controlled the GPIO line with a virtual regulator. While behavior close to reference counting ensured safety, it was outside the intended use. This time, it uses the shared GPIO infrastructure to restore the correspondence between device descriptions and drivers to a proper form.
- What are the benefits for users
- For those using Linux on M-series Macs, audio stability and suspend-resume reliability are expected to improve. The gap between downstream and upstream is reduced, making it easier to follow future kernel updates. It also makes it easier to redirect development resources to other unsupported features.
Comments