aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/Kconfig9
-rw-r--r--sound/pci/hda/patch_analog.c128
-rw-r--r--sound/pci/hda/patch_conexant.c4
-rw-r--r--sound/pci/hda/patch_realtek.c155
-rw-r--r--sound/pci/hda/patch_sigmatel.c10
5 files changed, 179 insertions, 127 deletions
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index c710150d5065..04438f1d682d 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -2,7 +2,6 @@ menuconfig SND_HDA_INTEL
2 tristate "Intel HD Audio" 2 tristate "Intel HD Audio"
3 select SND_PCM 3 select SND_PCM
4 select SND_VMASTER 4 select SND_VMASTER
5 select SND_JACK if INPUT=y || INPUT=SND
6 help 5 help
7 Say Y here to include support for Intel "High Definition 6 Say Y here to include support for Intel "High Definition
8 Audio" (Azalia) and its compatible devices. 7 Audio" (Azalia) and its compatible devices.
@@ -39,6 +38,14 @@ config SND_HDA_INPUT_BEEP
39 Say Y here to build a digital beep interface for HD-audio 38 Say Y here to build a digital beep interface for HD-audio
40 driver. This interface is used to generate digital beeps. 39 driver. This interface is used to generate digital beeps.
41 40
41config SND_HDA_INPUT_JACK
42 bool "Support jack plugging notification via input layer"
43 depends on INPUT=y || INPUT=SND_HDA_INTEL
44 select SND_JACK
45 help
46 Say Y here to enable the jack plugging notification via
47 input layer.
48
42config SND_HDA_CODEC_REALTEK 49config SND_HDA_CODEC_REALTEK
43 bool "Build Realtek HD-audio codec support" 50 bool "Build Realtek HD-audio codec support"
44 default y 51 default y
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 84cc49ca9148..1988582d1ab8 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,6 +72,7 @@ struct ad198x_spec {
72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
73 73
74 unsigned int jack_present :1; 74 unsigned int jack_present :1;
75 unsigned int inv_jack_detect:1;
75 76
76#ifdef CONFIG_SND_HDA_POWER_SAVE 77#ifdef CONFIG_SND_HDA_POWER_SAVE
77 struct hda_loopback_check loopback; 78 struct hda_loopback_check loopback;
@@ -669,39 +670,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = {
669 }, 670 },
670}; 671};
671 672
672static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { 673static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = {
673 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 674 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
674 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), 675 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
675 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
676 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
677 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
678 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
679 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
680 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
681 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
682 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
683 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
684 {
685 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
686 .name = "Capture Source",
687 .info = ad198x_mux_enum_info,
688 .get = ad198x_mux_enum_get,
689 .put = ad198x_mux_enum_put,
690 },
691 {
692 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
693 .name = "External Amplifier",
694 .info = ad198x_eapd_info,
695 .get = ad198x_eapd_get,
696 .put = ad198x_eapd_put,
697 .private_value = 0x1b | (1 << 8), /* port-D, inversed */
698 },
699 { } /* end */ 676 { } /* end */
700}; 677};
701 678
702static struct snd_kcontrol_new ad1986a_samsung_mixers[] = { 679static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
703 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
704 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
705 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), 680 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
706 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), 681 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
707 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 682 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
@@ -727,6 +702,12 @@ static struct snd_kcontrol_new ad1986a_samsung_mixers[] = {
727 { } /* end */ 702 { } /* end */
728}; 703};
729 704
705static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = {
706 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
707 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
708 { } /* end */
709};
710
730/* re-connect the mic boost input according to the jack sensing */ 711/* re-connect the mic boost input according to the jack sensing */
731static void ad1986a_automic(struct hda_codec *codec) 712static void ad1986a_automic(struct hda_codec *codec)
732{ 713{
@@ -776,8 +757,9 @@ static void ad1986a_hp_automute(struct hda_codec *codec)
776 unsigned int present; 757 unsigned int present;
777 758
778 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); 759 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
779 /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */ 760 spec->jack_present = !!(present & 0x80000000);
780 spec->jack_present = !(present & 0x80000000); 761 if (spec->inv_jack_detect)
762 spec->jack_present = !spec->jack_present;
781 ad1986a_update_hp(codec); 763 ad1986a_update_hp(codec);
782} 764}
783 765
@@ -816,7 +798,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol,
816 return change; 798 return change;
817} 799}
818 800
819static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = { 801static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
820 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 802 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
821 { 803 {
822 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 804 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -826,33 +808,10 @@ static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = {
826 .put = ad1986a_hp_master_sw_put, 808 .put = ad1986a_hp_master_sw_put,
827 .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), 809 .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
828 }, 810 },
829 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
830 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
831 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
832 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
833 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
834 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
835 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
836 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
837 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
838 {
839 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
840 .name = "Capture Source",
841 .info = ad198x_mux_enum_info,
842 .get = ad198x_mux_enum_get,
843 .put = ad198x_mux_enum_put,
844 },
845 {
846 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
847 .name = "External Amplifier",
848 .info = ad198x_eapd_info,
849 .get = ad198x_eapd_get,
850 .put = ad198x_eapd_put,
851 .private_value = 0x1b | (1 << 8), /* port-D, inversed */
852 },
853 { } /* end */ 811 { } /* end */
854}; 812};
855 813
814
856/* 815/*
857 * initialization verbs 816 * initialization verbs
858 */ 817 */
@@ -981,6 +940,27 @@ static struct hda_verb ad1986a_hp_init_verbs[] = {
981 {} 940 {}
982}; 941};
983 942
943static void ad1986a_samsung_p50_unsol_event(struct hda_codec *codec,
944 unsigned int res)
945{
946 switch (res >> 26) {
947 case AD1986A_HP_EVENT:
948 ad1986a_hp_automute(codec);
949 break;
950 case AD1986A_MIC_EVENT:
951 ad1986a_automic(codec);
952 break;
953 }
954}
955
956static int ad1986a_samsung_p50_init(struct hda_codec *codec)
957{
958 ad198x_init(codec);
959 ad1986a_hp_automute(codec);
960 ad1986a_automic(codec);
961 return 0;
962}
963
984 964
985/* models */ 965/* models */
986enum { 966enum {
@@ -991,6 +971,7 @@ enum {
991 AD1986A_LAPTOP_AUTOMUTE, 971 AD1986A_LAPTOP_AUTOMUTE,
992 AD1986A_ULTRA, 972 AD1986A_ULTRA,
993 AD1986A_SAMSUNG, 973 AD1986A_SAMSUNG,
974 AD1986A_SAMSUNG_P50,
994 AD1986A_MODELS 975 AD1986A_MODELS
995}; 976};
996 977
@@ -1002,6 +983,7 @@ static const char *ad1986a_models[AD1986A_MODELS] = {
1002 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute", 983 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
1003 [AD1986A_ULTRA] = "ultra", 984 [AD1986A_ULTRA] = "ultra",
1004 [AD1986A_SAMSUNG] = "samsung", 985 [AD1986A_SAMSUNG] = "samsung",
986 [AD1986A_SAMSUNG_P50] = "samsung-p50",
1005}; 987};
1006 988
1007static struct snd_pci_quirk ad1986a_cfg_tbl[] = { 989static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
@@ -1024,6 +1006,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1024 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), 1006 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
1025 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 1007 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
1026 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 1008 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
1009 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
1027 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), 1010 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
1028 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG), 1011 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG),
1029 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), 1012 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
@@ -1111,7 +1094,10 @@ static int patch_ad1986a(struct hda_codec *codec)
1111 spec->multiout.dac_nids = ad1986a_laptop_dac_nids; 1094 spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1112 break; 1095 break;
1113 case AD1986A_LAPTOP_EAPD: 1096 case AD1986A_LAPTOP_EAPD:
1114 spec->mixers[0] = ad1986a_laptop_eapd_mixers; 1097 spec->num_mixers = 3;
1098 spec->mixers[0] = ad1986a_laptop_master_mixers;
1099 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1100 spec->mixers[2] = ad1986a_laptop_intmic_mixers;
1115 spec->num_init_verbs = 2; 1101 spec->num_init_verbs = 2;
1116 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1102 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1117 spec->multiout.max_channels = 2; 1103 spec->multiout.max_channels = 2;
@@ -1122,7 +1108,9 @@ static int patch_ad1986a(struct hda_codec *codec)
1122 spec->input_mux = &ad1986a_laptop_eapd_capture_source; 1108 spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1123 break; 1109 break;
1124 case AD1986A_SAMSUNG: 1110 case AD1986A_SAMSUNG:
1125 spec->mixers[0] = ad1986a_samsung_mixers; 1111 spec->num_mixers = 2;
1112 spec->mixers[0] = ad1986a_laptop_master_mixers;
1113 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1126 spec->num_init_verbs = 3; 1114 spec->num_init_verbs = 3;
1127 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1115 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1128 spec->init_verbs[2] = ad1986a_automic_verbs; 1116 spec->init_verbs[2] = ad1986a_automic_verbs;
@@ -1135,8 +1123,28 @@ static int patch_ad1986a(struct hda_codec *codec)
1135 codec->patch_ops.unsol_event = ad1986a_automic_unsol_event; 1123 codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
1136 codec->patch_ops.init = ad1986a_automic_init; 1124 codec->patch_ops.init = ad1986a_automic_init;
1137 break; 1125 break;
1126 case AD1986A_SAMSUNG_P50:
1127 spec->num_mixers = 2;
1128 spec->mixers[0] = ad1986a_automute_master_mixers;
1129 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1130 spec->num_init_verbs = 4;
1131 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1132 spec->init_verbs[2] = ad1986a_automic_verbs;
1133 spec->init_verbs[3] = ad1986a_hp_init_verbs;
1134 spec->multiout.max_channels = 2;
1135 spec->multiout.num_dacs = 1;
1136 spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1137 if (!is_jack_available(codec, 0x25))
1138 spec->multiout.dig_out_nid = 0;
1139 spec->input_mux = &ad1986a_automic_capture_source;
1140 codec->patch_ops.unsol_event = ad1986a_samsung_p50_unsol_event;
1141 codec->patch_ops.init = ad1986a_samsung_p50_init;
1142 break;
1138 case AD1986A_LAPTOP_AUTOMUTE: 1143 case AD1986A_LAPTOP_AUTOMUTE:
1139 spec->mixers[0] = ad1986a_laptop_automute_mixers; 1144 spec->num_mixers = 3;
1145 spec->mixers[0] = ad1986a_automute_master_mixers;
1146 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1147 spec->mixers[2] = ad1986a_laptop_intmic_mixers;
1140 spec->num_init_verbs = 3; 1148 spec->num_init_verbs = 3;
1141 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1149 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1142 spec->init_verbs[2] = ad1986a_hp_init_verbs; 1150 spec->init_verbs[2] = ad1986a_hp_init_verbs;
@@ -1148,6 +1156,10 @@ static int patch_ad1986a(struct hda_codec *codec)
1148 spec->input_mux = &ad1986a_laptop_eapd_capture_source; 1156 spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1149 codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; 1157 codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
1150 codec->patch_ops.init = ad1986a_hp_init; 1158 codec->patch_ops.init = ad1986a_hp_init;
1159 /* Lenovo N100 seems to report the reversed bit
1160 * for HP jack-sensing
1161 */
1162 spec->inv_jack_detect = 1;
1151 break; 1163 break;
1152 case AD1986A_ULTRA: 1164 case AD1986A_ULTRA:
1153 spec->mixers[0] = ad1986a_laptop_eapd_mixers; 1165 spec->mixers[0] = ad1986a_laptop_eapd_mixers;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 4fcbe21829ab..ac868c59f9e3 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -349,7 +349,7 @@ static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol,
349 &spec->cur_mux[adc_idx]); 349 &spec->cur_mux[adc_idx]);
350} 350}
351 351
352#ifdef CONFIG_SND_JACK 352#ifdef CONFIG_SND_HDA_INPUT_JACK
353static void conexant_free_jack_priv(struct snd_jack *jack) 353static void conexant_free_jack_priv(struct snd_jack *jack)
354{ 354{
355 struct conexant_jack *jacks = jack->private_data; 355 struct conexant_jack *jacks = jack->private_data;
@@ -463,7 +463,7 @@ static int conexant_init(struct hda_codec *codec)
463 463
464static void conexant_free(struct hda_codec *codec) 464static void conexant_free(struct hda_codec *codec)
465{ 465{
466#ifdef CONFIG_SND_JACK 466#ifdef CONFIG_SND_HDA_INPUT_JACK
467 struct conexant_spec *spec = codec->spec; 467 struct conexant_spec *spec = codec->spec;
468 if (spec->jacks.list) { 468 if (spec->jacks.list) {
469 struct conexant_jack *jacks = spec->jacks.list; 469 struct conexant_jack *jacks = spec->jacks.list;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bf4b78a74a8f..3a8e58c483df 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -250,13 +250,6 @@ enum {
250 ALC883_MODEL_LAST, 250 ALC883_MODEL_LAST,
251}; 251};
252 252
253/* styles of capture selection */
254enum {
255 CAPT_MUX = 0, /* only mux based */
256 CAPT_MIX, /* only mixer based */
257 CAPT_1MUX_MIX, /* first mux and other mixers */
258};
259
260/* for GPIO Poll */ 253/* for GPIO Poll */
261#define GPIO_MASK 0x03 254#define GPIO_MASK 0x03
262 255
@@ -306,7 +299,6 @@ struct alc_spec {
306 hda_nid_t *adc_nids; 299 hda_nid_t *adc_nids;
307 hda_nid_t *capsrc_nids; 300 hda_nid_t *capsrc_nids;
308 hda_nid_t dig_in_nid; /* digital-in NID; optional */ 301 hda_nid_t dig_in_nid; /* digital-in NID; optional */
309 int capture_style; /* capture style (CAPT_*) */
310 302
311 /* capture source */ 303 /* capture source */
312 unsigned int num_mux_defs; 304 unsigned int num_mux_defs;
@@ -420,12 +412,13 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
420 unsigned int mux_idx; 412 unsigned int mux_idx;
421 hda_nid_t nid = spec->capsrc_nids ? 413 hda_nid_t nid = spec->capsrc_nids ?
422 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; 414 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
415 unsigned int type;
423 416
424 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; 417 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
425 imux = &spec->input_mux[mux_idx]; 418 imux = &spec->input_mux[mux_idx];
426 419
427 if (spec->capture_style && 420 type = (get_wcaps(codec, nid) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
428 !(spec->capture_style == CAPT_1MUX_MIX && !adc_idx)) { 421 if (type == AC_WID_AUD_MIX) {
429 /* Matrix-mixer style (e.g. ALC882) */ 422 /* Matrix-mixer style (e.g. ALC882) */
430 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 423 unsigned int *cur_val = &spec->cur_mux[adc_idx];
431 unsigned int i, idx; 424 unsigned int i, idx;
@@ -952,12 +945,13 @@ static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
952static void alc_automute_pin(struct hda_codec *codec) 945static void alc_automute_pin(struct hda_codec *codec)
953{ 946{
954 struct alc_spec *spec = codec->spec; 947 struct alc_spec *spec = codec->spec;
955 unsigned int present; 948 unsigned int present, pincap;
956 unsigned int nid = spec->autocfg.hp_pins[0]; 949 unsigned int nid = spec->autocfg.hp_pins[0];
957 int i; 950 int i;
958 951
959 /* need to execute and sync at first */ 952 pincap = snd_hda_query_pin_caps(codec, nid);
960 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); 953 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
954 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
961 present = snd_hda_codec_read(codec, nid, 0, 955 present = snd_hda_codec_read(codec, nid, 0,
962 AC_VERB_GET_PIN_SENSE, 0); 956 AC_VERB_GET_PIN_SENSE, 0);
963 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0; 957 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0;
@@ -1399,7 +1393,7 @@ static struct hda_verb alc888_fujitsu_xa3530_verbs[] = {
1399static void alc_automute_amp(struct hda_codec *codec) 1393static void alc_automute_amp(struct hda_codec *codec)
1400{ 1394{
1401 struct alc_spec *spec = codec->spec; 1395 struct alc_spec *spec = codec->spec;
1402 unsigned int val, mute; 1396 unsigned int val, mute, pincap;
1403 hda_nid_t nid; 1397 hda_nid_t nid;
1404 int i; 1398 int i;
1405 1399
@@ -1408,6 +1402,10 @@ static void alc_automute_amp(struct hda_codec *codec)
1408 nid = spec->autocfg.hp_pins[i]; 1402 nid = spec->autocfg.hp_pins[i];
1409 if (!nid) 1403 if (!nid)
1410 break; 1404 break;
1405 pincap = snd_hda_query_pin_caps(codec, nid);
1406 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
1407 snd_hda_codec_read(codec, nid, 0,
1408 AC_VERB_SET_PIN_SENSE, 0);
1411 val = snd_hda_codec_read(codec, nid, 0, 1409 val = snd_hda_codec_read(codec, nid, 0,
1412 AC_VERB_GET_PIN_SENSE, 0); 1410 AC_VERB_GET_PIN_SENSE, 0);
1413 if (val & AC_PINSENSE_PRESENCE) { 1411 if (val & AC_PINSENSE_PRESENCE) {
@@ -1478,6 +1476,10 @@ static struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
1478static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { 1476static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
1479/* Bias voltage on for external mic port */ 1477/* Bias voltage on for external mic port */
1480 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, 1478 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
1479/* Front Mic: set to PIN_IN (empty by default) */
1480 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1481/* Unselect Front Mic by default in input mixer 3 */
1482 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1481/* Enable unsolicited event for HP jack */ 1483/* Enable unsolicited event for HP jack */
1482 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 1484 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1483/* Enable speaker output */ 1485/* Enable speaker output */
@@ -1567,18 +1569,22 @@ static struct hda_input_mux alc888_2_capture_sources[2] = {
1567static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = { 1569static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
1568 /* Interal mic only available on one ADC */ 1570 /* Interal mic only available on one ADC */
1569 { 1571 {
1570 .num_items = 3, 1572 .num_items = 5,
1571 .items = { 1573 .items = {
1572 { "Ext Mic", 0x0 }, 1574 { "Ext Mic", 0x0 },
1575 { "Line In", 0x2 },
1573 { "CD", 0x4 }, 1576 { "CD", 0x4 },
1577 { "Input Mix", 0xa },
1574 { "Int Mic", 0xb }, 1578 { "Int Mic", 0xb },
1575 }, 1579 },
1576 }, 1580 },
1577 { 1581 {
1578 .num_items = 2, 1582 .num_items = 4,
1579 .items = { 1583 .items = {
1580 { "Ext Mic", 0x0 }, 1584 { "Ext Mic", 0x0 },
1585 { "Line In", 0x2 },
1581 { "CD", 0x4 }, 1586 { "CD", 0x4 },
1587 { "Input Mix", 0xa },
1582 }, 1588 },
1583 } 1589 }
1584}; 1590};
@@ -1646,6 +1652,17 @@ static void alc888_acer_aspire_4930g_init_hook(struct hda_codec *codec)
1646 alc_automute_amp(codec); 1652 alc_automute_amp(codec);
1647} 1653}
1648 1654
1655static void alc888_acer_aspire_6530g_init_hook(struct hda_codec *codec)
1656{
1657 struct alc_spec *spec = codec->spec;
1658
1659 spec->autocfg.hp_pins[0] = 0x15;
1660 spec->autocfg.speaker_pins[0] = 0x14;
1661 spec->autocfg.speaker_pins[1] = 0x16;
1662 spec->autocfg.speaker_pins[2] = 0x17;
1663 alc_automute_amp(codec);
1664}
1665
1649static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec) 1666static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec)
1650{ 1667{
1651 struct alc_spec *spec = codec->spec; 1668 struct alc_spec *spec = codec->spec;
@@ -7557,7 +7574,6 @@ static int patch_alc882(struct hda_codec *codec)
7557 spec->stream_digital_playback = &alc882_pcm_digital_playback; 7574 spec->stream_digital_playback = &alc882_pcm_digital_playback;
7558 spec->stream_digital_capture = &alc882_pcm_digital_capture; 7575 spec->stream_digital_capture = &alc882_pcm_digital_capture;
7559 7576
7560 spec->capture_style = CAPT_MIX; /* matrix-style capture */
7561 if (!spec->adc_nids && spec->input_mux) { 7577 if (!spec->adc_nids && spec->input_mux) {
7562 /* check whether NID 0x07 is valid */ 7578 /* check whether NID 0x07 is valid */
7563 unsigned int wcap = get_wcaps(codec, 0x07); 7579 unsigned int wcap = get_wcaps(codec, 0x07);
@@ -8197,6 +8213,8 @@ static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
8197 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 8213 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8198 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT), 8214 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8199 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT), 8215 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT),
8216 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8217 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8200 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 8218 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8201 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 8219 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8202 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 8220 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
@@ -9072,7 +9090,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
9072 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO), 9090 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO),
9073 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO), 9091 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO),
9074 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", 9092 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
9075 ALC888_ACER_ASPIRE_4930G), 9093 ALC888_ACER_ASPIRE_6530G),
9076 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", 9094 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
9077 ALC888_ACER_ASPIRE_6530G), 9095 ALC888_ACER_ASPIRE_6530G),
9078 /* default Acer -- disabled as it causes more problems. 9096 /* default Acer -- disabled as it causes more problems.
@@ -9325,7 +9343,7 @@ static struct alc_config_preset alc883_presets[] = {
9325 ARRAY_SIZE(alc888_2_capture_sources), 9343 ARRAY_SIZE(alc888_2_capture_sources),
9326 .input_mux = alc888_acer_aspire_6530_sources, 9344 .input_mux = alc888_acer_aspire_6530_sources,
9327 .unsol_event = alc_automute_amp_unsol_event, 9345 .unsol_event = alc_automute_amp_unsol_event,
9328 .init_hook = alc888_acer_aspire_4930g_init_hook, 9346 .init_hook = alc888_acer_aspire_6530g_init_hook,
9329 }, 9347 },
9330 [ALC888_ACER_ASPIRE_8930G] = { 9348 [ALC888_ACER_ASPIRE_8930G] = {
9331 .mixers = { alc888_base_mixer, 9349 .mixers = { alc888_base_mixer,
@@ -9781,7 +9799,6 @@ static int patch_alc883(struct hda_codec *codec)
9781 } 9799 }
9782 if (!spec->capsrc_nids) 9800 if (!spec->capsrc_nids)
9783 spec->capsrc_nids = alc883_capsrc_nids; 9801 spec->capsrc_nids = alc883_capsrc_nids;
9784 spec->capture_style = CAPT_MIX; /* matrix-style capture */
9785 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ 9802 spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
9786 break; 9803 break;
9787 case 0x10ec0889: 9804 case 0x10ec0889:
@@ -9791,8 +9808,6 @@ static int patch_alc883(struct hda_codec *codec)
9791 } 9808 }
9792 if (!spec->capsrc_nids) 9809 if (!spec->capsrc_nids)
9793 spec->capsrc_nids = alc889_capsrc_nids; 9810 spec->capsrc_nids = alc889_capsrc_nids;
9794 spec->capture_style = CAPT_1MUX_MIX; /* 1mux/Nmix-style
9795 capture */
9796 break; 9811 break;
9797 default: 9812 default:
9798 if (!spec->num_adc_nids) { 9813 if (!spec->num_adc_nids) {
@@ -9801,7 +9816,6 @@ static int patch_alc883(struct hda_codec *codec)
9801 } 9816 }
9802 if (!spec->capsrc_nids) 9817 if (!spec->capsrc_nids)
9803 spec->capsrc_nids = alc883_capsrc_nids; 9818 spec->capsrc_nids = alc883_capsrc_nids;
9804 spec->capture_style = CAPT_MIX; /* matrix-style capture */
9805 break; 9819 break;
9806 } 9820 }
9807 9821
@@ -10913,9 +10927,27 @@ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec,
10913 return 0; 10927 return 0;
10914} 10928}
10915 10929
10916/* identical with ALC880 */ 10930static int alc262_auto_create_analog_input_ctls(struct alc_spec *spec,
10917#define alc262_auto_create_analog_input_ctls \ 10931 const struct auto_pin_cfg *cfg)
10918 alc880_auto_create_analog_input_ctls 10932{
10933 int err;
10934
10935 err = alc880_auto_create_analog_input_ctls(spec, cfg);
10936 if (err < 0)
10937 return err;
10938 /* digital-mic input pin is excluded in alc880_auto_create..()
10939 * because it's under 0x18
10940 */
10941 if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 ||
10942 cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) {
10943 struct hda_input_mux *imux = &spec->private_imux[0];
10944 imux->items[imux->num_items].label = "Int Mic";
10945 imux->items[imux->num_items].index = 0x09;
10946 imux->num_items++;
10947 }
10948 return 0;
10949}
10950
10919 10951
10920/* 10952/*
10921 * generic initialization of ADC, input mixers and output mixers 10953 * generic initialization of ADC, input mixers and output mixers
@@ -11332,6 +11364,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
11332 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO), 11364 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
11333 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), 11365 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
11334 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ 11366 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
11367 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06),
11335 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO", 11368 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
11336 ALC262_SONY_ASSAMD), 11369 ALC262_SONY_ASSAMD),
11337 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", 11370 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
@@ -11539,6 +11572,7 @@ static struct alc_config_preset alc262_presets[] = {
11539 .capsrc_nids = alc262_dmic_capsrc_nids, 11572 .capsrc_nids = alc262_dmic_capsrc_nids,
11540 .dac_nids = alc262_dac_nids, 11573 .dac_nids = alc262_dac_nids,
11541 .adc_nids = alc262_dmic_adc_nids, /* ADC0 */ 11574 .adc_nids = alc262_dmic_adc_nids, /* ADC0 */
11575 .num_adc_nids = 1, /* single ADC */
11542 .dig_out_nid = ALC262_DIGOUT_NID, 11576 .dig_out_nid = ALC262_DIGOUT_NID,
11543 .num_channel_mode = ARRAY_SIZE(alc262_modes), 11577 .num_channel_mode = ARRAY_SIZE(alc262_modes),
11544 .channel_mode = alc262_modes, 11578 .channel_mode = alc262_modes,
@@ -11640,21 +11674,36 @@ static int patch_alc262(struct hda_codec *codec)
11640 spec->stream_digital_playback = &alc262_pcm_digital_playback; 11674 spec->stream_digital_playback = &alc262_pcm_digital_playback;
11641 spec->stream_digital_capture = &alc262_pcm_digital_capture; 11675 spec->stream_digital_capture = &alc262_pcm_digital_capture;
11642 11676
11643 spec->capture_style = CAPT_MIX;
11644 if (!spec->adc_nids && spec->input_mux) { 11677 if (!spec->adc_nids && spec->input_mux) {
11645 /* check whether NID 0x07 is valid */ 11678 int i;
11646 unsigned int wcap = get_wcaps(codec, 0x07); 11679 /* check whether the digital-mic has to be supported */
11647 11680 for (i = 0; i < spec->input_mux->num_items; i++) {
11648 /* get type */ 11681 if (spec->input_mux->items[i].index >= 9)
11649 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 11682 break;
11650 if (wcap != AC_WID_AUD_IN) { 11683 }
11651 spec->adc_nids = alc262_adc_nids_alt; 11684 if (i < spec->input_mux->num_items) {
11652 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt); 11685 /* use only ADC0 */
11653 spec->capsrc_nids = alc262_capsrc_nids_alt; 11686 spec->adc_nids = alc262_dmic_adc_nids;
11687 spec->num_adc_nids = 1;
11688 spec->capsrc_nids = alc262_dmic_capsrc_nids;
11654 } else { 11689 } else {
11655 spec->adc_nids = alc262_adc_nids; 11690 /* all analog inputs */
11656 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids); 11691 /* check whether NID 0x07 is valid */
11657 spec->capsrc_nids = alc262_capsrc_nids; 11692 unsigned int wcap = get_wcaps(codec, 0x07);
11693
11694 /* get type */
11695 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
11696 if (wcap != AC_WID_AUD_IN) {
11697 spec->adc_nids = alc262_adc_nids_alt;
11698 spec->num_adc_nids =
11699 ARRAY_SIZE(alc262_adc_nids_alt);
11700 spec->capsrc_nids = alc262_capsrc_nids_alt;
11701 } else {
11702 spec->adc_nids = alc262_adc_nids;
11703 spec->num_adc_nids =
11704 ARRAY_SIZE(alc262_adc_nids);
11705 spec->capsrc_nids = alc262_capsrc_nids;
11706 }
11658 } 11707 }
11659 } 11708 }
11660 if (!spec->cap_mixer && !spec->no_analog) 11709 if (!spec->cap_mixer && !spec->no_analog)
@@ -12414,6 +12463,8 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
12414 if (err < 0) 12463 if (err < 0)
12415 return err; 12464 return err;
12416 12465
12466 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
12467
12417 return 1; 12468 return 1;
12418} 12469}
12419 12470
@@ -13244,26 +13295,8 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec,
13244 return 0; 13295 return 0;
13245} 13296}
13246 13297
13247static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec, 13298#define alc269_auto_create_analog_input_ctls \
13248 const struct auto_pin_cfg *cfg) 13299 alc262_auto_create_analog_input_ctls
13249{
13250 int err;
13251
13252 err = alc880_auto_create_analog_input_ctls(spec, cfg);
13253 if (err < 0)
13254 return err;
13255 /* digital-mic input pin is excluded in alc880_auto_create..()
13256 * because it's under 0x18
13257 */
13258 if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 ||
13259 cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) {
13260 struct hda_input_mux *imux = &spec->private_imux[0];
13261 imux->items[imux->num_items].label = "Int Mic";
13262 imux->items[imux->num_items].index = 0x05;
13263 imux->num_items++;
13264 }
13265 return 0;
13266}
13267 13300
13268#ifdef CONFIG_SND_HDA_POWER_SAVE 13301#ifdef CONFIG_SND_HDA_POWER_SAVE
13269#define alc269_loopbacks alc880_loopbacks 13302#define alc269_loopbacks alc880_loopbacks
@@ -13340,6 +13373,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13340 if (!spec->cap_mixer && !spec->no_analog) 13373 if (!spec->cap_mixer && !spec->no_analog)
13341 set_capture_mixer(spec); 13374 set_capture_mixer(spec);
13342 13375
13376 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
13377
13343 return 1; 13378 return 1;
13344} 13379}
13345 13380
@@ -15554,7 +15589,6 @@ static int patch_alc861vd(struct hda_codec *codec)
15554 spec->adc_nids = alc861vd_adc_nids; 15589 spec->adc_nids = alc861vd_adc_nids;
15555 spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); 15590 spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids);
15556 spec->capsrc_nids = alc861vd_capsrc_nids; 15591 spec->capsrc_nids = alc861vd_capsrc_nids;
15557 spec->capture_style = CAPT_MIX;
15558 15592
15559 set_capture_mixer(spec); 15593 set_capture_mixer(spec);
15560 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 15594 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
@@ -17474,7 +17508,6 @@ static int patch_alc662(struct hda_codec *codec)
17474 spec->adc_nids = alc662_adc_nids; 17508 spec->adc_nids = alc662_adc_nids;
17475 spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); 17509 spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids);
17476 spec->capsrc_nids = alc662_capsrc_nids; 17510 spec->capsrc_nids = alc662_capsrc_nids;
17477 spec->capture_style = CAPT_MIX;
17478 17511
17479 if (!spec->cap_mixer) 17512 if (!spec->cap_mixer)
17480 set_capture_mixer(spec); 17513 set_capture_mixer(spec);
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 93e47c96a38b..14f3c3e0f62d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -639,7 +639,7 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol,
639static unsigned int stac92xx_vref_set(struct hda_codec *codec, 639static unsigned int stac92xx_vref_set(struct hda_codec *codec,
640 hda_nid_t nid, unsigned int new_vref) 640 hda_nid_t nid, unsigned int new_vref)
641{ 641{
642 unsigned int error; 642 int error;
643 unsigned int pincfg; 643 unsigned int pincfg;
644 pincfg = snd_hda_codec_read(codec, nid, 0, 644 pincfg = snd_hda_codec_read(codec, nid, 0,
645 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 645 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
@@ -2703,7 +2703,7 @@ static int stac92xx_dc_bias_put(struct snd_kcontrol *kcontrol,
2703{ 2703{
2704 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2704 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2705 unsigned int new_vref = 0; 2705 unsigned int new_vref = 0;
2706 unsigned int error; 2706 int error;
2707 hda_nid_t nid = kcontrol->private_value; 2707 hda_nid_t nid = kcontrol->private_value;
2708 2708
2709 if (ucontrol->value.enumerated.item[0] == 0) 2709 if (ucontrol->value.enumerated.item[0] == 0)
@@ -4035,7 +4035,7 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
4035 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */ 4035 AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */
4036} 4036}
4037 4037
4038#ifdef CONFIG_SND_JACK 4038#ifdef CONFIG_SND_HDA_INPUT_JACK
4039static void stac92xx_free_jack_priv(struct snd_jack *jack) 4039static void stac92xx_free_jack_priv(struct snd_jack *jack)
4040{ 4040{
4041 struct sigmatel_jack *jacks = jack->private_data; 4041 struct sigmatel_jack *jacks = jack->private_data;
@@ -4047,7 +4047,7 @@ static void stac92xx_free_jack_priv(struct snd_jack *jack)
4047static int stac92xx_add_jack(struct hda_codec *codec, 4047static int stac92xx_add_jack(struct hda_codec *codec,
4048 hda_nid_t nid, int type) 4048 hda_nid_t nid, int type)
4049{ 4049{
4050#ifdef CONFIG_SND_JACK 4050#ifdef CONFIG_SND_HDA_INPUT_JACK
4051 struct sigmatel_spec *spec = codec->spec; 4051 struct sigmatel_spec *spec = codec->spec;
4052 struct sigmatel_jack *jack; 4052 struct sigmatel_jack *jack;
4053 int def_conf = snd_hda_codec_get_pincfg(codec, nid); 4053 int def_conf = snd_hda_codec_get_pincfg(codec, nid);
@@ -4336,7 +4336,7 @@ static int stac92xx_init(struct hda_codec *codec)
4336 4336
4337static void stac92xx_free_jacks(struct hda_codec *codec) 4337static void stac92xx_free_jacks(struct hda_codec *codec)
4338{ 4338{
4339#ifdef CONFIG_SND_JACK 4339#ifdef CONFIG_SND_HDA_INPUT_JACK
4340 /* free jack instances manually when clearing/reconfiguring */ 4340 /* free jack instances manually when clearing/reconfiguring */
4341 struct sigmatel_spec *spec = codec->spec; 4341 struct sigmatel_spec *spec = codec->spec;
4342 if (!codec->bus->shutdown && spec->jacks.list) { 4342 if (!codec->bus->shutdown && spec->jacks.list) {