public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
@ 2026-04-18  5:50 Baojun Xu
  2026-04-20  6:15 ` Takashi Iwai
  2026-04-20  6:43 ` Eric Naim
  0 siblings, 2 replies; 4+ messages in thread
From: Baojun Xu @ 2026-04-18  5:50 UTC (permalink / raw)
  To: tiwai, hansg
  Cc: ilpo.jarvinen, broonie, andriy.shevchenko, shenghao-ding,
	13916275206, platform-driver-x86, linux-sound, linux-kernel,
	baojun.xu, letitia.tsai, bill.yu

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@ti.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 f860e0eb7602..560f2385212d 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 a1d86bd309f4..885e0b6fed00 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.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
  2026-04-18  5:50 [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device Baojun Xu
@ 2026-04-20  6:15 ` Takashi Iwai
  2026-04-20  6:43 ` Eric Naim
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2026-04-20  6:15 UTC (permalink / raw)
  To: Baojun Xu
  Cc: tiwai, hansg, ilpo.jarvinen, broonie, andriy.shevchenko,
	shenghao-ding, 13916275206, platform-driver-x86, linux-sound,
	linux-kernel, letitia.tsai, bill.yu

On Sat, 18 Apr 2026 07:50:30 +0200,
Baojun Xu wrote:
> 
> 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@ti.com>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
  2026-04-18  5:50 [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device Baojun Xu
  2026-04-20  6:15 ` Takashi Iwai
@ 2026-04-20  6:43 ` Eric Naim
  2026-04-20  7:00   ` [EXTERNAL] " Xu, Baojun
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Naim @ 2026-04-20  6:43 UTC (permalink / raw)
  To: Baojun Xu, tiwai, hansg
  Cc: ilpo.jarvinen, broonie, andriy.shevchenko, shenghao-ding,
	13916275206, platform-driver-x86, linux-sound, linux-kernel,
	letitia.tsai, bill.yu

On 4/18/26 1:50 PM, Baojun Xu wrote:
> 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@ti.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 f860e0eb7602..560f2385212d 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 a1d86bd309f4..885e0b6fed00 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);

Hi Baojun, will this fix
https://lore.kernel.org/linux-sound/20260315160939.191265-1-dnaim@cachyos.org/ ?

Similarly, I noticed that something like the above was merged upstream, commit
0bdf27abaf894.

-- 
Regards,
  Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
  2026-04-20  6:43 ` Eric Naim
@ 2026-04-20  7:00   ` Xu, Baojun
  0 siblings, 0 replies; 4+ messages in thread
From: Xu, Baojun @ 2026-04-20  7:00 UTC (permalink / raw)
  To: Eric Naim, tiwai@suse.de, hansg@kernel.org
  Cc: ilpo.jarvinen@linux.intel.com, broonie@kernel.org,
	andriy.shevchenko@linux.intel.com, Ding, Shenghao,
	13916275206@139.com, platform-driver-x86@vger.kernel.org,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	letitia.tsai@hp.com, bill.yu@canonical.com

Hi Eric,

> 
> ________________________________________
> From: Eric Naim <dnaim@cachyos.org>
> Sent: 20 April 2026 14:43
> To: Xu, Baojun; tiwai@suse.de; hansg@kernel.org
> Cc: ilpo.jarvinen@linux.intel.com; broonie@kernel.org; andriy.shevchenko@linux.intel.com; Ding, Shenghao; 13916275206@139.com; platform-driver-x86@vger.kernel.org; linux-sound@vger.kernel.org; linux-kernel@vger.kernel.org; letitia.tsai@hp.com; bill.yu@canonical.com
> Subject: [EXTERNAL] Re: [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
> 
> On 4/18/26 1:50 PM, Baojun Xu wrote:
> > 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@ti.com>
> > ---
> Hi Baojun, will this fix
> https://urldefense.com/v3/__https://lore.kernel.org/linux-sound/20260315160939.191265-1-dnaim@cachyos.org/__;!!G3vK!X-jfopjNDyUV4Zt7eHbLDT79zxX8PrVATeyHGzNtgCNvue6wSwqHWSaaVOuqjRfYbzZ5TQzNVhRq$ ?
> 
> Similarly, I noticed that something like the above was merged upstream, commit
> 0bdf27abaf894.
> 

To clarify: The patch mentioned earlier was designed to register the correct project with the codec.
My patch specifically resolves the issue where calibration data fails to be applied properly.

> --
> Regards,
>   Eric
> 
> 

Best Regards
Jim


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-20  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-18  5:50 [PATCH v1] ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device Baojun Xu
2026-04-20  6:15 ` Takashi Iwai
2026-04-20  6:43 ` Eric Naim
2026-04-20  7:00   ` [EXTERNAL] " Xu, Baojun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox