Skip to content

ASoC: tas2764: Power the amp down again when the component probe fails - #799

Closed
erikwb wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-probe-sdz
Closed

erikwb wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-probe-sdz

Conversation

@erikwb

@erikwb erikwb commented Nov 1, 2026

Copy link
Copy Markdown

When the TAS2764 component probe fails after powering the amp up, it returns with the SDZ supply still enabled. This undoes the power-up on those failures.

Stacked on #765, which moved the fault IRQ request to the end of the same function; the first commit here is #765's.

What happens

tas2764_codec_probe() enables the SDZ supply and raises the shutdown GPIO, then resets the amp and writes its setup over I2C. Ten of those writes, and the fault IRQ request for an amp in an SDZ group, can fail and return early. ASoC doesn't call the component's remove after a failed probe (soc_probe_component() only sets probed once the probe succeeded), so nothing drops that enable:

  • each failed probe leaves one more enable on the amp's supply consumer;
  • the supply then stays on after the card is removed and, for an amp outside an SDZ group, through system sleep as well.

The group shutdown on over-temperature or over-current is not affected: it forces the supply off regardless of enables.

The change

The failures after the power-up now go through one exit that lowers the shutdown GPIO and drops the supply enable. It skips the disable when the amp's group has failed and its supply was already forced off, as the remove does. A successful probe is unchanged.

Testing (J713)

I made the first setup write fail with a test-only module parameter, bound the speaker card twice (both binds fail at the first amp, 1-0038), then cleared the parameter and bound it again. Enables on the sn012776-sdz supply, from the regulator debugfs:

After the two failed binds After the good bind
Without this commit 1-0038 holds 2 1-0038 holds 3, the other amps 1 each
With this commit none 1 per amp

With the commit, both cards come back on the good bind and the speaker protection daemon runs normally.

  • Checks:
    • checkpatch --strict is clean;
    • the module builds with W=1 on integration/aurora with no warnings.

The component probe requests the fault IRQ as a devres of the I2C
device, which stays bound when the sound card is torn down.  Every
rebind of the card probes the component again and adds another handler
for the same amp on the line: after two rebinds the J713's four amps
had twelve handlers on their shared IRQ, each fault interrupt ran every
one of them, and each does six I2C reads.

Free the IRQ in the component remove.  Request it as the probe's last
step, so that a probe that fails later does not leave a handler behind
either.

Signed-off-by: Erik Bourget <erik@ebourget.net>
tas2764_codec_probe() enables the SDZ supply and raises the shutdown GPIO
before it resets the amp and writes its setup. When one of those writes
fails, or an amp in an SDZ group can't get its fault IRQ, the probe
returns with the supply still enabled. ASoC doesn't call the component's
remove after a failed probe, so nothing balances that enable, and every
later probe attempt adds another. The supply then stays on after the
card is removed and, for an amp outside an SDZ group, through system
sleep as well.

Undo the power-up on those failures: lower the shutdown GPIO and drop
the supply enable, unless the group failed and its supply was already
forced off, as the remove does.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 1, 2026

Copy link
Copy Markdown
Author

Superseded by #820, where this is commit 21, unchanged.

@erikwb erikwb closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant