From e71eaa0f8051bbe31a29a0d266326ff76725e6d3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Jan 2025 16:05:02 +0000 Subject: [PATCH] ASoC: allo-piano-dac-plus: Remove pointless code The codec control Digital Playback Volume is one of the controls deleted by the allo-piano-dac-plus driver. It is effectively replaced by the soundcard controls Master Playback Volume and Subwoofer Playback Volume. Delete the code that sets the volume limit on those codec controls - the limits on the soundcard volume controls are sufficient. Signed-off-by: Phil Elwell --- sound/soc/bcm/allo-piano-dac-plus.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c index c811aa75c52ac4..07cbd4215b7df1 100644 --- a/sound/soc/bcm/allo-piano-dac-plus.c +++ b/sound/soc/bcm/allo-piano-dac-plus.c @@ -731,21 +731,6 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) mutex_init(&glb_ptr->lock); - if (digital_gain_0db_limit) { - int ret; - - //Set volume limit on both dacs - for (i = 0; i < ARRAY_SIZE(codec_ctl_pfx); i++) { - char cname[256]; - - sprintf(cname, "%s %s", codec_ctl_pfx[i], codec_ctl_name[0]); - ret = snd_soc_limit_volume(card, cname, 207); - if (ret < 0) - dev_warn(card->dev, "Failed to set %s volume limit: %d\n", - cname, ret); - } - } - // Remove codec controls for (i = 0; i < ARRAY_SIZE(codec_ctl_pfx); i++) { for (j = 0; j < ARRAY_SIZE(codec_ctl_name); j++) { @@ -753,10 +738,7 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) sprintf(cname, "%s %s", codec_ctl_pfx[i], codec_ctl_name[j]); kctl = snd_soc_card_get_kcontrol(card, cname); - if (!kctl) { - dev_err(rtd->card->dev, "Control %s not found\n", - cname); - } else { + if (kctl) { kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE; snd_ctl_remove(card->snd_card, kctl);