summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-02-16 17:23:46 +0100
committerTakashi Iwai <tiwai@suse.de>2012-02-16 17:29:24 +0100
commit140547ef4ee9ad5f9ee9e6546f6027e8737c4149 (patch)
tree4f74689ff511e7bf25a272981ab2aef187ea2aae
parent00bc0ce9130551ef193c3f5db0b7b6e70dff28ac (diff)
ALSA: hda/realtek - Improve the signel-connection check
When the connections from the pin selector contain only two widgets, a route to DAC and the aa-mixer, it's certainly a single connection. In such a case, get_dac_if_single() should return the connected DAC, too. This will improve the detection of the individual DAC assignment for each pin. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0ffccc17895..a5697c3b30b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2972,8 +2972,12 @@ static bool alc_auto_is_dac_reachable(struct hda_codec *codec,
static hda_nid_t get_dac_if_single(struct hda_codec *codec, hda_nid_t pin)
{
+ struct alc_spec *spec = codec->spec;
hda_nid_t sel = alc_go_down_to_selector(codec, pin);
- if (snd_hda_get_conn_list(codec, sel, NULL) == 1)
+ hda_nid_t srcs[5];
+ int num = snd_hda_get_connections(codec, sel, srcs,
+ ARRAY_SIZE(srcs));
+ if (num == 1 || (num == 2 && srcs[1] == spec->mixer_nid))
return alc_auto_look_for_dac(codec, pin);
return 0;
}