aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-12-20 06:00:30 -0500
committerJaroslav Kysela <perex@perex.cz>2009-12-20 06:00:30 -0500
commit77623f62a919e729a5884c53c27a53b8a53ecb14 (patch)
tree9f4fbb9890ad5097d85ac3fb699bb9ea0e80d01a /sound
parentf74890277a196949e4004fe2955e1d4fb3930f98 (diff)
parent2fef62c825f09e29d2f52dc187ddf6f99e28c7f1 (diff)
Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into fixes
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c3
-rw-r--r--sound/pci/hda/patch_analog.c8
-rw-r--r--sound/pci/hda/patch_conexant.c43
-rw-r--r--sound/pci/hda/patch_realtek.c315
4 files changed, 338 insertions, 31 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e54420e691ae..9b56f937913e 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2713,6 +2713,9 @@ static struct pci_device_id azx_ids[] = {
2713 { PCI_DEVICE(0x10de, 0x0ac1), .driver_data = AZX_DRIVER_NVIDIA }, 2713 { PCI_DEVICE(0x10de, 0x0ac1), .driver_data = AZX_DRIVER_NVIDIA },
2714 { PCI_DEVICE(0x10de, 0x0ac2), .driver_data = AZX_DRIVER_NVIDIA }, 2714 { PCI_DEVICE(0x10de, 0x0ac2), .driver_data = AZX_DRIVER_NVIDIA },
2715 { PCI_DEVICE(0x10de, 0x0ac3), .driver_data = AZX_DRIVER_NVIDIA }, 2715 { PCI_DEVICE(0x10de, 0x0ac3), .driver_data = AZX_DRIVER_NVIDIA },
2716 { PCI_DEVICE(0x10de, 0x0be2), .driver_data = AZX_DRIVER_NVIDIA },
2717 { PCI_DEVICE(0x10de, 0x0be3), .driver_data = AZX_DRIVER_NVIDIA },
2718 { PCI_DEVICE(0x10de, 0x0be4), .driver_data = AZX_DRIVER_NVIDIA },
2716 { PCI_DEVICE(0x10de, 0x0d94), .driver_data = AZX_DRIVER_NVIDIA }, 2719 { PCI_DEVICE(0x10de, 0x0d94), .driver_data = AZX_DRIVER_NVIDIA },
2717 { PCI_DEVICE(0x10de, 0x0d95), .driver_data = AZX_DRIVER_NVIDIA }, 2720 { PCI_DEVICE(0x10de, 0x0d95), .driver_data = AZX_DRIVER_NVIDIA },
2718 { PCI_DEVICE(0x10de, 0x0d96), .driver_data = AZX_DRIVER_NVIDIA }, 2721 { PCI_DEVICE(0x10de, 0x0d96), .driver_data = AZX_DRIVER_NVIDIA },
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 447eda1f6770..1a36137e13ec 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1789,6 +1789,14 @@ static int patch_ad1981(struct hda_codec *codec)
1789 1789
1790 codec->patch_ops.init = ad1981_hp_init; 1790 codec->patch_ops.init = ad1981_hp_init;
1791 codec->patch_ops.unsol_event = ad1981_hp_unsol_event; 1791 codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
1792 /* set the upper-limit for mixer amp to 0dB for avoiding the
1793 * possible damage by overloading
1794 */
1795 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
1796 (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
1797 (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
1798 (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
1799 (1 << AC_AMPCAP_MUTE_SHIFT));
1792 break; 1800 break;
1793 case AD1981_THINKPAD: 1801 case AD1981_THINKPAD:
1794 spec->mixers[0] = ad1981_thinkpad_mixers; 1802 spec->mixers[0] = ad1981_thinkpad_mixers;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index a09c03c3f62b..c578c28f368e 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -29,6 +29,7 @@
29 29
30#include "hda_codec.h" 30#include "hda_codec.h"
31#include "hda_local.h" 31#include "hda_local.h"
32#include "hda_beep.h"
32 33
33#define CXT_PIN_DIR_IN 0x00 34#define CXT_PIN_DIR_IN 0x00
34#define CXT_PIN_DIR_OUT 0x01 35#define CXT_PIN_DIR_OUT 0x01
@@ -111,6 +112,7 @@ struct conexant_spec {
111 unsigned int dell_automute; 112 unsigned int dell_automute;
112 unsigned int port_d_mode; 113 unsigned int port_d_mode;
113 unsigned char ext_mic_bias; 114 unsigned char ext_mic_bias;
115 unsigned int dell_vostro;
114}; 116};
115 117
116static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, 118static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
@@ -476,6 +478,7 @@ static void conexant_free(struct hda_codec *codec)
476 snd_array_free(&spec->jacks); 478 snd_array_free(&spec->jacks);
477 } 479 }
478#endif 480#endif
481 snd_hda_detach_beep_device(codec);
479 kfree(codec->spec); 482 kfree(codec->spec);
480} 483}
481 484
@@ -2109,9 +2112,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol,
2109{ 2112{
2110 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2113 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2111 int val; 2114 int val;
2115 hda_nid_t nid = kcontrol->private_value & 0xff;
2116 int inout = (kcontrol->private_value & 0x100) ?
2117 AC_AMP_GET_INPUT : AC_AMP_GET_OUTPUT;
2112 2118
2113 val = snd_hda_codec_read(codec, 0x17, 0, 2119 val = snd_hda_codec_read(codec, nid, 0,
2114 AC_VERB_GET_AMP_GAIN_MUTE, AC_AMP_GET_OUTPUT); 2120 AC_VERB_GET_AMP_GAIN_MUTE, inout);
2115 2121
2116 ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN; 2122 ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN;
2117 return 0; 2123 return 0;
@@ -2123,6 +2129,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
2123 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2129 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2124 const struct hda_input_mux *imux = &cxt5066_analog_mic_boost; 2130 const struct hda_input_mux *imux = &cxt5066_analog_mic_boost;
2125 unsigned int idx; 2131 unsigned int idx;
2132 hda_nid_t nid = kcontrol->private_value & 0xff;
2133 int inout = (kcontrol->private_value & 0x100) ?
2134 AC_AMP_SET_INPUT : AC_AMP_SET_OUTPUT;
2126 2135
2127 if (!imux->num_items) 2136 if (!imux->num_items)
2128 return 0; 2137 return 0;
@@ -2130,9 +2139,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
2130 if (idx >= imux->num_items) 2139 if (idx >= imux->num_items)
2131 idx = imux->num_items - 1; 2140 idx = imux->num_items - 1;
2132 2141
2133 snd_hda_codec_write_cache(codec, 0x17, 0, 2142 snd_hda_codec_write_cache(codec, nid, 0,
2134 AC_VERB_SET_AMP_GAIN_MUTE, 2143 AC_VERB_SET_AMP_GAIN_MUTE,
2135 AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | 2144 AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | inout |
2136 imux->items[idx].index); 2145 imux->items[idx].index);
2137 2146
2138 return 1; 2147 return 1;
@@ -2201,10 +2210,11 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {
2201 2210
2202 { 2211 {
2203 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2212 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2204 .name = "Analog Mic Boost Capture Enum", 2213 .name = "Ext Mic Boost Capture Enum",
2205 .info = cxt5066_mic_boost_mux_enum_info, 2214 .info = cxt5066_mic_boost_mux_enum_info,
2206 .get = cxt5066_mic_boost_mux_enum_get, 2215 .get = cxt5066_mic_boost_mux_enum_get,
2207 .put = cxt5066_mic_boost_mux_enum_put, 2216 .put = cxt5066_mic_boost_mux_enum_put,
2217 .private_value = 0x17,
2208 }, 2218 },
2209 2219
2210 HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others), 2220 HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others),
@@ -2212,6 +2222,19 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {
2212 {} 2222 {}
2213}; 2223};
2214 2224
2225static struct snd_kcontrol_new cxt5066_vostro_mixers[] = {
2226 {
2227 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2228 .name = "Int Mic Boost Capture Enum",
2229 .info = cxt5066_mic_boost_mux_enum_info,
2230 .get = cxt5066_mic_boost_mux_enum_get,
2231 .put = cxt5066_mic_boost_mux_enum_put,
2232 .private_value = 0x23 | 0x100,
2233 },
2234 HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT),
2235 {}
2236};
2237
2215static struct hda_verb cxt5066_init_verbs[] = { 2238static struct hda_verb cxt5066_init_verbs[] = {
2216 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */ 2239 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */
2217 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */ 2240 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */
@@ -2397,11 +2420,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = {
2397/* initialize jack-sensing, too */ 2420/* initialize jack-sensing, too */
2398static int cxt5066_init(struct hda_codec *codec) 2421static int cxt5066_init(struct hda_codec *codec)
2399{ 2422{
2423 struct conexant_spec *spec = codec->spec;
2424
2400 snd_printdd("CXT5066: init\n"); 2425 snd_printdd("CXT5066: init\n");
2401 conexant_init(codec); 2426 conexant_init(codec);
2402 if (codec->patch_ops.unsol_event) { 2427 if (codec->patch_ops.unsol_event) {
2403 cxt5066_hp_automute(codec); 2428 cxt5066_hp_automute(codec);
2404 cxt5066_automic(codec); 2429 if (spec->dell_vostro)
2430 cxt5066_vostro_automic(codec);
2431 else
2432 cxt5066_automic(codec);
2405 } 2433 }
2406 return 0; 2434 return 0;
2407} 2435}
@@ -2500,7 +2528,10 @@ static int patch_cxt5066(struct hda_codec *codec)
2500 spec->init_verbs[0] = cxt5066_init_verbs_vostro; 2528 spec->init_verbs[0] = cxt5066_init_verbs_vostro;
2501 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; 2529 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
2502 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 2530 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
2531 spec->mixers[spec->num_mixers++] = cxt5066_vostro_mixers;
2503 spec->port_d_mode = 0; 2532 spec->port_d_mode = 0;
2533 spec->dell_vostro = 1;
2534 snd_hda_attach_beep_device(codec, 0x13);
2504 2535
2505 /* no S/PDIF out */ 2536 /* no S/PDIF out */
2506 spec->multiout.dig_out_nid = 0; 2537 spec->multiout.dig_out_nid = 0;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 888b6313eeca..8b375771b3ab 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -131,8 +131,8 @@ enum {
131enum { 131enum {
132 ALC269_BASIC, 132 ALC269_BASIC,
133 ALC269_QUANTA_FL1, 133 ALC269_QUANTA_FL1,
134 ALC269_ASUS_EEEPC_P703, 134 ALC269_ASUS_AMIC,
135 ALC269_ASUS_EEEPC_P901, 135 ALC269_ASUS_DMIC,
136 ALC269_FUJITSU, 136 ALC269_FUJITSU,
137 ALC269_LIFEBOOK, 137 ALC269_LIFEBOOK,
138 ALC269_AUTO, 138 ALC269_AUTO,
@@ -188,6 +188,8 @@ enum {
188 ALC663_ASUS_MODE4, 188 ALC663_ASUS_MODE4,
189 ALC663_ASUS_MODE5, 189 ALC663_ASUS_MODE5,
190 ALC663_ASUS_MODE6, 190 ALC663_ASUS_MODE6,
191 ALC663_ASUS_MODE7,
192 ALC663_ASUS_MODE8,
191 ALC272_DELL, 193 ALC272_DELL,
192 ALC272_DELL_ZM1, 194 ALC272_DELL_ZM1,
193 ALC272_SAMSUNG_NC10, 195 ALC272_SAMSUNG_NC10,
@@ -6248,6 +6250,7 @@ static const char *alc260_models[ALC260_MODEL_LAST] = {
6248 6250
6249static struct snd_pci_quirk alc260_cfg_tbl[] = { 6251static struct snd_pci_quirk alc260_cfg_tbl[] = {
6250 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER), 6252 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
6253 SND_PCI_QUIRK(0x1025, 0x007f, "Acer", ALC260_WILL),
6251 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER), 6254 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
6252 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100), 6255 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
6253 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013), 6256 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
@@ -8918,7 +8921,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
8918 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG), 8921 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
8919 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG), 8922 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
8920 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ 8923 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
8921 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC883_TARGA_2ch_DIG), 8924 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
8922 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), 8925 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
8923 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG), 8926 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
8924 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG), 8927 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
@@ -9235,6 +9238,8 @@ static struct alc_config_preset alc882_presets[] = {
9235 .dac_nids = alc883_dac_nids, 9238 .dac_nids = alc883_dac_nids,
9236 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids), 9239 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
9237 .adc_nids = alc889_adc_nids, 9240 .adc_nids = alc889_adc_nids,
9241 .capsrc_nids = alc889_capsrc_nids,
9242 .capsrc_nids = alc889_capsrc_nids,
9238 .dig_out_nid = ALC883_DIGOUT_NID, 9243 .dig_out_nid = ALC883_DIGOUT_NID,
9239 .dig_in_nid = ALC883_DIGIN_NID, 9244 .dig_in_nid = ALC883_DIGIN_NID,
9240 .slave_dig_outs = alc883_slave_dig_outs, 9245 .slave_dig_outs = alc883_slave_dig_outs,
@@ -9281,6 +9286,7 @@ static struct alc_config_preset alc882_presets[] = {
9281 .dac_nids = alc883_dac_nids, 9286 .dac_nids = alc883_dac_nids,
9282 .adc_nids = alc883_adc_nids_alt, 9287 .adc_nids = alc883_adc_nids_alt,
9283 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 9288 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
9289 .capsrc_nids = alc883_capsrc_nids,
9284 .dig_out_nid = ALC883_DIGOUT_NID, 9290 .dig_out_nid = ALC883_DIGOUT_NID,
9285 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 9291 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9286 .channel_mode = alc883_3ST_2ch_modes, 9292 .channel_mode = alc883_3ST_2ch_modes,
@@ -9427,6 +9433,7 @@ static struct alc_config_preset alc882_presets[] = {
9427 .dac_nids = alc883_dac_nids, 9433 .dac_nids = alc883_dac_nids,
9428 .adc_nids = alc883_adc_nids_alt, 9434 .adc_nids = alc883_adc_nids_alt,
9429 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 9435 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
9436 .capsrc_nids = alc883_capsrc_nids,
9430 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), 9437 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
9431 .channel_mode = alc883_sixstack_modes, 9438 .channel_mode = alc883_sixstack_modes,
9432 .input_mux = &alc883_capture_source, 9439 .input_mux = &alc883_capture_source,
@@ -9488,6 +9495,7 @@ static struct alc_config_preset alc882_presets[] = {
9488 .dac_nids = alc883_dac_nids, 9495 .dac_nids = alc883_dac_nids,
9489 .adc_nids = alc883_adc_nids_alt, 9496 .adc_nids = alc883_adc_nids_alt,
9490 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt), 9497 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
9498 .capsrc_nids = alc883_capsrc_nids,
9491 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 9499 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9492 .channel_mode = alc883_3ST_2ch_modes, 9500 .channel_mode = alc883_3ST_2ch_modes,
9493 .input_mux = &alc883_lenovo_101e_capture_source, 9501 .input_mux = &alc883_lenovo_101e_capture_source,
@@ -9667,6 +9675,7 @@ static struct alc_config_preset alc882_presets[] = {
9667 alc880_gpio1_init_verbs }, 9675 alc880_gpio1_init_verbs },
9668 .adc_nids = alc883_adc_nids, 9676 .adc_nids = alc883_adc_nids,
9669 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), 9677 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
9678 .capsrc_nids = alc883_capsrc_nids,
9670 .dac_nids = alc883_dac_nids, 9679 .dac_nids = alc883_dac_nids,
9671 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 9680 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
9672 .channel_mode = alc889A_mb31_6ch_modes, 9681 .channel_mode = alc889A_mb31_6ch_modes,
@@ -13231,10 +13240,12 @@ static struct hda_verb alc269_eeepc_amic_init_verbs[] = {
13231/* toggle speaker-output according to the hp-jack state */ 13240/* toggle speaker-output according to the hp-jack state */
13232static void alc269_speaker_automute(struct hda_codec *codec) 13241static void alc269_speaker_automute(struct hda_codec *codec)
13233{ 13242{
13243 struct alc_spec *spec = codec->spec;
13244 unsigned int nid = spec->autocfg.hp_pins[0];
13234 unsigned int present; 13245 unsigned int present;
13235 unsigned char bits; 13246 unsigned char bits;
13236 13247
13237 present = snd_hda_jack_detect(codec, 0x15); 13248 present = snd_hda_jack_detect(codec, nid);
13238 bits = present ? AMP_IN_MUTE(0) : 0; 13249 bits = present ? AMP_IN_MUTE(0) : 0;
13239 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 13250 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13240 AMP_IN_MUTE(0), bits); 13251 AMP_IN_MUTE(0), bits);
@@ -13459,8 +13470,8 @@ static void alc269_auto_init(struct hda_codec *codec)
13459static const char *alc269_models[ALC269_MODEL_LAST] = { 13470static const char *alc269_models[ALC269_MODEL_LAST] = {
13460 [ALC269_BASIC] = "basic", 13471 [ALC269_BASIC] = "basic",
13461 [ALC269_QUANTA_FL1] = "quanta", 13472 [ALC269_QUANTA_FL1] = "quanta",
13462 [ALC269_ASUS_EEEPC_P703] = "eeepc-p703", 13473 [ALC269_ASUS_AMIC] = "asus-amic",
13463 [ALC269_ASUS_EEEPC_P901] = "eeepc-p901", 13474 [ALC269_ASUS_DMIC] = "asus-dmic",
13464 [ALC269_FUJITSU] = "fujitsu", 13475 [ALC269_FUJITSU] = "fujitsu",
13465 [ALC269_LIFEBOOK] = "lifebook", 13476 [ALC269_LIFEBOOK] = "lifebook",
13466 [ALC269_AUTO] = "auto", 13477 [ALC269_AUTO] = "auto",
@@ -13469,18 +13480,41 @@ static const char *alc269_models[ALC269_MODEL_LAST] = {
13469static struct snd_pci_quirk alc269_cfg_tbl[] = { 13480static struct snd_pci_quirk alc269_cfg_tbl[] = {
13470 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13481 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1),
13471 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 13482 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13472 ALC269_ASUS_EEEPC_P703), 13483 ALC269_ASUS_AMIC),
13473 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703), 13484 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC),
13474 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703), 13485 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC),
13475 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703), 13486 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC),
13476 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703), 13487 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC),
13477 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703), 13488 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC),
13478 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703), 13489 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC),
13490 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC),
13491 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC),
13492 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC),
13493 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC),
13494 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC),
13495 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC),
13496 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC),
13497 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC),
13498 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC),
13499 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC),
13500 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC),
13501 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC),
13502 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC),
13503 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC),
13504 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC),
13505 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC),
13506 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC),
13507 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC),
13508 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC),
13509 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC),
13510 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC),
13511 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC),
13479 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13512 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13480 ALC269_ASUS_EEEPC_P901), 13513 ALC269_ASUS_DMIC),
13481 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 13514 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13482 ALC269_ASUS_EEEPC_P901), 13515 ALC269_ASUS_DMIC),
13483 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901), 13516 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC),
13517 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC),
13484 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 13518 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
13485 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 13519 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
13486 {} 13520 {}
@@ -13510,7 +13544,7 @@ static struct alc_config_preset alc269_presets[] = {
13510 .setup = alc269_quanta_fl1_setup, 13544 .setup = alc269_quanta_fl1_setup,
13511 .init_hook = alc269_quanta_fl1_init_hook, 13545 .init_hook = alc269_quanta_fl1_init_hook,
13512 }, 13546 },
13513 [ALC269_ASUS_EEEPC_P703] = { 13547 [ALC269_ASUS_AMIC] = {
13514 .mixers = { alc269_eeepc_mixer }, 13548 .mixers = { alc269_eeepc_mixer },
13515 .cap_mixer = alc269_epc_capture_mixer, 13549 .cap_mixer = alc269_epc_capture_mixer,
13516 .init_verbs = { alc269_init_verbs, 13550 .init_verbs = { alc269_init_verbs,
@@ -13524,7 +13558,7 @@ static struct alc_config_preset alc269_presets[] = {
13524 .setup = alc269_eeepc_amic_setup, 13558 .setup = alc269_eeepc_amic_setup,
13525 .init_hook = alc269_eeepc_inithook, 13559 .init_hook = alc269_eeepc_inithook,
13526 }, 13560 },
13527 [ALC269_ASUS_EEEPC_P901] = { 13561 [ALC269_ASUS_DMIC] = {
13528 .mixers = { alc269_eeepc_mixer }, 13562 .mixers = { alc269_eeepc_mixer },
13529 .cap_mixer = alc269_epc_capture_mixer, 13563 .cap_mixer = alc269_epc_capture_mixer,
13530 .init_verbs = { alc269_init_verbs, 13564 .init_verbs = { alc269_init_verbs,
@@ -16159,6 +16193,52 @@ static struct snd_kcontrol_new alc663_g50v_mixer[] = {
16159 { } /* end */ 16193 { } /* end */
16160}; 16194};
16161 16195
16196static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch = {
16197 .ops = &snd_hda_bind_sw,
16198 .values = {
16199 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16200 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
16201 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
16202 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
16203 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
16204 0
16205 },
16206};
16207
16208static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch = {
16209 .ops = &snd_hda_bind_sw,
16210 .values = {
16211 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16212 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
16213 0
16214 },
16215};
16216
16217static struct snd_kcontrol_new alc663_mode7_mixer[] = {
16218 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
16219 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
16220 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
16221 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16222 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
16223 HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16224 HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16225 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16226 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16227 { } /* end */
16228};
16229
16230static struct snd_kcontrol_new alc663_mode8_mixer[] = {
16231 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
16232 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
16233 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
16234 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT),
16235 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
16236 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16237 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16238 { } /* end */
16239};
16240
16241
16162static struct snd_kcontrol_new alc662_chmode_mixer[] = { 16242static struct snd_kcontrol_new alc662_chmode_mixer[] = {
16163 { 16243 {
16164 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 16244 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -16446,6 +16526,45 @@ static struct hda_verb alc272_dell_init_verbs[] = {
16446 {} 16526 {}
16447}; 16527};
16448 16528
16529static struct hda_verb alc663_mode7_init_verbs[] = {
16530 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16531 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16532 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16533 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16534 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16535 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16536 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
16537 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16538 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16539 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
16540 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16541 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
16542 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
16543 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16544 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16545 {}
16546};
16547
16548static struct hda_verb alc663_mode8_init_verbs[] = {
16549 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16550 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16551 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16552 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
16553 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16554 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16555 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16556 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16557 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16558 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16559 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
16560 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16561 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
16562 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16563 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
16564 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16565 {}
16566};
16567
16449static struct snd_kcontrol_new alc662_auto_capture_mixer[] = { 16568static struct snd_kcontrol_new alc662_auto_capture_mixer[] = {
16450 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 16569 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
16451 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 16570 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
@@ -16625,6 +16744,54 @@ static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec)
16625 } 16744 }
16626} 16745}
16627 16746
16747static void alc663_two_hp_m7_speaker_automute(struct hda_codec *codec)
16748{
16749 unsigned int present1, present2;
16750
16751 present1 = snd_hda_codec_read(codec, 0x1b, 0,
16752 AC_VERB_GET_PIN_SENSE, 0)
16753 & AC_PINSENSE_PRESENCE;
16754 present2 = snd_hda_codec_read(codec, 0x21, 0,
16755 AC_VERB_GET_PIN_SENSE, 0)
16756 & AC_PINSENSE_PRESENCE;
16757
16758 if (present1 || present2) {
16759 snd_hda_codec_write_cache(codec, 0x14, 0,
16760 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16761 snd_hda_codec_write_cache(codec, 0x17, 0,
16762 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16763 } else {
16764 snd_hda_codec_write_cache(codec, 0x14, 0,
16765 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16766 snd_hda_codec_write_cache(codec, 0x17, 0,
16767 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16768 }
16769}
16770
16771static void alc663_two_hp_m8_speaker_automute(struct hda_codec *codec)
16772{
16773 unsigned int present1, present2;
16774
16775 present1 = snd_hda_codec_read(codec, 0x21, 0,
16776 AC_VERB_GET_PIN_SENSE, 0)
16777 & AC_PINSENSE_PRESENCE;
16778 present2 = snd_hda_codec_read(codec, 0x15, 0,
16779 AC_VERB_GET_PIN_SENSE, 0)
16780 & AC_PINSENSE_PRESENCE;
16781
16782 if (present1 || present2) {
16783 snd_hda_codec_write_cache(codec, 0x14, 0,
16784 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16785 snd_hda_codec_write_cache(codec, 0x17, 0,
16786 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16787 } else {
16788 snd_hda_codec_write_cache(codec, 0x14, 0,
16789 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16790 snd_hda_codec_write_cache(codec, 0x17, 0,
16791 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16792 }
16793}
16794
16628static void alc663_m51va_unsol_event(struct hda_codec *codec, 16795static void alc663_m51va_unsol_event(struct hda_codec *codec,
16629 unsigned int res) 16796 unsigned int res)
16630{ 16797{
@@ -16644,7 +16811,7 @@ static void alc663_m51va_setup(struct hda_codec *codec)
16644 spec->ext_mic.pin = 0x18; 16811 spec->ext_mic.pin = 0x18;
16645 spec->ext_mic.mux_idx = 0; 16812 spec->ext_mic.mux_idx = 0;
16646 spec->int_mic.pin = 0x12; 16813 spec->int_mic.pin = 0x12;
16647 spec->int_mic.mux_idx = 1; 16814 spec->int_mic.mux_idx = 9;
16648 spec->auto_mic = 1; 16815 spec->auto_mic = 1;
16649} 16816}
16650 16817
@@ -16656,7 +16823,17 @@ static void alc663_m51va_inithook(struct hda_codec *codec)
16656 16823
16657/* ***************** Mode1 ******************************/ 16824/* ***************** Mode1 ******************************/
16658#define alc663_mode1_unsol_event alc663_m51va_unsol_event 16825#define alc663_mode1_unsol_event alc663_m51va_unsol_event
16659#define alc663_mode1_setup alc663_m51va_setup 16826
16827static void alc663_mode1_setup(struct hda_codec *codec)
16828{
16829 struct alc_spec *spec = codec->spec;
16830 spec->ext_mic.pin = 0x18;
16831 spec->ext_mic.mux_idx = 0;
16832 spec->int_mic.pin = 0x19;
16833 spec->int_mic.mux_idx = 1;
16834 spec->auto_mic = 1;
16835}
16836
16660#define alc663_mode1_inithook alc663_m51va_inithook 16837#define alc663_mode1_inithook alc663_m51va_inithook
16661 16838
16662/* ***************** Mode2 ******************************/ 16839/* ***************** Mode2 ******************************/
@@ -16673,7 +16850,7 @@ static void alc662_mode2_unsol_event(struct hda_codec *codec,
16673 } 16850 }
16674} 16851}
16675 16852
16676#define alc662_mode2_setup alc663_m51va_setup 16853#define alc662_mode2_setup alc663_mode1_setup
16677 16854
16678static void alc662_mode2_inithook(struct hda_codec *codec) 16855static void alc662_mode2_inithook(struct hda_codec *codec)
16679{ 16856{
@@ -16694,7 +16871,7 @@ static void alc663_mode3_unsol_event(struct hda_codec *codec,
16694 } 16871 }
16695} 16872}
16696 16873
16697#define alc663_mode3_setup alc663_m51va_setup 16874#define alc663_mode3_setup alc663_mode1_setup
16698 16875
16699static void alc663_mode3_inithook(struct hda_codec *codec) 16876static void alc663_mode3_inithook(struct hda_codec *codec)
16700{ 16877{
@@ -16715,7 +16892,7 @@ static void alc663_mode4_unsol_event(struct hda_codec *codec,
16715 } 16892 }
16716} 16893}
16717 16894
16718#define alc663_mode4_setup alc663_m51va_setup 16895#define alc663_mode4_setup alc663_mode1_setup
16719 16896
16720static void alc663_mode4_inithook(struct hda_codec *codec) 16897static void alc663_mode4_inithook(struct hda_codec *codec)
16721{ 16898{
@@ -16736,7 +16913,7 @@ static void alc663_mode5_unsol_event(struct hda_codec *codec,
16736 } 16913 }
16737} 16914}
16738 16915
16739#define alc663_mode5_setup alc663_m51va_setup 16916#define alc663_mode5_setup alc663_mode1_setup
16740 16917
16741static void alc663_mode5_inithook(struct hda_codec *codec) 16918static void alc663_mode5_inithook(struct hda_codec *codec)
16742{ 16919{
@@ -16757,7 +16934,7 @@ static void alc663_mode6_unsol_event(struct hda_codec *codec,
16757 } 16934 }
16758} 16935}
16759 16936
16760#define alc663_mode6_setup alc663_m51va_setup 16937#define alc663_mode6_setup alc663_mode1_setup
16761 16938
16762static void alc663_mode6_inithook(struct hda_codec *codec) 16939static void alc663_mode6_inithook(struct hda_codec *codec)
16763{ 16940{
@@ -16765,6 +16942,50 @@ static void alc663_mode6_inithook(struct hda_codec *codec)
16765 alc_mic_automute(codec); 16942 alc_mic_automute(codec);
16766} 16943}
16767 16944
16945/* ***************** Mode7 ******************************/
16946static void alc663_mode7_unsol_event(struct hda_codec *codec,
16947 unsigned int res)
16948{
16949 switch (res >> 26) {
16950 case ALC880_HP_EVENT:
16951 alc663_two_hp_m7_speaker_automute(codec);
16952 break;
16953 case ALC880_MIC_EVENT:
16954 alc_mic_automute(codec);
16955 break;
16956 }
16957}
16958
16959#define alc663_mode7_setup alc663_mode1_setup
16960
16961static void alc663_mode7_inithook(struct hda_codec *codec)
16962{
16963 alc663_two_hp_m7_speaker_automute(codec);
16964 alc_mic_automute(codec);
16965}
16966
16967/* ***************** Mode8 ******************************/
16968static void alc663_mode8_unsol_event(struct hda_codec *codec,
16969 unsigned int res)
16970{
16971 switch (res >> 26) {
16972 case ALC880_HP_EVENT:
16973 alc663_two_hp_m8_speaker_automute(codec);
16974 break;
16975 case ALC880_MIC_EVENT:
16976 alc_mic_automute(codec);
16977 break;
16978 }
16979}
16980
16981#define alc663_mode8_setup alc663_m51va_setup
16982
16983static void alc663_mode8_inithook(struct hda_codec *codec)
16984{
16985 alc663_two_hp_m8_speaker_automute(codec);
16986 alc_mic_automute(codec);
16987}
16988
16768static void alc663_g71v_hp_automute(struct hda_codec *codec) 16989static void alc663_g71v_hp_automute(struct hda_codec *codec)
16769{ 16990{
16770 unsigned int present; 16991 unsigned int present;
@@ -16899,6 +17120,8 @@ static const char *alc662_models[ALC662_MODEL_LAST] = {
16899 [ALC663_ASUS_MODE4] = "asus-mode4", 17120 [ALC663_ASUS_MODE4] = "asus-mode4",
16900 [ALC663_ASUS_MODE5] = "asus-mode5", 17121 [ALC663_ASUS_MODE5] = "asus-mode5",
16901 [ALC663_ASUS_MODE6] = "asus-mode6", 17122 [ALC663_ASUS_MODE6] = "asus-mode6",
17123 [ALC663_ASUS_MODE7] = "asus-mode7",
17124 [ALC663_ASUS_MODE8] = "asus-mode8",
16902 [ALC272_DELL] = "dell", 17125 [ALC272_DELL] = "dell",
16903 [ALC272_DELL_ZM1] = "dell-zm1", 17126 [ALC272_DELL_ZM1] = "dell-zm1",
16904 [ALC272_SAMSUNG_NC10] = "samsung-nc10", 17127 [ALC272_SAMSUNG_NC10] = "samsung-nc10",
@@ -16915,12 +17138,22 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
16915 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17138 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1),
16916 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), 17139 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2),
16917 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1), 17140 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1),
17141 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1),
17142 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1),
16918 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2), 17143 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2),
17144 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7),
17145 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7),
17146 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8),
17147 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3),
17148 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1),
16919 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2), 17149 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2),
17150 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2),
17151 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1),
16920 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2), 17152 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2),
16921 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6), 17153 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6),
16922 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6), 17154 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6),
16923 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2), 17155 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2),
17156 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1),
16924 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3), 17157 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3),
16925 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA), 17158 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA),
16926 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2), 17159 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2),
@@ -17204,6 +17437,36 @@ static struct alc_config_preset alc662_presets[] = {
17204 .setup = alc663_mode6_setup, 17437 .setup = alc663_mode6_setup,
17205 .init_hook = alc663_mode6_inithook, 17438 .init_hook = alc663_mode6_inithook,
17206 }, 17439 },
17440 [ALC663_ASUS_MODE7] = {
17441 .mixers = { alc663_mode7_mixer },
17442 .cap_mixer = alc662_auto_capture_mixer,
17443 .init_verbs = { alc662_init_verbs,
17444 alc663_mode7_init_verbs },
17445 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
17446 .hp_nid = 0x03,
17447 .dac_nids = alc662_dac_nids,
17448 .dig_out_nid = ALC662_DIGOUT_NID,
17449 .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
17450 .channel_mode = alc662_3ST_2ch_modes,
17451 .unsol_event = alc663_mode7_unsol_event,
17452 .setup = alc663_mode7_setup,
17453 .init_hook = alc663_mode7_inithook,
17454 },
17455 [ALC663_ASUS_MODE8] = {
17456 .mixers = { alc663_mode8_mixer },
17457 .cap_mixer = alc662_auto_capture_mixer,
17458 .init_verbs = { alc662_init_verbs,
17459 alc663_mode8_init_verbs },
17460 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
17461 .hp_nid = 0x03,
17462 .dac_nids = alc662_dac_nids,
17463 .dig_out_nid = ALC662_DIGOUT_NID,
17464 .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
17465 .channel_mode = alc662_3ST_2ch_modes,
17466 .unsol_event = alc663_mode8_unsol_event,
17467 .setup = alc663_mode8_setup,
17468 .init_hook = alc663_mode8_inithook,
17469 },
17207 [ALC272_DELL] = { 17470 [ALC272_DELL] = {
17208 .mixers = { alc663_m51va_mixer }, 17471 .mixers = { alc663_m51va_mixer },
17209 .cap_mixer = alc272_auto_capture_mixer, 17472 .cap_mixer = alc272_auto_capture_mixer,
@@ -17687,7 +17950,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
17687 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, 17950 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
17688 { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, 17951 { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
17689 { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, 17952 { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
17953 { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 },
17690 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, 17954 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
17955 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
17691 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 17956 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
17692 .patch = patch_alc861 }, 17957 .patch = patch_alc861 },
17693 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, 17958 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },