* [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices
@ 2026-09-29 21:53 Andreas Axelsson
2026-09-29 22:24 ` Mark Brown
2026-11-20 21:58 ` Ye Shu
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Axelsson @ 2026-09-29 21:53 UTC (permalink / raw)
To: Mark Brown
Cc: lgirdwood, shenghao-ding, kevin-lu, baojun.xu, sen, tiwai,
linux-sound, linux-kernel
On SPI-based TAS2781 HDA systems (e.g. HP laptops with two amplifiers
on separate SPI chip selects), each tasdevice_priv instance services a
single device, and the SPI bus glue returns -EXDEV for register access
addressed to a channel the instance does not own (see
tasdevice_spi_change_chn_book()).
Commit 513480da5e9c ("ALSA: hda/tas2781: Fix device-0 reset issue and
handle -EXDEV in block data processing") taught
tasdevice_process_block() to ignore -EXDEV on SPI, but
tasdev_load_calibrated_data() still tries to write calibration data
for every channel. On each instance the write for the other amplifier
fails and is logged as an error on every boot, resume and profile
switch:
tas2781-hda spi1-TXNW2781:00-tas2781-hda.1: chn 0 r0_reg bulk_wr err
= -18
The owning instance loads that channel's calibration data itself, so
skip channels other than priv->index on SPI.
Tested on an HP ZBook Fury G1i (subsystem 103C:8DE8) with two TAS2781
amps on SPI.
Fixes: 9fa6a693ad8d ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and
leverage SND_SOC_TAS2781_FMWLIB")
Signed-off-by: Andreas Axelsson <andreas.axelsson@androscientia.com>
---
v2:
- Rebased on current code. The tasdevice_process_block() part of v1
is superseded by commit 513480da5e9c; only the calibration part
remains.
- Resent as a new thread with the patch inline; my earlier reply had
it as an attachment, sorry for the noise.
sound/soc/codecs/tas2781-fmwlib.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/codecs/tas2781-fmwlib.c
b/sound/soc/codecs/tas2781-fmwlib.c
index e8ceeb0..e250d38 100644
--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2631,6 +2631,10 @@ static void tasdev_load_calibrated_data(struct
tasdevice_priv *priv, int i)
if (!data || !cali_data->total_sz)
return;
+ /* On SPI each instance owns a single device; skip the others. */
+ if (priv->isspi && i != priv->index)
+ return;
+
if (data[k] != i) {
dev_err(priv->dev, "%s: no cal-data for dev %d from usr-spc\n",
__func__, i);
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices
2026-09-29 21:53 [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices Andreas Axelsson
@ 2026-09-29 22:24 ` Mark Brown
2026-09-29 22:25 ` Mark Brown
2026-11-20 21:58 ` Ye Shu
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-09-29 22:24 UTC (permalink / raw)
To: Andreas Axelsson
Cc: lgirdwood, shenghao-ding, kevin-lu, baojun.xu, sen, tiwai,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 457 bytes --]
On Tue, Sep 29, 2026 at 11:53:03PM +0200, Andreas Axelsson wrote:
> v2:
> - Rebased on current code. The tasdevice_process_block() part of v1
> is superseded by commit 513480da5e9c; only the calibration part
> remains.
This applies on neither for-7.3 nor for-7.4 of:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
As a fix I'd expect to apply it on for-7.3. I'm also seeing a conflict
against Linus' current tree.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices
2026-09-29 22:24 ` Mark Brown
@ 2026-09-29 22:25 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-09-29 22:25 UTC (permalink / raw)
To: Andreas Axelsson
Cc: lgirdwood, shenghao-ding, kevin-lu, baojun.xu, sen, tiwai,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
On Tue, Sep 29, 2026 at 11:24:07PM +0100, Mark Brown wrote:
> On Tue, Sep 29, 2026 at 11:53:03PM +0200, Andreas Axelsson wrote:
>
> > v2:
> > - Rebased on current code. The tasdevice_process_block() part of v1
> > is superseded by commit 513480da5e9c; only the calibration part
> > remains.
>
> This applies on neither for-7.3 nor for-7.4 of:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
>
> As a fix I'd expect to apply it on for-7.3. I'm also seeing a conflict
> against Linus' current tree.
BTW you might want to look into using b4 to send - looking again I see
it's not actually a conflict but rather a formatting issue:
Patch failed at 0001 ASoC: tas2781: Skip calibration data for other SPI devices
error: git diff header lacks filename information when removing 1 leading pathname component (line 13)
error: could not build fake ancestor
You might want to look at b4 to send the patches, especially it's web
submission endpoint which avoids having to configure mail:
https://b4.docs.kernel.org/en/latest/contributor/overview.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices
2026-09-29 21:53 [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices Andreas Axelsson
2026-09-29 22:24 ` Mark Brown
@ 2026-11-20 21:58 ` Ye Shu
1 sibling, 0 replies; 4+ messages in thread
From: Ye Shu @ 2026-11-20 21:58 UTC (permalink / raw)
To: Andreas Axelsson, Mark Brown
Cc: lgirdwood, shenghao-ding, kevin-lu, baojun.xu, sen, tiwai,
linux-sound, linux-kernel
Hi Andreas and Mark,
I tested this patch on my HP ZBook 8 G2i 14 (subsystem 103C:8ED9), which
also has two SPI TAS2781 amplifiers, running Fedora kernel
7.3.4-300.fc45.x86_64.
Before applying the patch, I observed the same errors (r0_reg bulk_wr
err = -18). They disappeared after applying the change, and both
speakers continue to work.
Tested-by: Ye Shu <hello@shuye.dev>
Also, I noticed that the v2 patch could not be applied due to a
malformed header. Are you planning to resubmit the patch? Or I'd be
happy to do so.
Best,
Ye
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-20 21:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 21:53 [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices Andreas Axelsson
2026-09-29 22:24 ` Mark Brown
2026-09-29 22:25 ` Mark Brown
2026-11-20 21:58 ` Ye Shu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®