Commit 002f5d19 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

ALSA: hda - Fix wrong volumes in AD1988 auto-probe mode

commit 43785eae upstream

Don't create mixer volume elements for Headphone and Speaker if they
use the same DAC as normal line-outs on AD1988.  Otherwise the amp
value gets screwed up, e.g.
	https://bugzilla.novell.com/show_bug.cgi?id=398255Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f0ebc654
...@@ -2623,7 +2623,7 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, ...@@ -2623,7 +2623,7 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
{ {
struct ad198x_spec *spec = codec->spec; struct ad198x_spec *spec = codec->spec;
hda_nid_t nid; hda_nid_t nid;
int idx, err; int i, idx, err;
char name[32]; char name[32];
if (! pin) if (! pin)
...@@ -2631,16 +2631,26 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, ...@@ -2631,16 +2631,26 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
idx = ad1988_pin_idx(pin); idx = ad1988_pin_idx(pin);
nid = ad1988_idx_to_dac(codec, idx); nid = ad1988_idx_to_dac(codec, idx);
/* 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 */ /* specify the DAC as the extra output */
if (! spec->multiout.hp_nid) if (!spec->multiout.hp_nid)
spec->multiout.hp_nid = nid; spec->multiout.hp_nid = nid;
else else
spec->multiout.extra_out_nid[0] = nid; spec->multiout.extra_out_nid[0] = nid;
/* control HP volume/switch on the output mixer amp */ /* control HP volume/switch on the output mixer amp */
sprintf(name, "%s Playback Volume", pfx); sprintf(name, "%s Playback Volume", pfx);
if ((err = add_control(spec, AD_CTL_WIDGET_VOL, name, err = add_control(spec, AD_CTL_WIDGET_VOL, name,
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT))) < 0) HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT));
if (err < 0)
return err; return err;
}
nid = ad1988_mixer_nids[idx]; nid = ad1988_mixer_nids[idx];
sprintf(name, "%s Playback Switch", pfx); sprintf(name, "%s Playback Switch", pfx);
if ((err = add_control(spec, AD_CTL_BIND_MUTE, name, if ((err = add_control(spec, AD_CTL_BIND_MUTE, name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment