diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-07 03:06:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-07 03:06:00 -0400 |
commit | 489008cd58740fe3842822681d33bf87c07c3412 (patch) | |
tree | a14381ff2e78f3c1bfc50aa270f08e36ae8babb6 /sound/pci/hda | |
parent | 92ab7b8f38db35db05bd9c44412fff08ad594ad4 (diff) |
ALSA: hda - Fix ALC882 DAC connections in auto mode
Assign DACs properly to each output. Currently, the front output is bound
to HP/speaker outputs blindly, but they should be assigned to individual
DACs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c9c31c51863f..f4ca9b2d8784 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -10191,21 +10191,21 @@ static int alc882_auto_create_input_ctls(struct hda_codec *codec, | |||
10191 | 10191 | ||
10192 | static void alc882_auto_set_output_and_unmute(struct hda_codec *codec, | 10192 | static void alc882_auto_set_output_and_unmute(struct hda_codec *codec, |
10193 | hda_nid_t nid, int pin_type, | 10193 | hda_nid_t nid, int pin_type, |
10194 | int dac_idx) | 10194 | hda_nid_t dac) |
10195 | { | 10195 | { |
10196 | /* set as output */ | ||
10197 | struct alc_spec *spec = codec->spec; | ||
10198 | int idx; | 10196 | int idx; |
10199 | 10197 | ||
10198 | printk("XXX set output pin %x, dac %x\n", nid, dac); | ||
10199 | /* set as output */ | ||
10200 | alc_set_pin_output(codec, nid, pin_type); | 10200 | alc_set_pin_output(codec, nid, pin_type); |
10201 | if (dac_idx >= spec->multiout.num_dacs) | 10201 | |
10202 | return; | 10202 | if (dac == 0x25) |
10203 | if (spec->multiout.dac_nids[dac_idx] == 0x25) | ||
10204 | idx = 4; | 10203 | idx = 4; |
10204 | else if (dac >= 0x02 && dac <= 0x05) | ||
10205 | idx = dac - 2; | ||
10205 | else | 10206 | else |
10206 | idx = spec->multiout.dac_nids[dac_idx] - 2; | 10207 | return; |
10207 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx); | 10208 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx); |
10208 | |||
10209 | } | 10209 | } |
10210 | 10210 | ||
10211 | static void alc882_auto_init_multi_out(struct hda_codec *codec) | 10211 | static void alc882_auto_init_multi_out(struct hda_codec *codec) |
@@ -10218,22 +10218,29 @@ static void alc882_auto_init_multi_out(struct hda_codec *codec) | |||
10218 | int pin_type = get_pin_type(spec->autocfg.line_out_type); | 10218 | int pin_type = get_pin_type(spec->autocfg.line_out_type); |
10219 | if (nid) | 10219 | if (nid) |
10220 | alc882_auto_set_output_and_unmute(codec, nid, pin_type, | 10220 | alc882_auto_set_output_and_unmute(codec, nid, pin_type, |
10221 | i); | 10221 | spec->multiout.dac_nids[i]); |
10222 | } | 10222 | } |
10223 | } | 10223 | } |
10224 | 10224 | ||
10225 | static void alc882_auto_init_hp_out(struct hda_codec *codec) | 10225 | static void alc882_auto_init_hp_out(struct hda_codec *codec) |
10226 | { | 10226 | { |
10227 | struct alc_spec *spec = codec->spec; | 10227 | struct alc_spec *spec = codec->spec; |
10228 | hda_nid_t pin; | 10228 | hda_nid_t pin, dac; |
10229 | 10229 | ||
10230 | pin = spec->autocfg.hp_pins[0]; | 10230 | pin = spec->autocfg.hp_pins[0]; |
10231 | if (pin) /* connect to front */ | 10231 | if (pin) { |
10232 | /* use dac 0 */ | 10232 | dac = spec->multiout.hp_nid; |
10233 | alc882_auto_set_output_and_unmute(codec, pin, PIN_HP, 0); | 10233 | if (!dac) |
10234 | dac = spec->multiout.dac_nids[0]; /* to front */ | ||
10235 | alc882_auto_set_output_and_unmute(codec, pin, PIN_HP, dac); | ||
10236 | } | ||
10234 | pin = spec->autocfg.speaker_pins[0]; | 10237 | pin = spec->autocfg.speaker_pins[0]; |
10235 | if (pin) | 10238 | if (pin) { |
10236 | alc882_auto_set_output_and_unmute(codec, pin, PIN_OUT, 0); | 10239 | dac = spec->multiout.extra_out_nid[0]; |
10240 | if (!dac) | ||
10241 | dac = spec->multiout.dac_nids[0]; /* to front */ | ||
10242 | alc882_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac); | ||
10243 | } | ||
10237 | } | 10244 | } |
10238 | 10245 | ||
10239 | static void alc882_auto_init_analog_input(struct hda_codec *codec) | 10246 | static void alc882_auto_init_analog_input(struct hda_codec *codec) |
@@ -10349,15 +10356,15 @@ static int alc882_parse_auto_config(struct hda_codec *codec) | |||
10349 | err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg); | 10356 | err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg); |
10350 | if (err < 0) | 10357 | if (err < 0) |
10351 | return err; | 10358 | return err; |
10359 | err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0], | ||
10360 | "Headphone"); | ||
10361 | if (err < 0) | ||
10362 | return err; | ||
10352 | err = alc880_auto_create_extra_out(spec, | 10363 | err = alc880_auto_create_extra_out(spec, |
10353 | spec->autocfg.speaker_pins[0], | 10364 | spec->autocfg.speaker_pins[0], |
10354 | "Speaker"); | 10365 | "Speaker"); |
10355 | if (err < 0) | 10366 | if (err < 0) |
10356 | return err; | 10367 | return err; |
10357 | err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0], | ||
10358 | "Headphone"); | ||
10359 | if (err < 0) | ||
10360 | return err; | ||
10361 | err = alc882_auto_create_input_ctls(codec, &spec->autocfg); | 10368 | err = alc882_auto_create_input_ctls(codec, &spec->autocfg); |
10362 | if (err < 0) | 10369 | if (err < 0) |
10363 | return err; | 10370 | return err; |