Repository navigation
ASoC: tas2764: J604 amplifier init writes through the built-in quirks - #2615
IronsideXXVI wants to merge 2 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) |
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)
…d TG_EN macOS 26B123 writes 0x68 to page 0 register 0x07 when it initialises each SN012776 on the J604 (traced at boot from the hypervisor). That register 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. 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. The shutdown dance's 0x60 is the same value without the ramp rate. Immediate SDZ without the dance's page 0xfd writes around shutdown has only run on the J604, so it does not become the default for every SN012776. Add TAS2764_DVC_RAMP_INIT, enabled for every SN012776, which updates 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. macOS also writes 0x02 to page 1 register 0x47 at init. That register is TG_EN (SLOS998A, 8.9.113, reset 0xab): bit 0 enables thermal threshold 1, bit 1 thermal threshold 2, so 0x02 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. TAS2764_THERMAL_TH1_DISABLE therefore stays out of ENABLED_APPLE_QUIRKS; name the register and its two enable bits, and have that quirk write the register by name. Name the MISC_CFG2 fields too, and have the shutdown dance write its 0x60 by field. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
The writeable-register list still spells TG_EN as TAS2764_REG(0x1, 0x47), and the "Other setup TODOs" list still names the DVC ramp rate, which TAS2764_DVC_RAMP_INIT now sets. Use the name, and drop the TODO along with its now empty list. The object code does not change. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
a12eae7 to
200b94a
Compare
|
@DjDeveloperr thanks. Pushed 200b94a, two commits:
@RyanTheTide your approval was on a12eae7. The first commit is that same tree, and the second commit is only the two nits. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 re-review at verified live head 200b94a76e6ff3c35bf8a9b9c25bfb94424ac093 (live integration/aurora 70a00e583b03, not superseded; CI: host-tests green).
Resolved since a12eae78a916
- §3 Safety / bisectability: Pass — the earlier 4 commits are folded into
2be0b03498cf, so no commit in the branch ever enablesTAS2764_THERMAL_TH1_DISABLEor immediate SDZ by default (ENABLED_APPLE_QUIRKSis0x13fthroughout). - PR description & nits: Pass — PR body accurately reflects the live head,
200b94a76e6fusesTAS2764_TG_ENintas2764_writeable_register(), and removes the completed DVC ramp-rate TODO. - §1, §2, §4, §6: Pass — no model gating,
regmap_update_bits()updates onlyTAS2764_MISC_CFG2_DVC_RAMP_RATEintas2764_apply_init_quirks()(covered across probe and SDZ-reset resume), both commits carry human author/committer + humanSigned-off-by:only, PR body carriesAssisted-by:, and naming/CI are clean.
Remaining Blocker (§5 Evidence)
- No hardware verification on live head
200b94a76e6f: BecauseENABLED_APPLE_QUIRKS(0x3f -> 0x13f) runs on every SN012776 Mac (~26 board files), please post the pending J604 test row on this head before approval:MISC_CFG2(0x07) readback after init and after suspend/resume confirmingDVC_RAMP_RATE = 10band preservedSDZ_MODE/SDZ_TIMEOUT.- Playback with stream stop/start loop and
INT_LTCH0..4fault-latch readback after each. - Full §5 regression line:
0SELinux denials,0failed units,0new kernel error lines (plus a row on a second SN012776 Mac if available).
Assisted-by: LLM (Gemini 4 Neon)
|
@DjDeveloperr thanks. There's no code change here either, since the hardware row is the open item. It's queued on the J604 with
I don't have a second SN012776 Mac, so that row will need someone who does. The J604 results will go here. |
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: the change goes through the driver's built-in Apple quirks, with no binding or DT change.
Two commits on
integration/auroradf62a8c:ASoC: tas2764: set the DVC ramp rate as macOS does; name MISC_CFG2 and TG_EN. This is the four earlier commits folded into one. Its tree is the same as the old head a12eae7 (git diff a12eae78 2be0b034is empty), so no commit in the branch ever turns off thermal threshold 1 or makes immediate SDZ the default.0x07) and its fields from the data sheet (SLOS998A, 8.9.11, reset0x20):SDZ_MODE7:6,SDZ_TIMEOUT5:4,DVC_RAMP_RATE3:2.TAS2764_DVC_RAMP_INIT(BIT(8)), enabled for every SN012776 (ENABLED_APPLE_QUIRKS0x3f->0x13f). It sets onlyDVC_RAMP_RATEto10b(the volume ramps 0.5 dB per 8 samples instead of per sample) withregmap_update_bits().SDZ_MODEstays at its reset value unless the shutdown dance is on; with the dance on, the register ends at macOS's0x68.0x47, SLOS998A 8.9.113, reset0xab) and its two threshold enables.TAS2764_THERMAL_TH1_DISABLEnow writes it by name, but it stays out of the defaults, so threshold 1 stays enabled on every SN012776.ASoC: tas2764: use TAS2764_TG_EN in the writeable list; drop a done TODO. These are the two review nits. The object code does not change (see below).Left out on purpose:
0xfdwrites.0x19=0x40write: its effect is unknown. The J604 A/B with and without it (register readback 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) is still to come and will be posted here, since ASoC: tas2764: J604 amplifier init writes as macOS does them #2595 is closed in favour of this PR.Hardware: not tested on this head yet. Still to come from the J604, and I'll post it here:
MISC_CFG2read back after init and again after a suspend and resume.INT_LTCH0..4read after each.A row from a second SN012776 Mac would be welcome from anyone who has one.
Checked on this head:
git diff a12eae78 2be0b034: empty (the fold keeps the tree byte for byte).sound/soc/codecs/tas2764.obuilt with LLVM and W=1 on each commit, with no warnings. With debug info stripped, the two objects are byte-identical, and.text,.rodataand.dataare the same, so the nits commit is no functional change.Assisted-by: LLM (Claude:Opus 5.5, Claude:Fable 5.2)