Re: [PATCH] ASoC: tas2781: Do not report cross-instance writes as errors on SPI

From: Andreas Axelsson

Date: Tue Sep 29 2026 - 17:37:37 EST


Attached is the updated patch.

Best regards,

Andreas

On 11/06/2026 2.36 pm, Mark Brown wrote:
On Thu, Jun 11, 2026 at 10:20:18AM +0200, Andreas Axelsson wrote:
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. The SPI bus glue intentionally returns -EXDEV for
register access addressed to a channel the instance does not own, and
logs it at debug level as "Not error" (see
tasdevice_spi_change_chn_book()).
This doesn't apply against current code, please check and resend.
From: Andreas Axelsson <andreas.axelsson@xxxxxxxxxxxxxxxxx>
Subject: [PATCH v2] ASoC: tas2781: Skip calibration data for other SPI devices

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@xxxxxxxxxxxxxxxxx>
---
v2:
- Rebased on current code. The tasdevice_process_block() part of v1
is superseded by commit 513480da5e9c; only the calibration part
remains.

--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2631,6 +2631,10 @@
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);