summaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-20 15:29:21 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:34:17 +0100
commit64049c81df38aa5f550cc0fae9c74c6bd5c31e58 (patch)
tree0f8afdab88991ba035e32282c012e71018375d6e /sound/pci/hda
parentdb23fd193d20e222449bdca71c4cc95dfadd6eaf (diff)
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_generic.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 96c779b6ca25..a133fcfd2fb4 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -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)
{
struct hda_gen_spec *spec = codec->spec;
+ hda_nid_t nid, dac;
int pin_type;
int i;
@@ -3380,12 +3381,14 @@ static void init_multi_out(struct hda_codec *codec)
else
pin_type = PIN_OUT;
- for (i = 0; i <= HDA_SIDE; i++) {
- hda_nid_t nid = spec->autocfg.line_out_pins[i];
- if (nid)
- set_output_and_unmute(codec, nid, pin_type,
- spec->multiout.dac_nids[i]);
-
+ for (i = 0; i < spec->autocfg.line_outs; i++) {
+ nid = spec->autocfg.line_out_pins[i];
+ if (nid) {
+ dac = spec->multiout.dac_nids[i];
+ if (!dac)
+ dac = spec->multiout.dac_nids[0];
+ set_output_and_unmute(codec, nid, pin_type, dac);
+ }
}
}