Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276569
b: refs/heads/master
c: 766ddee
h: refs/heads/master
i:
  276567: d98bb3e
v: v3
  • Loading branch information
Takashi Iwai committed Dec 7, 2011
1 parent e85fa2a commit cec22bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c39d6aca10ffac15f6decb6afd9080549fc2392
refs/heads/master: 766ddee68bf1e4cc2cdcf73b34d243cf6e6f8ab0
24 changes: 15 additions & 9 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,8 @@ static int alc_auto_create_multi_out_ctls(struct hda_codec *codec,
}

static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
hda_nid_t dac, const char *pfx)
hda_nid_t dac, const char *pfx,
int cidx)
{
struct alc_spec *spec = codec->spec;
hda_nid_t sw, vol;
Expand All @@ -3189,15 +3190,15 @@ static int alc_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
if (is_ctl_used(spec->sw_ctls, val))
return 0; /* already created */
mark_ctl_usage(spec->sw_ctls, val);
return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, val);
return __add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, cidx, val);
}

sw = alc_look_for_out_mute_nid(codec, pin, dac);
vol = alc_look_for_out_vol_nid(codec, pin, dac);
err = alc_auto_add_stereo_vol(codec, pfx, 0, vol);
err = alc_auto_add_stereo_vol(codec, pfx, cidx, vol);
if (err < 0)
return err;
err = alc_auto_add_stereo_sw(codec, pfx, 0, sw);
err = alc_auto_add_stereo_sw(codec, pfx, cidx, sw);
if (err < 0)
return err;
return 0;
Expand Down Expand Up @@ -3238,16 +3239,21 @@ static int alc_auto_create_extra_outs(struct hda_codec *codec, int num_pins,
hda_nid_t dac = *dacs;
if (!dac)
dac = spec->multiout.dac_nids[0];
return alc_auto_create_extra_out(codec, *pins, dac, pfx);
return alc_auto_create_extra_out(codec, *pins, dac, pfx, 0);
}

if (dacs[num_pins - 1]) {
/* OK, we have a multi-output system with individual volumes */
for (i = 0; i < num_pins; i++) {
snprintf(name, sizeof(name), "%s %s",
pfx, channel_name[i]);
err = alc_auto_create_extra_out(codec, pins[i], dacs[i],
name);
if (num_pins >= 3) {
snprintf(name, sizeof(name), "%s %s",
pfx, channel_name[i]);
err = alc_auto_create_extra_out(codec, pins[i], dacs[i],
name, 0);
} else {
err = alc_auto_create_extra_out(codec, pins[i], dacs[i],
pfx, i);
}
if (err < 0)
return err;
}
Expand Down

0 comments on commit cec22bd

Please sign in to comment.