Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99124
b: refs/heads/master
c: 43785ea
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jun 18, 2008
1 parent db9d87d commit be0b895
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 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: 83544994a6a592073e9f6b937c6da12cf5ed2d1e
refs/heads/master: 43785eaeb1cfb8aed3cf8027f298b242f88fdc45
32 changes: 21 additions & 11 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -2621,24 +2621,34 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
{
struct ad198x_spec *spec = codec->spec;
hda_nid_t nid;
int idx, err;
int i, idx, err;
char name[32];

if (! pin)
return 0;

idx = ad1988_pin_idx(pin);
nid = ad1988_idx_to_dac(codec, idx);
/* specify the DAC as the extra output */
if (! spec->multiout.hp_nid)
spec->multiout.hp_nid = nid;
else
spec->multiout.extra_out_nid[0] = nid;
/* control HP volume/switch on the output mixer amp */
sprintf(name, "%s Playback Volume", pfx);
if ((err = add_control(spec, AD_CTL_WIDGET_VOL, name,
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT))) < 0)
return err;
/* check whether the corresponding DAC was already taken */
for (i = 0; i < spec->autocfg.line_outs; i++) {
hda_nid_t pin = spec->autocfg.line_out_pins[i];
hda_nid_t dac = ad1988_idx_to_dac(codec, ad1988_pin_idx(pin));
if (dac == nid)
break;
}
if (i >= spec->autocfg.line_outs) {
/* specify the DAC as the extra output */
if (!spec->multiout.hp_nid)
spec->multiout.hp_nid = nid;
else
spec->multiout.extra_out_nid[0] = nid;
/* control HP volume/switch on the output mixer amp */
sprintf(name, "%s Playback Volume", pfx);
err = add_control(spec, AD_CTL_WIDGET_VOL, name,
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT));
if (err < 0)
return err;
}
nid = ad1988_mixer_nids[idx];
sprintf(name, "%s Playback Switch", pfx);
if ((err = add_control(spec, AD_CTL_BIND_MUTE, name,
Expand Down

0 comments on commit be0b895

Please sign in to comment.