summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-05 14:08:45 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-10 10:34:26 +0100
commit6a84c305f03425bab09ffedb71be942ebc22454d (patch)
tree0ffcff11c000577e08d269d4c9430f24b10d90e5
parent065380f0880dd651eb405430745926dc4747b759 (diff)
ALSA: hda/realtek - Simplify alc_auto_is_dac_reachable()
Use the helper function snd_hda_get_conn_index() instead of open codes. This also improves the detection of some routes to DAC on ALC260 (although the difference doesn't influence on the end results of the mapping). Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f5196277b6e9..ca077402d6c0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2938,19 +2938,9 @@ static hda_nid_t alc_auto_look_for_dac(struct hda_codec *codec, hda_nid_t pin)
static bool alc_auto_is_dac_reachable(struct hda_codec *codec,
hda_nid_t pin, hda_nid_t dac)
{
- hda_nid_t srcs[5];
- int i, num;
-
if (!pin || !dac)
return false;
- pin = alc_go_down_to_selector(codec, pin);
- num = snd_hda_get_connections(codec, pin, srcs, ARRAY_SIZE(srcs));
- for (i = 0; i < num; i++) {
- hda_nid_t nid = alc_auto_mix_to_dac(codec, srcs[i]);
- if (nid == dac)
- return true;
- }
- return false;
+ return snd_hda_get_conn_index(codec, pin, dac, true) >= 0;
}
static hda_nid_t get_dac_if_single(struct hda_codec *codec, hda_nid_t pin)