Skip to contentSkip to conversation

ALSA: hda: Add TAS2770 support

PATCH In review Baojun Xu 2 participants 4 messages Jul 23, 2025 – Jul 26, 2025

Subsystems (2)
lore
Share & tools
lore

Baojun Xu

author maintainer
#0 lore raw

PATCH v2 1/1 ALSA: hda: Add TAS2770 support

Add TAS2770 support in TI's HDA driver. And add hda_chip_id for more products. Distinguish DSP and non-DSP in firmware loading function.

---
v2:
- Rewrite the patch description
- Move registers define for TAS2770 from tas2781.h to tas2770-tlv.h
- Add new chip ID define for HDA
- Add digital volume control in tas2770_snd_controls
- Change public kcontrol name from tas27xx_ to tasdevice_
- Create new function for kcontrol adding
- Create new function for DSP binary loading
- Rename chip_id to hda_chip_id in i2c_probe for the supported devices

---
 include/sound/tas2770-tlv.h                   |  23 +++
 .../hda/codecs/side-codecs/tas2781_hda_i2c.c  | 161 +++++++++++-------
 2 files changed, 127 insertions(+), 57 deletions(-)
 create mode 100644 include/sound/tas2770-tlv.h
include/sound/tas2770-tlv.h new file +23 -0
new file mode 100644
index 000000000000..c0bd495b4a07
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+//
+// ALSA SoC Texas Instruments TAS2770 Audio Smart Amplifier
+//
+// Copyright (C) 2025 Texas Instruments Incorporated
+// https://www.ti.com
+//
+// The TAS2770 hda driver implements for one, two, or even multiple
+// TAS2770 chips.
+//
+// Author: Baojun Xu <[email protected]>
+//
+
+#ifndef __TAS2770_TLV_H__
+#define __TAS2770_TLV_H__
+
+#define TAS2770_DVC_LEVEL		TASDEVICE_REG(0x0, 0x0, 0x17)
+#define TAS2770_AMP_LEVEL		TASDEVICE_REG(0x0, 0x0, 0x03)
+
+static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2770_dvc_tlv, 1650, 50, 0);
+static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2770_amp_tlv, 1100, 50, 0);
+
+#endif
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +104 -57

249 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Baojun Xu

Add TAS2770 support in TI's HDA driver. And add hda_chip_id for more products. Distinguish DSP and non-DSP in firmware loading function.

Applied now, thanks.

BTW, is include/sound/tas2770-tlv.h used by any other driver? (Also include/sound/tas2781-tlv.h).

If those are used only by tas2781-hda-i2s/spi drivers, the files can be moved to sound/hda/codecs/side-codecs as local headers.

In general, include/sound is rather for public headers that are read by multiple drivers in different places.

thanks,

Takashi

author maintainer
#2 lore raw
Quoted 29 lines

________________________________________
From: Takashi Iwai <[email protected]>
Sent: 23 July 2025 22:40
To: Xu, Baojun
Cc: [email protected]; [email protected]; [email protected]; Ding, Shenghao; [email protected]; P O, Vijeth; [email protected]; [email protected]
Subject: [EXTERNAL] Re: [PATCH v2] ALSA: hda: Add TAS2770 support

On Wed, 23 Jul 2025 16: 24: 23 +0200, Baojun Xu wrote: > > Add TAS2770 support in TI's HDA driver. And add hda_chip_id for > more products. Distinguish DSP and non-DSP in firmware > loading function. > > Signed-off-by: Baojun ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!vxdrHf3EPmdQig3vfxtoX0ga-ZW2grb4pJ-90xEaom-nVsHT8xHY3D2nK8v5mdWlEw0t3Q$>
Report Suspicious

ZjQcmQRYFpfptBannerEnd

Quoted 6 lines · Baojun Xu

Add TAS2770 support in TI's HDA driver. And add hda_chip_id for more products. Distinguish DSP and non-DSP in firmware loading function.

Applied now, thanks.

Quoted 8 lines

BTW, is include/sound/tas2770-tlv.h used by any other driver? (Also include/sound/tas2781-tlv.h).

If those are used only by tas2781-hda-i2s/spi drivers, the files can be moved to sound/hda/codecs/side-codecs as local headers.

In general, include/sound is rather for public headers that are read by multiple drivers in different places.

Thanks for the apply!
Yes, include/sound/tasxxxx-tlv.h will also be used by other drivers (for example, sound/soc/codecs/tas2xxx-i2c.c)

Quoted 6 lines

thanks,

Takashi

Best Regards
Jim

#3 lore raw
Quoted 36 lines · Baojun
Quoted 36 lines

________________________________________
From: Takashi Iwai <[email protected]>
Sent: 23 July 2025 22:40
To: Xu, Baojun
Cc: [email protected]; [email protected]; [email protected]; Ding, Shenghao; [email protected]; P O, Vijeth; [email protected]; [email protected]
Subject: [EXTERNAL] Re: [PATCH v2] ALSA: hda: Add TAS2770 support

On Wed, 23 Jul 2025 16: 24: 23 +0200, Baojun Xu wrote: > > Add TAS2770 support in TI's HDA driver. And add hda_chip_id for > more products. Distinguish DSP and non-DSP in firmware > loading function. > > Signed-off-by: Baojun ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!vxdrHf3EPmdQig3vfxtoX0ga-ZW2grb4pJ-90xEaom-nVsHT8xHY3D2nK8v5mdWlEw0t3Q$>
Report Suspicious

ZjQcmQRYFpfptBannerEnd

Quoted 6 lines · Baojun Xu

Add TAS2770 support in TI's HDA driver. And add hda_chip_id for more products. Distinguish DSP and non-DSP in firmware loading function.

Applied now, thanks.

BTW, is include/sound/tas2770-tlv.h used by any other driver? (Also include/sound/tas2781-tlv.h).

If those are used only by tas2781-hda-i2s/spi drivers, the files can be moved to sound/hda/codecs/side-codecs as local headers.

Quoted 6 lines
Quoted 2 lines

In general, include/sound is rather for public headers that are read by multiple drivers in different places.

Thanks for the apply!
Yes, include/sound/tasxxxx-tlv.h will also be used by other drivers (for example, sound/soc/codecs/tas2xxx-i2c.c)

OK, in that case, it's fine.

thanks,

Takashi