Repository navigation
j85: speakers — MCA1 and a CS35L19 amplifier driver, on main's A7 audio support - #223
Merged
Merged
Conversation
The iPad mini 2's two speakers play, in stereo. They are two CS35L19
amplifiers on I2C2, fed over TDM by the A7's MCA1. The A7 SmartIO, MCA
and i2s-switch support, and the SmartIO firmware in the J85 recipe, are
main's; this adds what the J85 needs on top:
- SmartIO exposes MCA1's transmit endpoint, 0x2a;
- apple,s5l8960x-mca-tdm, MCA1's speaker link in the S8000 MCA driver:
a consumer of the amplifiers' frame, 8 x 16-bit DSP A slots, the 12 MHz
MCLK, the -12 dB bound, and no interrupt (MCA1's line stormed);
- a driver and binding for the CS35L19, which uses the CS35L33's register
map: per-register ID reads, the digital volume at 0x10 ("Amp Volume",
-102..0 dB, starting at 0 dB), the alive watchdog kept off;
- MCA1 in the A7 tree, and the amplifiers and a "J85 Speakers" card in
the J85's;
- CONFIG_SND_SOC_CS35L19=m for apple-4k and apple-16k.
The headphone jack (CS42L81) and the microphones are not part of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
henrikklee
added a commit
that referenced
this pull request
Nov 23, 2026
…peakers on every iPad mini 2 and 3 #217 and #223 each brought a driver for the same amplifier. Keep the one #217 carries (Project Cascadia's, which Orchard's iPad mini 1 build uses too, with #217's 16-bit slots, CS35L21, watchdog, gain cap and fault watch) and teach it what the iPad mini 2 needs from #223's: the first amplifier drives the TDM frame when its endpoint says so (new drivers/sound 0043). The binding (0042) describes one node per amplifier; the speakers go into s5l8960x-mini2.dtsi with two amplifier nodes and an audio-graph-card2 card, since the IPSW device trees of all six iPad mini 2 and 3 models describe the same speakers. #223's MCA, SmartIO and MCA1 patches are unchanged apart from numbers (sound 0040-0041, soc-apple 0037, s5l8960x 0014-0015) and the context of the MCA binding and driver after #217's S8000 link. CONFIG_SND_SOC_CS35L19 appears once per config, in Kconfig order. The J85's audio_output is untested until the shared driver runs on it; the other five models are untested with the same description. Also: the Orchard note in the AOP patch names its source like the others do. Assisted-by: LLM
Contributor
|
Thanks! This is on main now, reworked so that one CS35L19 driver serves every board:
The power-up order is now the Cascadia driver's, so the J85's audio_output is untested until the speakers play on main. Could you try main on your J85 and tell us how it sounds? The amp volumes are "Left Speaker Volume" and "Right Speaker Volume". One request: your kernel patches here have no Signed-off-by. Could you reply with yours in the form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The iPad mini 2 (Wi-Fi, J85, A7) has no sound on
main: its device.toml says the speakers are "two CS35L19 amplifiers on I2C2 + MCA1, which have no driver". This PR adds the missing parts on top of the A7 audio support that 0.3.3 brought for the iPad Air (thisiscamk's work, merged by Henrik Klee): SmartIO (apple,s5l8960x-sio), the MCA driver's version 1 support, the i2s-switch and the SmartIO firmware step.It replaces my earlier J85 audio branch, which had its own SmartIO, MCA and i2s-switch patches and now conflicts with
main. This version usesmain's as they are and only adds what the J85 needs.Reused from
main, unchanged:apple,s5l8960x-sio), enabled for every A7 board;s8000-mca, including the A7 TX/RX_CTL word (MCA_V1_XX_CTL_A7);devices/j85/firmware.json(smartio-from-kernelcache@2); no recipe change is needed.The values come from the J85's Apple device tree (iOS 12.5.8 16H88) and from static analysis of iOS 12.5.8's
AppleCS35L19Amp.Changes
drivers/soc-apple0035): the A7 table gains MCA1's transmit endpoint, 0x2a (ADT/arm-io/mca1dma-channels), next to MCA0's 0x28/0x29.drivers/sound0031–0032):apple,s5l8960x-mca-tdm, MCA1's speaker link:no_irqflag, set only on this variant. On the J85, MCA1's interrupt line stayed asserted during the first prepare with no cause in the status register ("irq 60: nobody cared"), and the storm starved the touchscreen's SPI firmware upload.main's MCA requests the interrupt on every variant, so this is still needed.apple,s5l8960x-mca(the iPad Air's I2S link on MCA0) and the other variants are unchanged.drivers/sound0033–0034): a new codec driver and binding. The CS35L19 uses the CS35L33's register map. The node describes the pair at the primary's address, as Apple's device tree does, and the driver reaches the secondary as an ancillary I2C device.AppleCS35L19Ampfor a link without speaker sense data, with the ADT's speaker-config records.devices/s5l8960x0012–0013):s5l8960x.dtsi: MCA1, disabled (AIC 148, MCLK word at 0x20a002004, SmartIO 0x2a, i2s-switch aud1 to pin1).s5l8960x-j85.dts: MCA1 on, the amplifiers at I2C2 0x40/0x41 (reset on GPIO 114) and a "J85 Speakers" simple-audio-card.CONFIG_SND_SOC_CS35L19=mfor apple-4k and apple-16k. The apple-armv7 config already has aSND_SOC_CS35L19from the Cascadia import (the iPad mini 1). That is a different driver in a different series; the two never share a tree.audio_outputisworking.audio_inputstaysmissing. Includes the regenerated matrix and a CHANGELOG entry under Unreleased.Testing
iPad mini 2 Wi-Fi (J85, iPad4,4), on installed Omarchy, with my earlier tree (2026-11-22/23), which combined this code with the J85's touch, Wi-Fi, charging and sleep work:
This exact series has not run on the iPad. How it differs from what I tested:
cs35l19.cis the tested file, except one comment line ("A7 iPads" became "A7 iPad minis"). The Kconfig help says the same.apple,s5l8960x-mcatoapple,s5l8960x-mca-tdm, becausemainuses the first name for the iPad Air's I2S link. It usesmain'sv1_ctlfield (0xf on the A7).no_irqon both A7 MCA variants. Here only MCA1 has it, so the iPad Air's MCA0 behaves as it does onmain.main's driver. My tree exposed endpoints 0x28–0x2f; this exposes 0x28, 0x29 and 0x2a.mainalready does. It also drops the CS42L81 headset codec on SPI2, which had no card and isn't needed for the speakers.Checks:
bin/orchard build --device j85and--device j81(withexamples/minimal-boot) both build.cs35l19.c,s8000-mca.candapple-sio-core.cbuild without warnings. The J85 DTB has the amplifiers, MCA1 and the card.kernel/audit-patches.pypasses for j85, j81, j71b and j71t.tools/catalog/generate matrix --checkpasses.python -m unittest discover -s tests: 926 tests, the same count as on unmodifiedmain. The 5 intest_ramandtest_cascadia_loaderfail on this host on both.main's checkout also failedtest_n61_data's touch recipe test, which passes on this branch, so that one looks like a quirk of that checkout.Overlaps
devices/j85/device.toml,CHANGELOG.mdanddocs/compatibility.md. The device.toml lines are different, but the CHANGELOG entries and the matrix rows will conflict. Merge the CHANGELOG by hand and regenerate the matrix.Open questions
apple,s5l8960x-mca-tdm, followingapple,t8010-mca/apple,t8010-mca-i2s, where the suffix names the link. Happy to rename it.s5l8960x-j85.dts.main's air1 commit says the iPad mini 2 and 3 all use two CS35L19s on I2C2 and MCA1, but I only have the J85's device tree. If the J86/J87 (and mini 3) trees match, the nodes could move tos5l8960x-mini2.dtsi(and mini3).mainenables MCA0, with its interrupt, on every A7 board. On the J85 nothing uses it after probe, so its interrupt is only on briefly while probe reads the version, with every cause masked. My tested tree had MCA0's interrupt off, so this combination hasn't run with the speakers playing.Not included
🤖 Generated with Claude Code