diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-12 12:30:12 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:10 -0400 |
commit | 5832fcf8b55cfdbd7d8511f747d15fd20ed4703d (patch) | |
tree | 0231e6c86839c5ec14e5c017bab1f753b10538b4 /sound/pci/hda/hda_codec.c | |
parent | 5d5d5f43f1b835c375de9bd270cce030d16e2871 (diff) |
[ALSA] hda-codec - More fix-up for auto-configuration
In some cases, the BIOS sets up only the HP pins with different assoc
and sequence numbers, e.g. on FSC Esprimo with ALC262.
This patch adds a fix-up for such a case. When multiple HPs are defined
and no line-outs is found, the configurator tries to re-assign some pins
from HP list to line-out, judging from the sequence number.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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); |