diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-09 08:50:17 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:46:01 -0400 |
commit | 86e2959a10828dd2614e037fb2502bc833adca52 (patch) | |
tree | 4d5d2a60d23958d49ac8aebcb985b71d27305b01 /sound/pci/hda/patch_sigmatel.c | |
parent | b5786e85cb2ffd0b07e86dec38a442bd20765ad8 (diff) |
ALSA: hda - Remove AUTO_PIN_FRONT_{MIC|LINE}
We can assign multiple pins to a single role now, let's reduce the
redundant FRONT_MIC and FRONT_LINE. Also, autocfg->input_pins[] is
no longer used, so this is removed as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 852dae91edb1..d9c8b4d335d2 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -2834,7 +2834,7 @@ static hda_nid_t check_line_out_switch(struct hda_codec *codec) | |||
2834 | if (cfg->line_out_type != AUTO_PIN_LINE_OUT) | 2834 | if (cfg->line_out_type != AUTO_PIN_LINE_OUT) |
2835 | return 0; | 2835 | return 0; |
2836 | for (i = 0; i < cfg->num_inputs; i++) { | 2836 | for (i = 0; i < cfg->num_inputs; i++) { |
2837 | if (cfg->inputs[i].type == AUTO_PIN_LINE) { | 2837 | if (cfg->inputs[i].type == AUTO_PIN_LINE_IN) { |
2838 | nid = cfg->inputs[i].pin; | 2838 | nid = cfg->inputs[i].pin; |
2839 | pincap = snd_hda_query_pin_caps(codec, nid); | 2839 | pincap = snd_hda_query_pin_caps(codec, nid); |
2840 | if (pincap & AC_PINCAP_OUT) | 2840 | if (pincap & AC_PINCAP_OUT) |
@@ -2852,16 +2852,14 @@ static hda_nid_t check_mic_out_switch(struct hda_codec *codec, hda_nid_t *dac) | |||
2852 | struct sigmatel_spec *spec = codec->spec; | 2852 | struct sigmatel_spec *spec = codec->spec; |
2853 | struct auto_pin_cfg *cfg = &spec->autocfg; | 2853 | struct auto_pin_cfg *cfg = &spec->autocfg; |
2854 | unsigned int def_conf, pincap; | 2854 | unsigned int def_conf, pincap; |
2855 | int i, mic_type; | 2855 | int i; |
2856 | 2856 | ||
2857 | *dac = 0; | 2857 | *dac = 0; |
2858 | if (cfg->line_out_type != AUTO_PIN_LINE_OUT) | 2858 | if (cfg->line_out_type != AUTO_PIN_LINE_OUT) |
2859 | return 0; | 2859 | return 0; |
2860 | mic_type = AUTO_PIN_MIC; | ||
2861 | again: | ||
2862 | for (i = 0; i < cfg->num_inputs; i++) { | 2860 | for (i = 0; i < cfg->num_inputs; i++) { |
2863 | hda_nid_t nid = cfg->inputs[i].pin; | 2861 | hda_nid_t nid = cfg->inputs[i].pin; |
2864 | if (cfg->inputs[i].type != mic_type) | 2862 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
2865 | continue; | 2863 | continue; |
2866 | def_conf = snd_hda_codec_get_pincfg(codec, nid); | 2864 | def_conf = snd_hda_codec_get_pincfg(codec, nid); |
2867 | /* some laptops have an internal analog microphone | 2865 | /* some laptops have an internal analog microphone |
@@ -2875,10 +2873,6 @@ static hda_nid_t check_mic_out_switch(struct hda_codec *codec, hda_nid_t *dac) | |||
2875 | } | 2873 | } |
2876 | } | 2874 | } |
2877 | } | 2875 | } |
2878 | if (mic_type == AUTO_PIN_MIC) { | ||
2879 | mic_type = AUTO_PIN_FRONT_MIC; | ||
2880 | goto again; | ||
2881 | } | ||
2882 | return 0; | 2876 | return 0; |
2883 | } | 2877 | } |
2884 | 2878 | ||
@@ -3222,7 +3216,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, | |||
3222 | } | 3216 | } |
3223 | 3217 | ||
3224 | for (idx = 0; idx < cfg->num_inputs; idx++) { | 3218 | for (idx = 0; idx < cfg->num_inputs; idx++) { |
3225 | if (cfg->inputs[idx].type > AUTO_PIN_FRONT_LINE) | 3219 | if (cfg->inputs[idx].type > AUTO_PIN_LINE_IN) |
3226 | break; | 3220 | break; |
3227 | nid = cfg->inputs[idx].pin; | 3221 | nid = cfg->inputs[idx].pin; |
3228 | err = stac92xx_add_jack_mode_control(codec, nid, idx); | 3222 | err = stac92xx_add_jack_mode_control(codec, nid, idx); |
@@ -3621,7 +3615,7 @@ static int set_mic_route(struct hda_codec *codec, | |||
3621 | if (pin == cfg->inputs[i].pin) | 3615 | if (pin == cfg->inputs[i].pin) |
3622 | break; | 3616 | break; |
3623 | } | 3617 | } |
3624 | if (i < cfg->num_inputs && cfg->inputs[i].type <= AUTO_PIN_FRONT_MIC) { | 3618 | if (i < cfg->num_inputs && cfg->inputs[i].type == AUTO_PIN_MIC) { |
3625 | /* analog pin */ | 3619 | /* analog pin */ |
3626 | i = get_connection_index(codec, spec->mux_nids[0], pin); | 3620 | i = get_connection_index(codec, spec->mux_nids[0], pin); |
3627 | if (i < 0) | 3621 | if (i < 0) |
@@ -3656,7 +3650,7 @@ static int stac_check_auto_mic(struct hda_codec *codec) | |||
3656 | int i; | 3650 | int i; |
3657 | 3651 | ||
3658 | for (i = 0; i < cfg->num_inputs; i++) { | 3652 | for (i = 0; i < cfg->num_inputs; i++) { |
3659 | if (cfg->inputs[i].type >= AUTO_PIN_LINE) | 3653 | if (cfg->inputs[i].type >= AUTO_PIN_LINE_IN) |
3660 | return 0; /* must be exclusively mics */ | 3654 | return 0; /* must be exclusively mics */ |
3661 | } | 3655 | } |
3662 | fixed = ext = 0; | 3656 | fixed = ext = 0; |
@@ -4394,7 +4388,7 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4394 | hda_nid_t nid = cfg->inputs[i].pin; | 4388 | hda_nid_t nid = cfg->inputs[i].pin; |
4395 | int type = cfg->inputs[i].type; | 4389 | int type = cfg->inputs[i].type; |
4396 | unsigned int pinctl, conf; | 4390 | unsigned int pinctl, conf; |
4397 | if (type == AUTO_PIN_MIC || type == AUTO_PIN_FRONT_MIC) { | 4391 | if (type == AUTO_PIN_MIC) { |
4398 | /* for mic pins, force to initialize */ | 4392 | /* for mic pins, force to initialize */ |
4399 | pinctl = stac92xx_get_default_vref(codec, nid); | 4393 | pinctl = stac92xx_get_default_vref(codec, nid); |
4400 | pinctl |= AC_PINCTL_IN_EN; | 4394 | pinctl |= AC_PINCTL_IN_EN; |