diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_auto_parser.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index a4810c7437bd..0088bb0b04de 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c | |||
@@ -583,6 +583,9 @@ static int fill_audio_out_name(struct hda_codec *codec, hda_nid_t nid, | |||
583 | return 1; | 583 | return 1; |
584 | } | 584 | } |
585 | 585 | ||
586 | #define is_hdmi_cfg(conf) \ | ||
587 | (get_defcfg_location(conf) == AC_JACK_LOC_HDMI) | ||
588 | |||
586 | /** | 589 | /** |
587 | * snd_hda_get_pin_label - Get a label for the given I/O pin | 590 | * snd_hda_get_pin_label - Get a label for the given I/O pin |
588 | * | 591 | * |
@@ -603,6 +606,7 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid, | |||
603 | unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); | 606 | unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); |
604 | const char *name = NULL; | 607 | const char *name = NULL; |
605 | int i; | 608 | int i; |
609 | bool hdmi; | ||
606 | 610 | ||
607 | if (indexp) | 611 | if (indexp) |
608 | *indexp = 0; | 612 | *indexp = 0; |
@@ -621,16 +625,18 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid, | |||
621 | label, maxlen, indexp); | 625 | label, maxlen, indexp); |
622 | case AC_JACK_SPDIF_OUT: | 626 | case AC_JACK_SPDIF_OUT: |
623 | case AC_JACK_DIG_OTHER_OUT: | 627 | case AC_JACK_DIG_OTHER_OUT: |
624 | if (get_defcfg_location(def_conf) == AC_JACK_LOC_HDMI) | 628 | hdmi = is_hdmi_cfg(def_conf); |
625 | name = "HDMI"; | 629 | name = hdmi ? "HDMI" : "SPDIF"; |
626 | else | 630 | if (cfg && indexp) |
627 | name = "SPDIF"; | 631 | for (i = 0; i < cfg->dig_outs; i++) { |
628 | if (cfg && indexp) { | 632 | hda_nid_t pin = cfg->dig_out_pins[i]; |
629 | i = find_idx_in_nid_list(nid, cfg->dig_out_pins, | 633 | unsigned int c; |
630 | cfg->dig_outs); | 634 | if (pin == nid) |
631 | if (i >= 0) | 635 | break; |
632 | *indexp = i; | 636 | c = snd_hda_codec_get_pincfg(codec, pin); |
633 | } | 637 | if (hdmi == is_hdmi_cfg(c)) |
638 | (*indexp)++; | ||
639 | } | ||
634 | break; | 640 | break; |
635 | default: | 641 | default: |
636 | if (cfg) { | 642 | if (cfg) { |