Repository navigation
ASoC: tas2764: J604 amplifier init writes as macOS does them - #2595
IronsideXXVI wants to merge 3 commits into
Conversation
Apple machines can initialise their SN012776 amplifiers with a few register writes beyond the driver's own sequence. Add a property that lists them as (page, register, value) byte triples. Assisted-by: LLM Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
macOS 26B123 initialises each of the J604's six SN012776 amplifiers with three writes the driver does not make (traced at boot on the J604 with the I2C3 controller recorded from the hypervisor's entry): page 0 register 0x07 = 0x68, page 1 register 0x19 = 0x40 and page 1 register 0x47 = 0x02. Every other write of that init matches the driver: the six enabled quirk sequences, the DC blockers and the brownout block from the boot loader's copies of the ADT, and the TDM setup. Apply the apple,init-writes triples after the built-in quirks at initialisation, each checked against the writeable-register list (page 1 register 0x19 joins it). Assisted-by: LLM Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
Set apple,init-writes on the J604's six SN012776 amplifiers to the three writes macOS 26B123 makes at their initialisation and the driver does not: page 0 register 0x07 = 0x68, page 1 register 0x19 = 0x40, page 1 register 0x47 = 0x02. Assisted-by: LLM Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
|
Thanks for splitting this out of #1894 and for the second J604 row; the probe-time check against the writeable-register list is a good guard. One question on where the writes live. We select behaviour by a hardware property rather than by the machine it was traced on. The driver applies its built-in Apple quirks to every SN012776 ( If macOS writes the same three values on every SN012776 Mac, they belong with the built-in init quirks, so every Mac with this amplifier gets them, including the V/I sense staying powered during playback. If the values really differ per board, could the binding and the DT comment say what about the J604 makes them different? Could you also name what page 1 |
|
@RyanTheTide thanks. What I know about the three:
I agree with selecting by hardware. If your machines show the same writes under macOS, or your playback and sense rows come back clean with them as built-in quirks, they belong in the quirks and I'll drop |
|
Thanks, that is very helpful. Since page 1 For page 1 We will run the playback and sense rows we offered once that branch is up. |
|
Sounds good. I'll do the quirks version as its own branch: page 1 |
|
@RyanTheTide the quirks version is up as its own branch: https://github.com/IronsideXXVI/linux/tree/j604-tas2764-quirks (on
No page 1 Next is the J604 A/B with and without |
|
Thanks for the quirks branch. Both writes going through the built-in quirk mechanism, applied to every SN012776, with no binding or DT change and Could this PR be moved to that branch (or a new PR opened from it), so CI runs on the exact commits? We'll run the playback and sense rows on it then, alongside your |
|
@RyanTheTide opened #2615 from I'll keep this one open only until the |
|
Thanks for opening #2615. It carries the version we'll take: both writes through the built-in quirks for every SN012776, no binding or DT change, and page 1 To your question: closing this now and posting the |
|
@DjDeveloperr thanks. Agreed, keeping it in one place is better: I'll close this one in favour of #2615 and post the |
The J604 (MacBook Pro 14" M4, T8132) has six SN012776 amplifiers. macOS 26B123 initialises each of them with three writes this driver does not make. I traced it at boot on the J604, recording the I2C3 controller from the hypervisor's entry. Every other write of that init matches the driver: the six enabled quirk sequences, the DC blockers and the brownout block from the boot loader's ADT copies, and the TDM setup. The three:
0x07 = 0x680x19 = 0x400x47 = 0x02This series:
apple,init-writesproperty, a list of (page, register, value) byte triples.0x19.Machines without the property are unchanged.
This is the init half of #1894, split out as I said there; #1894 keeps only the shutdown dance and stays a draft. @davishann15-commits ran this property alone on a second J604 (row 1 in #1894): the speakers play clean,
0x07reads0x68, and0x02reads0x80during playback, so V and I sense stay powered. No amp faults.Checked on top of
integration/auroradf62a8c:tools/asahi/run-host-tests.pyandscripts/dtc/apple-dt-check.sh, as the CI runs them: the same results as on the base (checkpatch clean;run-host-tests.pyfails only the tests that also fail on the base on my arm64 host, no rustc 1.96 there;apple-dt-check.sh: binding ok, no new DT warnings; ADT coverage and DART power-domain checks pass)The kernel my J604 runs today (linux-aurora 1.1125) carries the same init-writes code, together with the shutdown dance. Its log has no tas2764 errors after boot.
Tested on the J604 only.