diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-13 12:26:39 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-13 12:28:03 -0400 |
commit | f6100bb4b849c45caa8d6b3706756d3b8a560c92 (patch) | |
tree | e0c7f1e1ab7292d0cd7da26812c7cf6635ac1bc5 /sound | |
parent | 1f8458a26293b692955f8dff671a3ed50dd9c603 (diff) |
ALSA: hda - Clean up input-mux handling in Conexant auto-parser
Keep the registered input-pins in imux_pins[], and fix the inconsistent
use of sepc->auto_mic_ext.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 623cd9be5477..b575c9989f3c 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -75,7 +75,7 @@ struct conexant_spec { | |||
75 | unsigned int cur_eapd; | 75 | unsigned int cur_eapd; |
76 | unsigned int hp_present; | 76 | unsigned int hp_present; |
77 | unsigned int auto_mic; | 77 | unsigned int auto_mic; |
78 | int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ | 78 | int auto_mic_ext; /* imux_pins[] index for ext mic */ |
79 | unsigned int need_dac_fix; | 79 | unsigned int need_dac_fix; |
80 | hda_nid_t slave_dig_outs[2]; | 80 | hda_nid_t slave_dig_outs[2]; |
81 | 81 | ||
@@ -109,6 +109,7 @@ struct conexant_spec { | |||
109 | struct auto_pin_cfg autocfg; | 109 | struct auto_pin_cfg autocfg; |
110 | struct hda_input_mux private_imux; | 110 | struct hda_input_mux private_imux; |
111 | hda_nid_t imux_adcs[HDA_MAX_NUM_INPUTS]; | 111 | hda_nid_t imux_adcs[HDA_MAX_NUM_INPUTS]; |
112 | hda_nid_t imux_pins[HDA_MAX_NUM_INPUTS]; | ||
112 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; | 113 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; |
113 | struct pin_dac_pair dac_info[8]; | 114 | struct pin_dac_pair dac_info[8]; |
114 | int dac_info_filled; | 115 | int dac_info_filled; |
@@ -3509,12 +3510,11 @@ static const struct snd_kcontrol_new cx_auto_capture_mixers[] = { | |||
3509 | static void cx_auto_automic(struct hda_codec *codec) | 3510 | static void cx_auto_automic(struct hda_codec *codec) |
3510 | { | 3511 | { |
3511 | struct conexant_spec *spec = codec->spec; | 3512 | struct conexant_spec *spec = codec->spec; |
3512 | struct auto_pin_cfg *cfg = &spec->autocfg; | ||
3513 | int ext_idx = spec->auto_mic_ext; | 3513 | int ext_idx = spec->auto_mic_ext; |
3514 | 3514 | ||
3515 | if (!spec->auto_mic) | 3515 | if (!spec->auto_mic) |
3516 | return; | 3516 | return; |
3517 | if (snd_hda_jack_detect(codec, cfg->inputs[ext_idx].pin)) | 3517 | if (snd_hda_jack_detect(codec, spec->imux_pins[ext_idx])) |
3518 | cx_auto_mux_enum_update(codec, &spec->private_imux, ext_idx); | 3518 | cx_auto_mux_enum_update(codec, &spec->private_imux, ext_idx); |
3519 | else | 3519 | else |
3520 | cx_auto_mux_enum_update(codec, &spec->private_imux, !ext_idx); | 3520 | cx_auto_mux_enum_update(codec, &spec->private_imux, !ext_idx); |
@@ -3558,16 +3558,15 @@ static int is_ext_mic(struct hda_codec *codec, hda_nid_t pin) | |||
3558 | static void cx_auto_check_auto_mic(struct hda_codec *codec) | 3558 | static void cx_auto_check_auto_mic(struct hda_codec *codec) |
3559 | { | 3559 | { |
3560 | struct conexant_spec *spec = codec->spec; | 3560 | struct conexant_spec *spec = codec->spec; |
3561 | struct auto_pin_cfg *cfg = &spec->autocfg; | ||
3562 | 3561 | ||
3563 | if (is_ext_mic(codec, cfg->inputs[0].pin) && | 3562 | if (is_ext_mic(codec, spec->imux_pins[0]) && |
3564 | is_int_mic(codec, cfg->inputs[1].pin)) { | 3563 | is_int_mic(codec, spec->imux_pins[1])) { |
3565 | spec->auto_mic = 1; | 3564 | spec->auto_mic = 1; |
3566 | spec->auto_mic_ext = 0; | 3565 | spec->auto_mic_ext = 0; |
3567 | return; | 3566 | return; |
3568 | } | 3567 | } |
3569 | if (is_int_mic(codec, cfg->inputs[0].pin) && | 3568 | if (is_int_mic(codec, spec->imux_pins[0]) && |
3570 | is_ext_mic(codec, cfg->inputs[1].pin)) { | 3569 | is_ext_mic(codec, spec->imux_pins[1])) { |
3571 | spec->auto_mic = 1; | 3570 | spec->auto_mic = 1; |
3572 | spec->auto_mic_ext = 1; | 3571 | spec->auto_mic_ext = 1; |
3573 | return; | 3572 | return; |
@@ -3590,8 +3589,10 @@ static void cx_auto_parse_input(struct hda_codec *codec) | |||
3590 | if (idx >= 0) { | 3589 | if (idx >= 0) { |
3591 | const char *label; | 3590 | const char *label; |
3592 | label = hda_get_autocfg_input_label(codec, cfg, i); | 3591 | label = hda_get_autocfg_input_label(codec, cfg, i); |
3592 | spec->imux_adcs[imux->num_items] = adc; | ||
3593 | spec->imux_pins[imux->num_items] = | ||
3594 | cfg->inputs[i].pin; | ||
3593 | snd_hda_add_imux_item(imux, label, idx, NULL); | 3595 | snd_hda_add_imux_item(imux, label, idx, NULL); |
3594 | spec->imux_adcs[i] = adc; | ||
3595 | break; | 3596 | break; |
3596 | } | 3597 | } |
3597 | } | 3598 | } |