[PATCH v1] ASoC: tas2781: Normalize the volume kcontrol name

As more devices become supported, add "tas2781" as a suffix before the TLV name, correct the DVC step, and normalize the volume kcontrol name.
Signed-off-by: Baojun Xu baojun.xu@ti.com --- include/sound/tas2781-tlv.h | 6 ++++-- sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 4 ++-- sound/hda/codecs/side-codecs/tas2781_hda_spi.c | 5 +++-- sound/soc/codecs/tas2781-i2c.c | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/include/sound/tas2781-tlv.h b/include/sound/tas2781-tlv.h index d87263e43fdb..38b8f828a353 100644 --- a/include/sound/tas2781-tlv.h +++ b/include/sound/tas2781-tlv.h @@ -15,7 +15,9 @@ #ifndef __TAS2781_TLV_H__ #define __TAS2781_TLV_H__
-static const __maybe_unused DECLARE_TLV_DB_SCALE(dvc_tlv, -10000, 100, 0); -static const __maybe_unused DECLARE_TLV_DB_SCALE(amp_vol_tlv, 1100, 50, 0); +static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2781_dvc_tlv, + -10000, 50, 0); +static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2781_amp_tlv, + 1100, 50, 0);
#endif diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c index a0b132681804..6ec93b27aa7f 100644 --- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c @@ -265,9 +265,9 @@ static const struct snd_kcontrol_new tas2770_snd_controls[] = { };
static const struct snd_kcontrol_new tas2781_snd_controls[] = { - ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL, + ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2781_AMP_LEVEL, 1, 0, 20, 0, tas2781_amp_getvol, - tas2781_amp_putvol, amp_vol_tlv), + tas2781_amp_putvol, tas2781_amp_tlv), ACARD_SINGLE_BOOL_EXT("Speaker Force Firmware Load", 0, tas2781_force_fwload_get, tas2781_force_fwload_put), }; diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c index 09a5d0f131b2..b4664a696bad 100644 --- a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c +++ b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c @@ -494,9 +494,10 @@ static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol,
static struct snd_kcontrol_new tas2781_snd_ctls[] = { ACARD_SINGLE_RANGE_EXT_TLV(NULL, TAS2781_AMP_LEVEL, 1, 0, 20, 0, - tas2781_amp_getvol, tas2781_amp_putvol, amp_vol_tlv), + tas2781_amp_getvol, tas2781_amp_putvol, tas2781_amp_tlv), ACARD_SINGLE_RANGE_EXT_TLV(NULL, TAS2781_DVC_LVL, 0, 0, 200, 1, - tas2781_digital_getvol, tas2781_digital_putvol, dvc_tlv), + tas2781_digital_getvol, tas2781_digital_putvol, + tas2781_dvc_tlv), ACARD_SINGLE_BOOL_EXT(NULL, 0, tas2781_force_fwload_get, tas2781_force_fwload_put), }; diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index 9f4d965a1335..a51f20cd869a 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -908,12 +908,12 @@ static const struct snd_kcontrol_new tasdevice_cali_controls[] = { };
static const struct snd_kcontrol_new tas2781_snd_controls[] = { - SOC_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL, + SOC_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2781_AMP_LEVEL, 1, 0, 20, 0, tas2781_amp_getvol, - tas2781_amp_putvol, amp_vol_tlv), - SOC_SINGLE_RANGE_EXT_TLV("Speaker Digital Gain", TAS2781_DVC_LVL, + tas2781_amp_putvol, tas2781_amp_tlv), + SOC_SINGLE_RANGE_EXT_TLV("Speaker Digital Volume", TAS2781_DVC_LVL, 0, 0, 200, 1, tas2781_digital_getvol, - tas2781_digital_putvol, dvc_tlv), + tas2781_digital_putvol, tas2781_dvc_tlv), };
static const struct snd_kcontrol_new tas2781_cali_controls[] = {

On Wed, Jul 30, 2025 at 01:32:36PM +0800, Baojun Xu wrote:
As more devices become supported, add "tas2781" as a suffix before the TLV name, correct the DVC step, and normalize the volume kcontrol name.
I'll apply this but this really should be several different commits, the variable renaming and the user visible renaming should at least be separate commits.

On Wed, Jul 30, 2025 at 11:17:49AM +0100, Mark Brown wrote:
On Wed, Jul 30, 2025 at 01:32:36PM +0800, Baojun Xu wrote:
As more devices become supported, add "tas2781" as a suffix before the TLV name, correct the DVC step, and normalize the volume kcontrol name.
I'll apply this but this really should be several different commits, the variable renaming and the user visible renaming should at least be separate commits.
Sorry, actually no - there's also HDA changes mixed in here which should be a separate commit as well. Please split this up into separate changes.

On Wed, 30 Jul 2025 13:32:36 +0800, Baojun Xu wrote:
As more devices become supported, add "tas2781" as a suffix before the TLV name, correct the DVC step, and normalize the volume kcontrol name.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: tas2781: Normalize the volume kcontrol name commit: 47ed64db8c17eb16541098add865178fb7e68744
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Baojun Xu
-
Mark Brown