Commit 64049c81 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix initialization of primary outputs in hda_generic.c

There were some old codes that look not stable enough, which was
derived from the old Realtek code.  The initialization for primary
output in init_multi_out() needs to consider the case of shared DAC.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent db23fd19
...@@ -3372,6 +3372,7 @@ static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin, ...@@ -3372,6 +3372,7 @@ static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin,
static void init_multi_out(struct hda_codec *codec) static void init_multi_out(struct hda_codec *codec)
{ {
struct hda_gen_spec *spec = codec->spec; struct hda_gen_spec *spec = codec->spec;
hda_nid_t nid, dac;
int pin_type; int pin_type;
int i; int i;
...@@ -3380,12 +3381,14 @@ static void init_multi_out(struct hda_codec *codec) ...@@ -3380,12 +3381,14 @@ static void init_multi_out(struct hda_codec *codec)
else else
pin_type = PIN_OUT; pin_type = PIN_OUT;
for (i = 0; i <= HDA_SIDE; i++) { for (i = 0; i < spec->autocfg.line_outs; i++) {
hda_nid_t nid = spec->autocfg.line_out_pins[i]; nid = spec->autocfg.line_out_pins[i];
if (nid) if (nid) {
set_output_and_unmute(codec, nid, pin_type, dac = spec->multiout.dac_nids[i];
spec->multiout.dac_nids[i]); if (!dac)
dac = spec->multiout.dac_nids[0];
set_output_and_unmute(codec, nid, pin_type, dac);
}
} }
} }
......
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