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 | |
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')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 50 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 20 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 16 |
7 files changed, 31 insertions, 78 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 4348c33c6b85..0ee4439c68ca 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4396,7 +4396,7 @@ static void add_auto_cfg_input_pin(struct auto_pin_cfg *cfg, hda_nid_t nid, | |||
4396 | * output, i.e. to line_out_pins[0]. So, line_outs is always positive | 4396 | * output, i.e. to line_out_pins[0]. So, line_outs is always positive |
4397 | * if any analog output exists. | 4397 | * if any analog output exists. |
4398 | * | 4398 | * |
4399 | * The analog input pins are assigned to input_pins array. | 4399 | * The analog input pins are assigned to inputs array. |
4400 | * The digital input/output pins are assigned to dig_in_pin and dig_out_pin, | 4400 | * The digital input/output pins are assigned to dig_in_pin and dig_out_pin, |
4401 | * respectively. | 4401 | * respectively. |
4402 | */ | 4402 | */ |
@@ -4480,39 +4480,16 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
4480 | sequences_hp[cfg->hp_outs] = (assoc << 4) | seq; | 4480 | sequences_hp[cfg->hp_outs] = (assoc << 4) | seq; |
4481 | cfg->hp_outs++; | 4481 | cfg->hp_outs++; |
4482 | break; | 4482 | break; |
4483 | case AC_JACK_MIC_IN: { | 4483 | case AC_JACK_MIC_IN: |
4484 | int preferred, alt; | 4484 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_MIC); |
4485 | if (loc == AC_JACK_LOC_FRONT || | ||
4486 | (loc & 0x30) == AC_JACK_LOC_INTERNAL) { | ||
4487 | preferred = AUTO_PIN_FRONT_MIC; | ||
4488 | alt = AUTO_PIN_MIC; | ||
4489 | } else { | ||
4490 | preferred = AUTO_PIN_MIC; | ||
4491 | alt = AUTO_PIN_FRONT_MIC; | ||
4492 | } | ||
4493 | if (!cfg->input_pins[preferred]) | ||
4494 | cfg->input_pins[preferred] = nid; | ||
4495 | else if (!cfg->input_pins[alt]) | ||
4496 | cfg->input_pins[alt] = nid; | ||
4497 | add_auto_cfg_input_pin(cfg, nid, preferred); | ||
4498 | break; | 4485 | break; |
4499 | } | 4486 | case AC_JACK_LINE_IN: |
4500 | case AC_JACK_LINE_IN: { | 4487 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_LINE_IN); |
4501 | int type; | ||
4502 | if (loc == AC_JACK_LOC_FRONT) | ||
4503 | type = AUTO_PIN_FRONT_LINE; | ||
4504 | else | ||
4505 | type = AUTO_PIN_LINE; | ||
4506 | cfg->input_pins[type] = nid; | ||
4507 | add_auto_cfg_input_pin(cfg, nid, type); | ||
4508 | break; | 4488 | break; |
4509 | } | ||
4510 | case AC_JACK_CD: | 4489 | case AC_JACK_CD: |
4511 | cfg->input_pins[AUTO_PIN_CD] = nid; | ||
4512 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_CD); | 4490 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_CD); |
4513 | break; | 4491 | break; |
4514 | case AC_JACK_AUX: | 4492 | case AC_JACK_AUX: |
4515 | cfg->input_pins[AUTO_PIN_AUX] = nid; | ||
4516 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_AUX); | 4493 | add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_AUX); |
4517 | break; | 4494 | break; |
4518 | case AC_JACK_SPDIF_OUT: | 4495 | case AC_JACK_SPDIF_OUT: |
@@ -4570,21 +4547,6 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
4570 | sort_pins_by_sequence(cfg->hp_pins, sequences_hp, | 4547 | sort_pins_by_sequence(cfg->hp_pins, sequences_hp, |
4571 | cfg->hp_outs); | 4548 | cfg->hp_outs); |
4572 | 4549 | ||
4573 | /* if we have only one mic, make it AUTO_PIN_MIC */ | ||
4574 | if (!cfg->input_pins[AUTO_PIN_MIC] && | ||
4575 | cfg->input_pins[AUTO_PIN_FRONT_MIC]) { | ||
4576 | cfg->input_pins[AUTO_PIN_MIC] = | ||
4577 | cfg->input_pins[AUTO_PIN_FRONT_MIC]; | ||
4578 | cfg->input_pins[AUTO_PIN_FRONT_MIC] = 0; | ||
4579 | } | ||
4580 | /* ditto for line-in */ | ||
4581 | if (!cfg->input_pins[AUTO_PIN_LINE] && | ||
4582 | cfg->input_pins[AUTO_PIN_FRONT_LINE]) { | ||
4583 | cfg->input_pins[AUTO_PIN_LINE] = | ||
4584 | cfg->input_pins[AUTO_PIN_FRONT_LINE]; | ||
4585 | cfg->input_pins[AUTO_PIN_FRONT_LINE] = 0; | ||
4586 | } | ||
4587 | |||
4588 | /* | 4550 | /* |
4589 | * FIX-UP: if no line-outs are detected, try to use speaker or HP pin | 4551 | * FIX-UP: if no line-outs are detected, try to use speaker or HP pin |
4590 | * as a primary output | 4552 | * as a primary output |
@@ -4658,7 +4620,7 @@ EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config); | |||
4658 | 4620 | ||
4659 | /* labels for input pins - for obsoleted config stuff */ | 4621 | /* labels for input pins - for obsoleted config stuff */ |
4660 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { | 4622 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { |
4661 | "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" | 4623 | "Mic", "Line", "CD", "Aux" |
4662 | }; | 4624 | }; |
4663 | EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); | 4625 | EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); |
4664 | 4626 | ||
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index b448b0a997b1..72e7b2f210ee 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -366,9 +366,7 @@ struct hda_bus_unsolicited { | |||
366 | 366 | ||
367 | enum { | 367 | enum { |
368 | AUTO_PIN_MIC, | 368 | AUTO_PIN_MIC, |
369 | AUTO_PIN_FRONT_MIC, | 369 | AUTO_PIN_LINE_IN, |
370 | AUTO_PIN_LINE, | ||
371 | AUTO_PIN_FRONT_LINE, | ||
372 | AUTO_PIN_CD, | 370 | AUTO_PIN_CD, |
373 | AUTO_PIN_AUX, | 371 | AUTO_PIN_AUX, |
374 | AUTO_PIN_LAST | 372 | AUTO_PIN_LAST |
@@ -403,7 +401,6 @@ struct auto_pin_cfg { | |||
403 | int hp_outs; | 401 | int hp_outs; |
404 | int line_out_type; /* AUTO_PIN_XXX_OUT */ | 402 | int line_out_type; /* AUTO_PIN_XXX_OUT */ |
405 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; | 403 | hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; |
406 | hda_nid_t input_pins[AUTO_PIN_LAST]; /* old config; to be deprecated */ | ||
407 | int num_inputs; | 404 | int num_inputs; |
408 | struct auto_pin_cfg_item inputs[AUTO_CFG_MAX_INS]; | 405 | struct auto_pin_cfg_item inputs[AUTO_CFG_MAX_INS]; |
409 | int dig_outs; | 406 | int dig_outs; |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 8de3a0dc45e4..85fc0b954603 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -2923,7 +2923,7 @@ static int ad1988_auto_create_analog_input_ctls(struct ad198x_spec *spec, | |||
2923 | type_idx = 0; | 2923 | type_idx = 0; |
2924 | err = new_analog_input(spec, cfg->inputs[i].pin, | 2924 | err = new_analog_input(spec, cfg->inputs[i].pin, |
2925 | auto_pin_cfg_labels[type], type_idx, | 2925 | auto_pin_cfg_labels[type], type_idx, |
2926 | type <= AUTO_PIN_FRONT_MIC); | 2926 | type == AUTO_PIN_MIC); |
2927 | if (err < 0) | 2927 | if (err < 0) |
2928 | return err; | 2928 | return err; |
2929 | snd_hda_get_input_pin_label(cfg, i, | 2929 | snd_hda_get_input_pin_label(cfg, i, |
@@ -3015,7 +3015,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) | |||
3015 | break; | 3015 | break; |
3016 | } | 3016 | } |
3017 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 3017 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
3018 | i <= AUTO_PIN_FRONT_MIC ? PIN_VREF80 : PIN_IN); | 3018 | i == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); |
3019 | if (nid != AD1988_PIN_CD_NID) | 3019 | if (nid != AD1988_PIN_CD_NID) |
3020 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 3020 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
3021 | AMP_OUT_MUTE); | 3021 | AMP_OUT_MUTE); |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 6adfc5625281..adb5ec50252a 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -436,8 +436,8 @@ static int parse_input(struct hda_codec *codec) | |||
436 | 436 | ||
437 | /* check whether the automatic mic switch is available */ | 437 | /* check whether the automatic mic switch is available */ |
438 | if (spec->num_inputs == 2 && | 438 | if (spec->num_inputs == 2 && |
439 | cfg->inputs[0].type <= AUTO_PIN_FRONT_MIC && | 439 | cfg->inputs[0].type == AUTO_PIN_MIC && |
440 | cfg->inputs[1].type == AUTO_PIN_FRONT_MIC) { | 440 | cfg->inputs[1].type == AUTO_PIN_MIC) { |
441 | if (is_ext_mic(codec, cfg->inputs[0].pin)) { | 441 | if (is_ext_mic(codec, cfg->inputs[0].pin)) { |
442 | if (!is_ext_mic(codec, cfg->inputs[1].pin)) { | 442 | if (!is_ext_mic(codec, cfg->inputs[1].pin)) { |
443 | spec->mic_detect = 1; | 443 | spec->mic_detect = 1; |
@@ -921,7 +921,7 @@ static void init_input(struct hda_codec *codec) | |||
921 | continue; | 921 | continue; |
922 | /* set appropriate pin control and mute first */ | 922 | /* set appropriate pin control and mute first */ |
923 | ctl = PIN_IN; | 923 | ctl = PIN_IN; |
924 | if (cfg->inputs[i].type <= AUTO_PIN_FRONT_MIC) { | 924 | if (cfg->inputs[i].type == AUTO_PIN_MIC) { |
925 | unsigned int caps = snd_hda_query_pin_caps(codec, pin); | 925 | unsigned int caps = snd_hda_query_pin_caps(codec, pin); |
926 | caps >>= AC_PINCAP_VREF_SHIFT; | 926 | caps >>= AC_PINCAP_VREF_SHIFT; |
927 | if (caps & AC_PINCAP_VREF_80) | 927 | if (caps & AC_PINCAP_VREF_80) |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0a7d9d5ea40e..8ae30ccf537a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -846,7 +846,7 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid, | |||
846 | { | 846 | { |
847 | unsigned int val = PIN_IN; | 847 | unsigned int val = PIN_IN; |
848 | 848 | ||
849 | if (auto_pin_type <= AUTO_PIN_FRONT_MIC) { | 849 | if (auto_pin_type == AUTO_PIN_MIC) { |
850 | unsigned int pincap; | 850 | unsigned int pincap; |
851 | unsigned int oldval; | 851 | unsigned int oldval; |
852 | oldval = snd_hda_codec_read(codec, nid, 0, | 852 | oldval = snd_hda_codec_read(codec, nid, 0, |
@@ -1298,7 +1298,7 @@ static void alc_init_auto_mic(struct hda_codec *codec) | |||
1298 | 1298 | ||
1299 | /* there must be only two mic inputs exclusively */ | 1299 | /* there must be only two mic inputs exclusively */ |
1300 | for (i = 0; i < cfg->num_inputs; i++) | 1300 | for (i = 0; i < cfg->num_inputs; i++) |
1301 | if (cfg->inputs[i].type >= AUTO_PIN_LINE) | 1301 | if (cfg->inputs[i].type >= AUTO_PIN_LINE_IN) |
1302 | return; | 1302 | return; |
1303 | 1303 | ||
1304 | fixed = ext = 0; | 1304 | fixed = ext = 0; |
@@ -10622,7 +10622,7 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
10622 | hda_nid_t nid; | 10622 | hda_nid_t nid; |
10623 | 10623 | ||
10624 | for (i = 0; i < cfg->num_inputs; i++) { | 10624 | for (i = 0; i < cfg->num_inputs; i++) { |
10625 | if (cfg->inputs[i].type > AUTO_PIN_FRONT_MIC) | 10625 | if (cfg->inputs[i].type > AUTO_PIN_MIC) |
10626 | break; | 10626 | break; |
10627 | nid = cfg->inputs[i].pin; | 10627 | nid = cfg->inputs[i].pin; |
10628 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { | 10628 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { |
@@ -19270,7 +19270,7 @@ static void alc680_base_setup(struct hda_codec *codec) | |||
19270 | spec->autocfg.inputs[0].pin = 0x18; | 19270 | spec->autocfg.inputs[0].pin = 0x18; |
19271 | spec->autocfg.inputs[0].type = AUTO_PIN_MIC; | 19271 | spec->autocfg.inputs[0].type = AUTO_PIN_MIC; |
19272 | spec->autocfg.inputs[1].pin = 0x19; | 19272 | spec->autocfg.inputs[1].pin = 0x19; |
19273 | spec->autocfg.inputs[1].type = AUTO_PIN_LINE; | 19273 | spec->autocfg.inputs[1].type = AUTO_PIN_LINE_IN; |
19274 | } | 19274 | } |
19275 | 19275 | ||
19276 | static void alc680_unsol_event(struct hda_codec *codec, | 19276 | static void alc680_unsol_event(struct hda_codec *codec, |
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; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 9c1909d398e3..de5f61d1b725 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -568,7 +568,7 @@ static void via_auto_init_analog_input(struct hda_codec *codec) | |||
568 | hda_nid_t nid = cfg->inputs[i].pin; | 568 | hda_nid_t nid = cfg->inputs[i].pin; |
569 | if (spec->smart51_enabled && is_smart51_pins(spec, nid)) | 569 | if (spec->smart51_enabled && is_smart51_pins(spec, nid)) |
570 | ctl = PIN_OUT; | 570 | ctl = PIN_OUT; |
571 | else if (i <= AUTO_PIN_FRONT_MIC) | 571 | else if (i == AUTO_PIN_MIC) |
572 | ctl = PIN_VREF50; | 572 | ctl = PIN_VREF50; |
573 | else | 573 | else |
574 | ctl = PIN_IN; | 574 | ctl = PIN_IN; |
@@ -1328,7 +1328,7 @@ static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin) | |||
1328 | 1328 | ||
1329 | for (i = 0; i < cfg->num_inputs; i++) { | 1329 | for (i = 0; i < cfg->num_inputs; i++) { |
1330 | if (pin == cfg->inputs[i].pin) | 1330 | if (pin == cfg->inputs[i].pin) |
1331 | return cfg->inputs[i].type < AUTO_PIN_FRONT_LINE; | 1331 | return cfg->inputs[i].type <= AUTO_PIN_LINE_IN; |
1332 | } | 1332 | } |
1333 | return 0; | 1333 | return 0; |
1334 | } | 1334 | } |
@@ -1356,9 +1356,9 @@ static int via_smart51_get(struct snd_kcontrol *kcontrol, | |||
1356 | hda_nid_t nid = cfg->inputs[i].pin; | 1356 | hda_nid_t nid = cfg->inputs[i].pin; |
1357 | int ctl = snd_hda_codec_read(codec, nid, 0, | 1357 | int ctl = snd_hda_codec_read(codec, nid, 0, |
1358 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); | 1358 | AC_VERB_GET_PIN_WIDGET_CONTROL, 0); |
1359 | if (cfg->inputs[i].type >= AUTO_PIN_FRONT_LINE) | 1359 | if (cfg->inputs[i].type > AUTO_PIN_LINE_IN) |
1360 | continue; | 1360 | continue; |
1361 | if (cfg->inputs[i].type == AUTO_PIN_FRONT_MIC && | 1361 | if (cfg->inputs[i].type == AUTO_PIN_MIC && |
1362 | spec->hp_independent_mode && spec->codec_type != VT1718S) | 1362 | spec->hp_independent_mode && spec->codec_type != VT1718S) |
1363 | continue; /* ignore FMic for independent HP */ | 1363 | continue; /* ignore FMic for independent HP */ |
1364 | if ((ctl & AC_PINCTL_IN_EN) && !(ctl & AC_PINCTL_OUT_EN)) | 1364 | if ((ctl & AC_PINCTL_IN_EN) && !(ctl & AC_PINCTL_OUT_EN)) |
@@ -1382,9 +1382,9 @@ static int via_smart51_put(struct snd_kcontrol *kcontrol, | |||
1382 | hda_nid_t nid = cfg->inputs[i].pin; | 1382 | hda_nid_t nid = cfg->inputs[i].pin; |
1383 | unsigned int parm; | 1383 | unsigned int parm; |
1384 | 1384 | ||
1385 | if (cfg->inputs[i].type >= AUTO_PIN_FRONT_LINE) | 1385 | if (cfg->inputs[i].type > AUTO_PIN_LINE_IN) |
1386 | continue; | 1386 | continue; |
1387 | if (cfg->inputs[i].type == AUTO_PIN_FRONT_MIC && | 1387 | if (cfg->inputs[i].type == AUTO_PIN_MIC && |
1388 | spec->hp_independent_mode && spec->codec_type != VT1718S) | 1388 | spec->hp_independent_mode && spec->codec_type != VT1718S) |
1389 | continue; /* don't retask FMic for independent HP */ | 1389 | continue; /* don't retask FMic for independent HP */ |
1390 | 1390 | ||
@@ -1404,7 +1404,7 @@ static int via_smart51_put(struct snd_kcontrol *kcontrol, | |||
1404 | codec, nid, HDA_OUTPUT, 0, HDA_AMP_MUTE, | 1404 | codec, nid, HDA_OUTPUT, 0, HDA_AMP_MUTE, |
1405 | HDA_AMP_UNMUTE); | 1405 | HDA_AMP_UNMUTE); |
1406 | } | 1406 | } |
1407 | if (cfg->inputs[i].type == AUTO_PIN_FRONT_MIC) { | 1407 | if (cfg->inputs[i].type == AUTO_PIN_MIC) { |
1408 | if (spec->codec_type == VT1708S | 1408 | if (spec->codec_type == VT1708S |
1409 | || spec->codec_type == VT1716S) { | 1409 | || spec->codec_type == VT1716S) { |
1410 | /* input = index 1 (AOW3) */ | 1410 | /* input = index 1 (AOW3) */ |
@@ -1450,7 +1450,7 @@ static int via_smart51_build(struct via_spec *spec) | |||
1450 | 1450 | ||
1451 | for (i = 0; i < cfg->num_inputs; i++) { | 1451 | for (i = 0; i < cfg->num_inputs; i++) { |
1452 | nid = cfg->inputs[i].pin; | 1452 | nid = cfg->inputs[i].pin; |
1453 | if (cfg->inputs[i].type < AUTO_PIN_FRONT_LINE) { | 1453 | if (cfg->inputs[i].type <= AUTO_PIN_LINE_IN) { |
1454 | knew = via_clone_control(spec, &via_smart51_mixer[1]); | 1454 | knew = via_clone_control(spec, &via_smart51_mixer[1]); |
1455 | if (knew == NULL) | 1455 | if (knew == NULL) |
1456 | return -ENOMEM; | 1456 | return -ENOMEM; |