aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-12-07 10:55:19 -0500
committerTakashi Iwai <tiwai@suse.de>2011-12-07 11:32:24 -0500
commit766ddee68bf1e4cc2cdcf73b34d243cf6e6f8ab0 (patch)
treed85c439209faf32ef86aa3df5aba11b598e0c662
parent6c39d6aca10ffac15f6decb6afd9080549fc2392 (diff)
ALSA: hda/realtek - Don't create extra controls with channel suffix
The multiple headphone or speaker pins are usually provided to output the same stream unlike line-out jacks (which are supposed to be multi-channel surrounds). Thus giving a mixer name like "Headphone Surround" is rather confusing. Instead, when multiple headphone volumes are available, use index with the same "Headphone" name. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a7d1bc4e0d09..96f5da9db5cf 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3173,7 +3173,8 @@ static int alc_auto_create_multi_out_ctls(struct hda_codec *codec,
3173} 3173}
3174 3174
3175static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, 3175static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
3176 hda_nid_t dac, const char *pfx) 3176 hda_nid_t dac, const char *pfx,
3177 int cidx)
3177{ 3178{
3178 struct alc_spec *spec = codec->spec; 3179 struct alc_spec *spec = codec->spec;
3179 hda_nid_t sw, vol; 3180 hda_nid_t sw, vol;
@@ -3189,15 +3190,15 @@ static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
3189 if (is_ctl_used(spec->sw_ctls, val)) 3190 if (is_ctl_used(spec->sw_ctls, val))
3190 return 0; /* already created */ 3191 return 0; /* already created */
3191 mark_ctl_usage(spec->sw_ctls, val); 3192 mark_ctl_usage(spec->sw_ctls, val);
3192 return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, val); 3193 return __add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, cidx, val);
3193 } 3194 }
3194 3195
3195 sw = alc_look_for_out_mute_nid(codec, pin, dac); 3196 sw = alc_look_for_out_mute_nid(codec, pin, dac);
3196 vol = alc_look_for_out_vol_nid(codec, pin, dac); 3197 vol = alc_look_for_out_vol_nid(codec, pin, dac);
3197 err = alc_auto_add_stereo_vol(codec, pfx, 0, vol); 3198 err = alc_auto_add_stereo_vol(codec, pfx, cidx, vol);
3198 if (err < 0) 3199 if (err < 0)
3199 return err; 3200 return err;
3200 err = alc_auto_add_stereo_sw(codec, pfx, 0, sw); 3201 err = alc_auto_add_stereo_sw(codec, pfx, cidx, sw);
3201 if (err < 0) 3202 if (err < 0)
3202 return err; 3203 return err;
3203 return 0; 3204 return 0;
@@ -3238,16 +3239,21 @@ static int alc_auto_create_extra_outs(struct hda_codec *codec, int num_pins,
3238 hda_nid_t dac = *dacs; 3239 hda_nid_t dac = *dacs;
3239 if (!dac) 3240 if (!dac)
3240 dac = spec->multiout.dac_nids[0]; 3241 dac = spec->multiout.dac_nids[0];
3241 return alc_auto_create_extra_out(codec, *pins, dac, pfx); 3242 return alc_auto_create_extra_out(codec, *pins, dac, pfx, 0);
3242 } 3243 }
3243 3244
3244 if (dacs[num_pins - 1]) { 3245 if (dacs[num_pins - 1]) {
3245 /* OK, we have a multi-output system with individual volumes */ 3246 /* OK, we have a multi-output system with individual volumes */
3246 for (i = 0; i < num_pins; i++) { 3247 for (i = 0; i < num_pins; i++) {
3247 snprintf(name, sizeof(name), "%s %s", 3248 if (num_pins >= 3) {
3248 pfx, channel_name[i]); 3249 snprintf(name, sizeof(name), "%s %s",
3249 err = alc_auto_create_extra_out(codec, pins[i], dacs[i], 3250 pfx, channel_name[i]);
3250 name); 3251 err = alc_auto_create_extra_out(codec, pins[i], dacs[i],
3252 name, 0);
3253 } else {
3254 err = alc_auto_create_extra_out(codec, pins[i], dacs[i],
3255 pfx, i);
3256 }
3251 if (err < 0) 3257 if (err < 0)
3252 return err; 3258 return err;
3253 } 3259 }