Repository navigation
ASoC: tas2764: J604 amplifier init writes through the built-in quirks - #2615
IronsideXXVI wants to merge 4 commits into
Conversation
|
Thanks for the quirks version. Two concerns before this becomes the default for every SN012776:
Leaving page 1 Assisted-by: LLM (Claude:Opus 5.5) |
|
Thanks Ryan. Agreed, bit 6 stays out of |
|
@RyanTheTide pushed two commits on top (head 1b127df):
On the SDZ point: I have no other Mac to run the stop/start loop on, so I took immediate SDZ out of the default. The init quirk is now These are the TAS2764's names. I'm assuming the SN012776 follows them, as the driver already does for the other registers. The J604 rows (bit 6 with the temperature and latches logged, and a stream stop/start loop with the latches read) will come here with the The missing Checkpatch --strict is clean on both, a W=1 build of sound/soc/codecs has no warnings, and the host tests and DT checks give the same results as on the base. |
|
Checked 1b127df. Both points are addressed. Still open: none of the four commits carries a Assisted-by: LLM (Claude:Opus 5.5) |
The driver defines TAS2764_THERMAL_TH1_DISABLE (page 1 register 0x47 = 0x02) but leaves it out of ENABLED_APPLE_QUIRKS. macOS 26B123 makes this write when it initialises each SN012776 on the J604 (traced at boot from the hypervisor), so enable the quirk for every SN012776. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
macOS 26B123 writes 0x68 to page 0 register 0x07 when it initialises each SN012776 on the J604 (traced at boot from the hypervisor). The shutdown-dance quirk writes 0x60 to the same register for an immediate SDZ shutdown, but that quirk is off by default. Add an init quirk next to the dance that writes 0x68, and enable it for every SN012776. It runs after the dance's own init write, so the register ends at 0x68 when the dance is enabled too. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
Page 1 register 0x47 is TG_EN in the TAS2764 data sheet (SLOS998A, 8.9.113, reset 0xab): bit 0 enables thermal threshold 1, bit 1 thermal threshold 2. The quirk writes 0x02, which leaves threshold 2 only. The data sheet does not say which temperature threshold 1 is or what the amplifier does when it is crossed, and one J604 boot trace is not enough to turn it off on every SN012776. Take TAS2764_THERMAL_TH1_DISABLE back out of ENABLED_APPLE_QUIRKS, as the original quirks commit had it, and write the register by its name. It can come back with a measurement of what threshold 1 does. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…efault Page 0 register 0x07 is MISC_CFG2 in the TAS2764 data sheet (SLOS998A, 8.9.11, reset 0x20): SDZ_MODE in bits 7:6, SDZ_TIMEOUT in bits 5:4, DVC_RAMP_RATE in bits 3:2. macOS's 0x68 is immediate SDZ, the 6 ms timeout (the reset value) and DVC_RAMP_RATE=10b, which ramps the digital volume by 0.5 dB per 8 samples instead of per sample. Bit 3 is the high bit of that ramp rate. The shutdown dance's 0x60 is the same without the ramp rate. Immediate SDZ without the dance's page 0xfd writes around shutdown has only run on the J604, so it should not become the default for every SN012776. Rename the init quirk to TAS2764_DVC_RAMP_INIT and have it update only the ramp rate field. SDZ_MODE stays at its reset value unless the shutdown dance is enabled; with the dance enabled the register ends at 0x68, as macOS leaves it. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
1b127df to
d96df02
Compare
d96df02 to
a12eae7
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at a12eae78a916 (CI: host-tests passing).
The final tree at a12eae78a916 looks solid: ENABLED_APPLE_QUIRKS is 0x13f (leaving TAS2764_THERMAL_TH1_DISABLE and TAS2764_SHUTDOWN_DANCE off by default), TAS2764_MISC_CFG2 and TAS2764_TG_EN fields are properly named from the datasheet, and tas2764_apply_init_quirks() updates only DVC_RAMP_RATE via regmap_update_bits() (verified against tas2764_i2c_regmap cache/resume sync). Commit attribution (§4) is clean: all commits carry human author/committer and Signed-off-by: only, and the PR body carries Assisted-by:.
Blockers:
- §3 Safety / bisectability — unsafe intermediate commits in branch history:
integration/auroramerges PRs with merge commits rather than squashing, so commits 1 and 2 (8cdfd6dee8and1c1039d186) would enter mainline history withTAS2764_THERMAL_TH1_DISABLEenabled (0x3f -> 0x7f) and immediate SDZ enabled without the shutdown dance (0x68,0x17f) across all ~26 SN012776 boards before commits 3 and 4 (897c89adf1,a12eae78a9) revert both. Agit bisectlanding on commits 1–2 would disable thermal threshold 1 on speaker amps. Please fold/squash the branch into clean commit(s) that never introduce those intermediate states. - Stale PR description: The PR body still describes the old 2-commit series (
0x3f -> 0x7fenablingTAS2764_THERMAL_TH1_DISABLE, andTAS2764_SDZ_MODE_INIT/0x17f), contradicting the live head (0x13f,TAS2764_DVC_RAMP_INIT).
Still needed (§5 Evidence):
- No hardware test row on
a12eae78a916yet. BecauseENABLED_APPLE_QUIRKSapplies to every SN012776 Mac (~26 boards), please post a J604 run on the squashed head (and request a row on a second SN012776 Mac):MISC_CFG2readback after init/resume, playback + stream stop/start fault-latch check (INT_LTCH0..4), and the §5 regression line (0 SELinux denials, 0 failed units, 0 new kernel errors).
Minor nits (non-blocking):
sound/soc/codecs/tas2764-quirks.h:174still listsDVC ramp rateunderOther setup TODOs.sound/soc/codecs/tas2764.c:1483can use the newTAS2764_TG_ENmacro instead of rawTAS2764_REG(0x1, 0x47).
Assisted-by: LLM (Gemini 4 Neon)
RyanTheTide
left a comment
There was a problem hiding this comment.
Checked a12eae7: same tree as 1b127df, the head reviewed last, and all four commits now carry your Signed-off-by, which was the only open item. Approving: threshold 1 stays enabled (0x13f), and the MISC_CFG2 default only touches the ramp-rate field, so no protection setting moves. No speaker playback was needed for this check; the init is register-level.
Assisted-by: LLM (Claude:Opus 5.5)
The J604 (MacBook Pro 14" M4, T8132) has six SN012776 amplifiers, and macOS 26B123 initialises each of them with writes this driver does not make (traced at boot on the J604 from the hypervisor, see #2595). This is the quirks version asked for in #2595: two of those writes go through the driver's built-in Apple quirks, applied to every SN012776, with no binding or DT change.
ASoC: tas2764: enable the thermal threshold 1 quirk on Apple amplifiersadds the existingTAS2764_THERMAL_TH1_DISABLEtoENABLED_APPLE_QUIRKS(0x3f->0x7f), so page 10x47=0x02is written on every SN012776.ASoC: tas2764: write the SDZ mode register as macOS does at initadds an init quirk next to the shutdown dance,TAS2764_SDZ_MODE_INIT(BIT(8)), which writes0x68to page 00x07, enabled for every SN012776 (mask0x17f). The dance itself stays off; when it is on, this runs after its0x60write, so the register ends at0x68either way.Left out: the page 1
0x19=0x40write. Its effect is unknown, so it is not applied to every amplifier. I'm running a J604 A/B with and without it (amp registers read back during playback, level and THD+N of a 1 kHz tone through the built-in mics at a fixed volume, amp temperature and fault latches over a 60 s tone) and will post the numbers in #2595. If it shows no difference,0x19stays out; if it does, it comes as a separate change with the reason written down.Checked on top of
integration/auroradf62a8c, the same base as #2595:sound/soc/codecs/builds with W=1, no warnings, no errorsscripts/dtc/apple-dt-check.shand the ADT coverage and DART checks: pass (no DT change)tools/asahi/run-host-tests.py: on my arm64 host it fails the same tests as the base (no rustc 1.96 there), pluscio-native-testsanddart-cio-owner-tests, which failed in the full run and pass when I rerun them alone. Neither touches this code; CI here is the real check.#2595 stays open until the
0x19A/B is in; after that I'll close it in favour of this one.Assisted-by: LLM (Claude:Opus 5.5, Claude:Fable 5.2)