Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f889fa91ad47e6fcb530abf1184ca9f1473d3c72
Commit: f889fa91ad47e6fcb530abf1184ca9f1473d3c72
Parent: 69b1f1e8337fc94a7ea0730588960e82676dc2dc
Author: Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 31 15:49:32 2007 +0100
Committer: Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:29:15 2008 +0100
[ALSA] hda-codec - Improve the auto-configuration
Some small improvements on autocfg stuff:
- sort HP pins by sequence number, too
- move sole mic pin to AUTO_PIN_MIC instead of AUTO_PIN_FRONT_MIC
- ditto for line-in pin
Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
sound/pci/hda/hda_codec.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index dacabe5..39240e0 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2608,11 +2608,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec
*codec,
short seq, assoc_line_out, assoc_speaker;
short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)];
short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)];
+ short sequences_hp[ARRAY_SIZE(cfg->hp_pins)];
memset(cfg, 0, sizeof(*cfg));
memset(sequences_line_out, 0, sizeof(sequences_line_out));
memset(sequences_speaker, 0, sizeof(sequences_speaker));
+ memset(sequences_hp, 0, sizeof(sequences_hp));
assoc_line_out = assoc_speaker = 0;
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid_start);
@@ -2667,9 +2669,12 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
cfg->speaker_outs++;
break;
case AC_JACK_HP_OUT:
+ seq = get_defcfg_sequence(def_conf);
+ assoc = get_defcfg_association(def_conf);
if (cfg->hp_outs >= ARRAY_SIZE(cfg->hp_pins))
continue;
cfg->hp_pins[cfg->hp_outs] = nid;
+ sequences_hp[cfg->hp_outs] = (assoc << 4) | seq;
cfg->hp_outs++;
break;
case AC_JACK_MIC_IN: {
@@ -2713,7 +2718,24 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
cfg->line_outs);
sort_pins_by_sequence(cfg->speaker_pins, sequences_speaker,
cfg->speaker_outs);
+ sort_pins_by_sequence(cfg->hp_pins, sequences_hp,
+ cfg->hp_outs);
+ /* if we have only one mic, make it AUTO_PIN_MIC */
+ if (!cfg->input_pins[AUTO_PIN_MIC] &&
+ cfg->input_pins[AUTO_PIN_FRONT_MIC]) {
+ cfg->input_pins[AUTO_PIN_MIC] =
+ cfg->input_pins[AUTO_PIN_FRONT_MIC];
+ cfg->input_pins[AUTO_PIN_FRONT_MIC] = 0;
+ }
+ /* ditto for line-in */
+ if (!cfg->input_pins[AUTO_PIN_LINE] &&
+ cfg->input_pins[AUTO_PIN_FRONT_LINE]) {
+ cfg->input_pins[AUTO_PIN_LINE] =
+ cfg->input_pins[AUTO_PIN_FRONT_LINE];
+ cfg->input_pins[AUTO_PIN_FRONT_LINE] = 0;
+ }
+
/*
* FIX-UP: if no line-outs are detected, try to use speaker or HP pin
* as a primary output
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html