ALSA: HDA: Realtek: Avoid unnecessary volume control index on Surround/Side

Similar to commit 7e59e097c09b82760bb0fe08b0fa2b704d76c3f4, this patch
avoids unnecessary volume control indices for more
Realtek auto-parsers, e g the ALC66x family, on the "Surround" and "Side"
controls.
These indices cause these volume controls to be ignored by PulseAudio and
vmaster and should be removed whenever possible.

Cc: stable@kernel.org
Reported-by: Jan Losinski <losinski@wh2.tu-dresden.de>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by David Henningsson and committed by Takashi Iwai 5a882646 ee3c35c0

+17 -8
+17 -8
sound/pci/hda/patch_realtek.c
··· 16008 16008 return err; 16009 16009 } else { 16010 16010 const char *name = pfx; 16011 - if (!name) 16011 + int index = i; 16012 + if (!name) { 16012 16013 name = chname[i]; 16013 - err = __alc861_create_out_sw(codec, name, nid, i, 3); 16014 + index = 0; 16015 + } 16016 + err = __alc861_create_out_sw(codec, name, nid, index, 3); 16014 16017 if (err < 0) 16015 16018 return err; 16016 16019 } ··· 17164 17161 return err; 17165 17162 } else { 17166 17163 const char *name = pfx; 17167 - if (!name) 17164 + int index = i; 17165 + if (!name) { 17168 17166 name = chname[i]; 17167 + index = 0; 17168 + } 17169 17169 err = __add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, 17170 - name, i, 17170 + name, index, 17171 17171 HDA_COMPOSE_AMP_VAL(nid_v, 3, 0, 17172 17172 HDA_OUTPUT)); 17173 17173 if (err < 0) 17174 17174 return err; 17175 17175 err = __add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, 17176 - name, i, 17176 + name, index, 17177 17177 HDA_COMPOSE_AMP_VAL(nid_s, 3, 2, 17178 17178 HDA_INPUT)); 17179 17179 if (err < 0) ··· 19225 19219 return err; 19226 19220 } else { 19227 19221 const char *name = pfx; 19228 - if (!name) 19222 + int index = i; 19223 + if (!name) { 19229 19224 name = chname[i]; 19230 - err = __alc662_add_vol_ctl(spec, name, nid, i, 3); 19225 + index = 0; 19226 + } 19227 + err = __alc662_add_vol_ctl(spec, name, nid, index, 3); 19231 19228 if (err < 0) 19232 19229 return err; 19233 - err = __alc662_add_sw_ctl(spec, name, mix, i, 3); 19230 + err = __alc662_add_sw_ctl(spec, name, mix, index, 3); 19234 19231 if (err < 0) 19235 19232 return err; 19236 19233 }