Skip to content

Commit bd18ae2

Browse files
committed
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 <[email protected]>
1 parent 9147c0b commit bd18ae2

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

sound/soc/bcm/allo-piano-dac-plus.c

+1-19
Original file line numberDiff line numberDiff line change
@@ -731,32 +731,14 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd)
731731

732732
mutex_init(&glb_ptr->lock);
733733

734-
if (digital_gain_0db_limit) {
735-
int ret;
736-
737-
//Set volume limit on both dacs
738-
for (i = 0; i < ARRAY_SIZE(codec_ctl_pfx); i++) {
739-
char cname[256];
740-
741-
sprintf(cname, "%s %s", codec_ctl_pfx[i], codec_ctl_name[0]);
742-
ret = snd_soc_limit_volume(card, cname, 207);
743-
if (ret < 0)
744-
dev_warn(card->dev, "Failed to set %s volume limit: %d\n",
745-
cname, ret);
746-
}
747-
}
748-
749734
// Remove codec controls
750735
for (i = 0; i < ARRAY_SIZE(codec_ctl_pfx); i++) {
751736
for (j = 0; j < ARRAY_SIZE(codec_ctl_name); j++) {
752737
char cname[256];
753738

754739
sprintf(cname, "%s %s", codec_ctl_pfx[i], codec_ctl_name[j]);
755740
kctl = snd_soc_card_get_kcontrol(card, cname);
756-
if (!kctl) {
757-
dev_err(rtd->card->dev, "Control %s not found\n",
758-
cname);
759-
} else {
741+
if (kctl) {
760742
kctl->vd[0].access =
761743
SNDRV_CTL_ELEM_ACCESS_READWRITE;
762744
snd_ctl_remove(card->snd_card, kctl);

0 commit comments

Comments
 (0)