Skip to content

Commit

Permalink
ASoC: allo-piano-dac-plus: Remove pointless code
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pelwell committed Jan 9, 2025
1 parent 9147c0b commit bd18ae2
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions sound/soc/bcm/allo-piano-dac-plus.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,32 +731,14 @@ 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++) {
char cname[256];

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);
Expand Down

0 comments on commit bd18ae2

Please sign in to comment.