diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-12 18:30:12 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 12:00:10 +0200 |
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 ab3bb7997cd..af2c8943b30 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, } } + /* FIX-UP: + * If no line-out is defined but multiple HPs are found, + * some of them might be the real line-outs. + */ + if (!cfg->line_outs && cfg->hp_outs > 1) { + int i = 0; + while (i < cfg->hp_outs) { + /* The real HPs should have the sequence 0x0f */ + if ((sequences_hp[i] & 0x0f) == 0x0f) { + i++; + continue; + } + /* Move it to the line-out table */ + cfg->line_out_pins[cfg->line_outs] = cfg->hp_pins[i]; + sequences_line_out[cfg->line_outs] = sequences_hp[i]; + cfg->line_outs++; + cfg->hp_outs--; + memmove(cfg->hp_pins + i, cfg->hp_pins + i + 1, + sizeof(cfg->hp_pins[0]) * (cfg->hp_outs - i)); + memmove(sequences_hp + i - 1, sequences_hp + i, + sizeof(sequences_hp[0]) * (cfg->hp_outs - i)); + } + } + /* sort by sequence */ sort_pins_by_sequence(cfg->line_out_pins, sequences_line_out, cfg->line_outs); |