[SRU][R][PATCH 1/1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device

AceLan Kao acelan.kao at canonical.com
Thu May 21 02:42:12 UTC 2026


From: Baojun Xu <baojun.xu at ti.com>

BugLink: https://bugs.launchpad.net/bugs/2149770

In the SPI driver probe, the chip ID must be set to TAS2781. Without this
initialization, calibration data fails to load correctly, causing audio
abnormalities on some devices.
And update the register bulk read API to handle the distinct requirements
of SPI and I2C devices.

Fixes: 05ac3846ffe5 ("ALSA: hda/tas2781: A workaround solution to lower-vol issue among lower calibrated-impedance micro-speaker on TAS2781")
Signed-off-by: Baojun Xu <baojun.xu at ti.com>
Link: https://patch.msgid.link/20260418055030.765-1-baojun.xu@ti.com
Signed-off-by: Takashi Iwai <tiwai at suse.de>
(cherry picked from commit 055e3fcc66caee8ae470c98e06120b494c95525b linux-next)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao at canonical.com>
---
 sound/hda/codecs/side-codecs/tas2781_hda_spi.c | 1 +
 sound/soc/codecs/tas2781-fmwlib.c              | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
index f860e0eb7602a..560f2385212dd 100644
--- a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
+++ b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c
@@ -788,6 +788,7 @@ static int tas2781_hda_spi_probe(struct spi_device *spi)
 	}
 	if (strstr(dev_name(&spi->dev), "TXNW2781")) {
 		device_name = "TXNW2781";
+		tas_hda->priv->chip_id = TAS2781;
 	} else {
 		dev_err(tas_priv->dev, "Unmatched spi dev %s\n",
 			dev_name(&spi->dev));
diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c
index a1d86bd309f48..885e0b6fed003 100644
--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2487,7 +2487,7 @@ static int tas2781_cali_preproc(struct tasdevice_priv *priv, int i)
 		if (spec == NULL)
 			return -ENOMEM;
 		priv->tasdevice[i].cali_specific = spec;
-		rc = tasdevice_dev_bulk_read(priv, i, p->r0_reg, r0_deflt, 4);
+		rc = priv->dev_bulk_read(priv, i, p->r0_reg, r0_deflt, 4);
 		if (rc < 0) {
 			dev_err(priv->dev, "invalid RE from %d = %d\n", i, rc);
 			return rc;
@@ -2511,9 +2511,8 @@ static int tas2781_cali_preproc(struct tasdevice_priv *priv, int i)
 				TASDEVICE_REG(0, 0x1b, 0x34) :
 				TASDEVICE_REG(0, 0x18, 0x1c);
 
-			rc = tasdevice_dev_bulk_read(priv, i,
-						      spec->sin_gni_reg,
-						      spec->sin_gni, 4);
+			rc = priv->dev_bulk_read(priv, i, spec->sin_gni_reg,
+						 spec->sin_gni, 4);
 			if (rc < 0) {
 				dev_err(priv->dev, "wrong sinegaini %d = %d\n",
 					i, rc);
-- 
2.53.0




More information about the kernel-team mailing list