diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index ab3bb7997cd2..af2c8943b303 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2821,6 +2821,30 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
2821 | } | 2821 | } |
2822 | } | 2822 | } |
2823 | 2823 | ||
2824 | /* FIX-UP: | ||
2825 | * If no line-out is defined but multiple HPs are found, | ||
2826 | * some of them might be the real line-outs. | ||
2827 | */ | ||
2828 | if (!cfg->line_outs && cfg->hp_outs > 1) { | ||
2829 | int i = 0; | ||
2830 | while (i < cfg->hp_outs) { | ||
2831 | /* The real HPs should have the sequence 0x0f */ | ||
2832 | if ((sequences_hp[i] & 0x0f) == 0x0f) { | ||
2833 | i++; | ||
2834 | continue; | ||
2835 | } | ||
2836 | /* Move it to the line-out table */ | ||
2837 | cfg->line_out_pins[cfg->line_outs] = cfg->hp_pins[i]; | ||
2838 | sequences_line_out[cfg->line_outs] = sequences_hp[i]; | ||
2839 | cfg->line_outs++; | ||
2840 | cfg->hp_outs--; | ||
2841 | memmove(cfg->hp_pins + i, cfg->hp_pins + i + 1, | ||
2842 | sizeof(cfg->hp_pins[0]) * (cfg->hp_outs - i)); | ||
2843 | memmove(sequences_hp + i - 1, sequences_hp + i, | ||
2844 | sizeof(sequences_hp[0]) * (cfg->hp_outs - i)); | ||
2845 | } | ||
2846 | } | ||
2847 | |||
2824 | /* sort by sequence */ | 2848 | /* sort by sequence */ |
2825 | sort_pins_by_sequence(cfg->line_out_pins, sequences_line_out, | 2849 | sort_pins_by_sequence(cfg->line_out_pins, sequences_line_out, |
2826 | cfg->line_outs); | 2850 | cfg->line_outs); |