aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2010-02-04 08:16:14 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-04 08:16:14 -0500
commit84898e87cc0fff976202d5b91656f2db949fc2dd (patch)
tree1c6ecb29693e7cc88c06fc40dd41209515089e4d /sound/pci/hda/patch_realtek.c
parent88102f3f841b680412714d0b0b7da33c2a00c1f9 (diff)
ALSA: hda - Add ALC269VB support
- Add new models ALC269VB_AMIC ALC269VB_DMIC - Add alc269vb_laptop_dmic_setup The record source index Dmic is 0x6 for ALC269VB. - Change eeepc words for ALC269 - Modify init_verb tables of patch_alc269 patch_alc662 patch_alc882 - Modify common patch for ALC270 ALC269VB ALC275 Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c346
1 files changed, 246 insertions, 100 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 40ebf2746bb1..826ecdbdd2bb 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -131,8 +131,10 @@ enum {
131enum { 131enum {
132 ALC269_BASIC, 132 ALC269_BASIC,
133 ALC269_QUANTA_FL1, 133 ALC269_QUANTA_FL1,
134 ALC269_ASUS_AMIC, 134 ALC269_AMIC,
135 ALC269_ASUS_DMIC, 135 ALC269_DMIC,
136 ALC269VB_AMIC,
137 ALC269VB_DMIC,
136 ALC269_FUJITSU, 138 ALC269_FUJITSU,
137 ALC269_LIFEBOOK, 139 ALC269_LIFEBOOK,
138 ALC269_AUTO, 140 ALC269_AUTO,
@@ -13182,6 +13184,15 @@ static hda_nid_t alc269_capsrc_nids[1] = {
13182 0x23, 13184 0x23,
13183}; 13185};
13184 13186
13187static hda_nid_t alc269vb_adc_nids[1] = {
13188 /* ADC1 */
13189 0x09,
13190};
13191
13192static hda_nid_t alc269vb_capsrc_nids[1] = {
13193 0x22,
13194};
13195
13185/* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24), 13196/* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24),
13186 * not a mux! 13197 * not a mux!
13187 */ 13198 */
@@ -13250,7 +13261,7 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
13250 { } 13261 { }
13251}; 13262};
13252 13263
13253static struct snd_kcontrol_new alc269_eeepc_mixer[] = { 13264static struct snd_kcontrol_new alc269_laptop_mixer[] = {
13254 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 13265 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
13255 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT), 13266 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
13256 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), 13267 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
@@ -13258,16 +13269,47 @@ static struct snd_kcontrol_new alc269_eeepc_mixer[] = {
13258 { } /* end */ 13269 { } /* end */
13259}; 13270};
13260 13271
13272static struct snd_kcontrol_new alc269vb_laptop_mixer[] = {
13273 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
13274 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
13275 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
13276 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
13277 { } /* end */
13278};
13279
13261/* capture mixer elements */ 13280/* capture mixer elements */
13262static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { 13281static struct snd_kcontrol_new alc269_laptop_analog_capture_mixer[] = {
13263 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 13282 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
13264 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 13283 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
13265 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13284 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13285 HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT),
13286 { } /* end */
13287};
13288
13289static struct snd_kcontrol_new alc269_laptop_digital_capture_mixer[] = {
13290 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
13291 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
13292 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13293 { } /* end */
13294};
13295
13296static struct snd_kcontrol_new alc269vb_laptop_analog_capture_mixer[] = {
13297 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
13298 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
13299 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13300 HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT),
13301 { } /* end */
13302};
13303
13304static struct snd_kcontrol_new alc269vb_laptop_digital_capture_mixer[] = {
13305 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
13306 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
13307 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13266 { } /* end */ 13308 { } /* end */
13267}; 13309};
13268 13310
13269/* FSC amilo */ 13311/* FSC amilo */
13270#define alc269_fujitsu_mixer alc269_eeepc_mixer 13312#define alc269_fujitsu_mixer alc269_laptop_mixer
13271 13313
13272static struct hda_verb alc269_quanta_fl1_verbs[] = { 13314static struct hda_verb alc269_quanta_fl1_verbs[] = {
13273 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13315 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
@@ -13410,7 +13452,7 @@ static void alc269_lifebook_init_hook(struct hda_codec *codec)
13410 alc269_lifebook_mic_autoswitch(codec); 13452 alc269_lifebook_mic_autoswitch(codec);
13411} 13453}
13412 13454
13413static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { 13455static struct hda_verb alc269_laptop_dmic_init_verbs[] = {
13414 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13456 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13415 {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, 13457 {0x23, AC_VERB_SET_CONNECT_SEL, 0x05},
13416 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13458 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
@@ -13421,7 +13463,7 @@ static struct hda_verb alc269_eeepc_dmic_init_verbs[] = {
13421 {} 13463 {}
13422}; 13464};
13423 13465
13424static struct hda_verb alc269_eeepc_amic_init_verbs[] = { 13466static struct hda_verb alc269_laptop_amic_init_verbs[] = {
13425 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13467 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13426 {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, 13468 {0x23, AC_VERB_SET_CONNECT_SEL, 0x01},
13427 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13469 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
@@ -13431,6 +13473,28 @@ static struct hda_verb alc269_eeepc_amic_init_verbs[] = {
13431 {} 13473 {}
13432}; 13474};
13433 13475
13476static struct hda_verb alc269vb_laptop_dmic_init_verbs[] = {
13477 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01},
13478 {0x22, AC_VERB_SET_CONNECT_SEL, 0x06},
13479 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13480 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))},
13481 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13482 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13483 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13484 {}
13485};
13486
13487static struct hda_verb alc269vb_laptop_amic_init_verbs[] = {
13488 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01},
13489 {0x22, AC_VERB_SET_CONNECT_SEL, 0x01},
13490 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13491 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))},
13492 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13493 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13494 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13495 {}
13496};
13497
13434/* toggle speaker-output according to the hp-jack state */ 13498/* toggle speaker-output according to the hp-jack state */
13435static void alc269_speaker_automute(struct hda_codec *codec) 13499static void alc269_speaker_automute(struct hda_codec *codec)
13436{ 13500{
@@ -13448,7 +13512,7 @@ static void alc269_speaker_automute(struct hda_codec *codec)
13448} 13512}
13449 13513
13450/* unsolicited event for HP jack sensing */ 13514/* unsolicited event for HP jack sensing */
13451static void alc269_eeepc_unsol_event(struct hda_codec *codec, 13515static void alc269_laptop_unsol_event(struct hda_codec *codec,
13452 unsigned int res) 13516 unsigned int res)
13453{ 13517{
13454 switch (res >> 26) { 13518 switch (res >> 26) {
@@ -13461,7 +13525,7 @@ static void alc269_eeepc_unsol_event(struct hda_codec *codec,
13461 } 13525 }
13462} 13526}
13463 13527
13464static void alc269_eeepc_dmic_setup(struct hda_codec *codec) 13528static void alc269_laptop_dmic_setup(struct hda_codec *codec)
13465{ 13529{
13466 struct alc_spec *spec = codec->spec; 13530 struct alc_spec *spec = codec->spec;
13467 spec->ext_mic.pin = 0x18; 13531 spec->ext_mic.pin = 0x18;
@@ -13471,7 +13535,17 @@ static void alc269_eeepc_dmic_setup(struct hda_codec *codec)
13471 spec->auto_mic = 1; 13535 spec->auto_mic = 1;
13472} 13536}
13473 13537
13474static void alc269_eeepc_amic_setup(struct hda_codec *codec) 13538static void alc269vb_laptop_dmic_setup(struct hda_codec *codec)
13539{
13540 struct alc_spec *spec = codec->spec;
13541 spec->ext_mic.pin = 0x18;
13542 spec->ext_mic.mux_idx = 0;
13543 spec->int_mic.pin = 0x12;
13544 spec->int_mic.mux_idx = 6;
13545 spec->auto_mic = 1;
13546}
13547
13548static void alc269_laptop_amic_setup(struct hda_codec *codec)
13475{ 13549{
13476 struct alc_spec *spec = codec->spec; 13550 struct alc_spec *spec = codec->spec;
13477 spec->ext_mic.pin = 0x18; 13551 spec->ext_mic.pin = 0x18;
@@ -13481,7 +13555,7 @@ static void alc269_eeepc_amic_setup(struct hda_codec *codec)
13481 spec->auto_mic = 1; 13555 spec->auto_mic = 1;
13482} 13556}
13483 13557
13484static void alc269_eeepc_inithook(struct hda_codec *codec) 13558static void alc269_laptop_inithook(struct hda_codec *codec)
13485{ 13559{
13486 alc269_speaker_automute(codec); 13560 alc269_speaker_automute(codec);
13487 alc_mic_automute(codec); 13561 alc_mic_automute(codec);
@@ -13494,22 +13568,10 @@ static struct hda_verb alc269_init_verbs[] = {
13494 /* 13568 /*
13495 * Unmute ADC0 and set the default input to mic-in 13569 * Unmute ADC0 and set the default input to mic-in
13496 */ 13570 */
13497 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13571 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
13498
13499 /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the
13500 * analog-loopback mixer widget
13501 * Note: PASD motherboards uses the Line In 2 as the input for
13502 * front panel mic (mic 2)
13503 */
13504 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
13505 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
13506 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
13507 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
13508 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
13509 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
13510 13572
13511 /* 13573 /*
13512 * Set up output mixers (0x0c - 0x0e) 13574 * Set up output mixers (0x02 - 0x03)
13513 */ 13575 */
13514 /* set vol=0 to output mixers */ 13576 /* set vol=0 to output mixers */
13515 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 13577 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
@@ -13534,26 +13596,57 @@ static struct hda_verb alc269_init_verbs[] = {
13534 13596
13535 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13597 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
13536 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13598 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
13537 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
13538 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
13539 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
13540 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
13541 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
13542 13599
13543 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, 13600 /* FIXME: use Mux-type input source selection */
13544 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 13601 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
13602 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
13603 {0x23, AC_VERB_SET_CONNECT_SEL, 0x00},
13545 13604
13546 /* FIXME: use matrix-type input source selection */ 13605 /* set EAPD */
13606 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
13607 { }
13608};
13609
13610static struct hda_verb alc269vb_init_verbs[] = {
13611 /*
13612 * Unmute ADC0 and set the default input to mic-in
13613 */
13614 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
13615
13616 /*
13617 * Set up output mixers (0x02 - 0x03)
13618 */
13619 /* set vol=0 to output mixers */
13620 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
13621 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
13622
13623 /* set up input amps for analog loopback */
13624 /* Amp Indices: DAC = 0, mixer = 1 */
13625 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
13626 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
13627 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
13628 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
13629 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
13630 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
13631
13632 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
13633 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
13634 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
13635 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
13636 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
13637 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13638 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13639
13640 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
13641 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
13642
13643 /* FIXME: use Mux-type input source selection */
13547 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */ 13644 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
13548 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ 13645 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
13549 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 13646 {0x22, AC_VERB_SET_CONNECT_SEL, 0x00},
13550 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
13551 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
13552 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
13553 13647
13554 /* set EAPD */ 13648 /* set EAPD */
13555 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13649 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
13556 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
13557 { } 13650 { }
13558}; 13651};
13559 13652
@@ -13601,6 +13694,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13601 struct alc_spec *spec = codec->spec; 13694 struct alc_spec *spec = codec->spec;
13602 int err; 13695 int err;
13603 static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 13696 static hda_nid_t alc269_ignore[] = { 0x1d, 0 };
13697 hda_nid_t real_capsrc_nids;
13604 13698
13605 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 13699 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
13606 alc269_ignore); 13700 alc269_ignore);
@@ -13622,11 +13716,20 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13622 if (spec->kctls.list) 13716 if (spec->kctls.list)
13623 add_mixer(spec, spec->kctls.list); 13717 add_mixer(spec, spec->kctls.list);
13624 13718
13625 add_verb(spec, alc269_init_verbs); 13719 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) {
13720 add_verb(spec, alc269vb_init_verbs);
13721 real_capsrc_nids = alc269vb_capsrc_nids[0];
13722 alc_ssid_check(codec, 0x21, 0x1b, 0x14);
13723 } else {
13724 add_verb(spec, alc269_init_verbs);
13725 real_capsrc_nids = alc269_capsrc_nids[0];
13726 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
13727 }
13728
13626 spec->num_mux_defs = 1; 13729 spec->num_mux_defs = 1;
13627 spec->input_mux = &spec->private_imux[0]; 13730 spec->input_mux = &spec->private_imux[0];
13628 /* set default input source */ 13731 /* set default input source */
13629 snd_hda_codec_write_cache(codec, alc269_capsrc_nids[0], 13732 snd_hda_codec_write_cache(codec, real_capsrc_nids,
13630 0, AC_VERB_SET_CONNECT_SEL, 13733 0, AC_VERB_SET_CONNECT_SEL,
13631 spec->input_mux->items[0].index); 13734 spec->input_mux->items[0].index);
13632 13735
@@ -13637,8 +13740,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13637 if (!spec->cap_mixer && !spec->no_analog) 13740 if (!spec->cap_mixer && !spec->no_analog)
13638 set_capture_mixer(codec); 13741 set_capture_mixer(codec);
13639 13742
13640 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
13641
13642 return 1; 13743 return 1;
13643} 13744}
13644 13745
@@ -13664,8 +13765,8 @@ static void alc269_auto_init(struct hda_codec *codec)
13664static const char *alc269_models[ALC269_MODEL_LAST] = { 13765static const char *alc269_models[ALC269_MODEL_LAST] = {
13665 [ALC269_BASIC] = "basic", 13766 [ALC269_BASIC] = "basic",
13666 [ALC269_QUANTA_FL1] = "quanta", 13767 [ALC269_QUANTA_FL1] = "quanta",
13667 [ALC269_ASUS_AMIC] = "asus-amic", 13768 [ALC269_AMIC] = "laptop-amic",
13668 [ALC269_ASUS_DMIC] = "asus-dmic", 13769 [ALC269_DMIC] = "laptop-dmic",
13669 [ALC269_FUJITSU] = "fujitsu", 13770 [ALC269_FUJITSU] = "fujitsu",
13670 [ALC269_LIFEBOOK] = "lifebook", 13771 [ALC269_LIFEBOOK] = "lifebook",
13671 [ALC269_AUTO] = "auto", 13772 [ALC269_AUTO] = "auto",
@@ -13674,41 +13775,49 @@ static const char *alc269_models[ALC269_MODEL_LAST] = {
13674static struct snd_pci_quirk alc269_cfg_tbl[] = { 13775static struct snd_pci_quirk alc269_cfg_tbl[] = {
13675 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13776 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1),
13676 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 13777 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13677 ALC269_ASUS_AMIC), 13778 ALC269_AMIC),
13678 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC), 13779 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269VB_AMIC),
13679 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC), 13780 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS N63Jn", ALC269VB_AMIC),
13680 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC), 13781 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269VB_AMIC),
13681 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC), 13782 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_AMIC),
13682 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC), 13783 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269VB_AMIC),
13683 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC), 13784 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269VB_AMIC),
13684 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC), 13785 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269VB_AMIC),
13685 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC), 13786 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269VB_AMIC),
13686 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC), 13787 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_AMIC),
13687 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC), 13788 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_AMIC),
13688 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC), 13789 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_AMIC),
13689 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC), 13790 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_AMIC),
13690 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC), 13791 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_AMIC),
13691 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC), 13792 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_AMIC),
13692 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC), 13793 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_AMIC),
13693 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC), 13794 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_AMIC),
13694 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC), 13795 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_AMIC),
13695 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC), 13796 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_AMIC),
13696 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC), 13797 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_AMIC),
13697 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC), 13798 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_AMIC),
13698 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC), 13799 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_AMIC),
13699 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC), 13800 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_AMIC),
13700 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC), 13801 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_AMIC),
13701 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC), 13802 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_AMIC),
13702 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC), 13803 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_AMIC),
13703 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC), 13804 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_AMIC),
13704 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC), 13805 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_AMIC),
13705 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC), 13806 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_AMIC),
13807 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_AMIC),
13808 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_AMIC),
13809 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_AMIC),
13810 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_DMIC),
13811 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_AMIC),
13812 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_AMIC),
13813 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_AMIC),
13814 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_AMIC),
13706 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13815 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13707 ALC269_ASUS_DMIC), 13816 ALC269_DMIC),
13708 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 13817 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13709 ALC269_ASUS_DMIC), 13818 ALC269_DMIC),
13710 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC), 13819 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC),
13711 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC), 13820 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC),
13712 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 13821 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
13713 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 13822 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
13714 {} 13823 {}
@@ -13738,47 +13847,75 @@ static struct alc_config_preset alc269_presets[] = {
13738 .setup = alc269_quanta_fl1_setup, 13847 .setup = alc269_quanta_fl1_setup,
13739 .init_hook = alc269_quanta_fl1_init_hook, 13848 .init_hook = alc269_quanta_fl1_init_hook,
13740 }, 13849 },
13741 [ALC269_ASUS_AMIC] = { 13850 [ALC269_AMIC] = {
13742 .mixers = { alc269_eeepc_mixer }, 13851 .mixers = { alc269_laptop_mixer },
13743 .cap_mixer = alc269_epc_capture_mixer, 13852 .cap_mixer = alc269_laptop_analog_capture_mixer,
13744 .init_verbs = { alc269_init_verbs, 13853 .init_verbs = { alc269_init_verbs,
13745 alc269_eeepc_amic_init_verbs }, 13854 alc269_laptop_amic_init_verbs },
13746 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13855 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
13747 .dac_nids = alc269_dac_nids, 13856 .dac_nids = alc269_dac_nids,
13748 .hp_nid = 0x03, 13857 .hp_nid = 0x03,
13749 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13858 .num_channel_mode = ARRAY_SIZE(alc269_modes),
13750 .channel_mode = alc269_modes, 13859 .channel_mode = alc269_modes,
13751 .unsol_event = alc269_eeepc_unsol_event, 13860 .unsol_event = alc269_laptop_unsol_event,
13752 .setup = alc269_eeepc_amic_setup, 13861 .setup = alc269_laptop_amic_setup,
13753 .init_hook = alc269_eeepc_inithook, 13862 .init_hook = alc269_laptop_inithook,
13754 }, 13863 },
13755 [ALC269_ASUS_DMIC] = { 13864 [ALC269_DMIC] = {
13756 .mixers = { alc269_eeepc_mixer }, 13865 .mixers = { alc269_laptop_mixer },
13757 .cap_mixer = alc269_epc_capture_mixer, 13866 .cap_mixer = alc269_laptop_digital_capture_mixer,
13758 .init_verbs = { alc269_init_verbs, 13867 .init_verbs = { alc269_init_verbs,
13759 alc269_eeepc_dmic_init_verbs }, 13868 alc269_laptop_dmic_init_verbs },
13760 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13869 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
13761 .dac_nids = alc269_dac_nids, 13870 .dac_nids = alc269_dac_nids,
13762 .hp_nid = 0x03, 13871 .hp_nid = 0x03,
13763 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13872 .num_channel_mode = ARRAY_SIZE(alc269_modes),
13764 .channel_mode = alc269_modes, 13873 .channel_mode = alc269_modes,
13765 .unsol_event = alc269_eeepc_unsol_event, 13874 .unsol_event = alc269_laptop_unsol_event,
13766 .setup = alc269_eeepc_dmic_setup, 13875 .setup = alc269_laptop_dmic_setup,
13767 .init_hook = alc269_eeepc_inithook, 13876 .init_hook = alc269_laptop_inithook,
13877 },
13878 [ALC269VB_AMIC] = {
13879 .mixers = { alc269vb_laptop_mixer },
13880 .cap_mixer = alc269vb_laptop_analog_capture_mixer,
13881 .init_verbs = { alc269vb_init_verbs,
13882 alc269vb_laptop_amic_init_verbs },
13883 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
13884 .dac_nids = alc269_dac_nids,
13885 .hp_nid = 0x03,
13886 .num_channel_mode = ARRAY_SIZE(alc269_modes),
13887 .channel_mode = alc269_modes,
13888 .unsol_event = alc269_laptop_unsol_event,
13889 .setup = alc269_laptop_amic_setup,
13890 .init_hook = alc269_laptop_inithook,
13891 },
13892 [ALC269VB_DMIC] = {
13893 .mixers = { alc269vb_laptop_mixer },
13894 .cap_mixer = alc269vb_laptop_digital_capture_mixer,
13895 .init_verbs = { alc269vb_init_verbs,
13896 alc269vb_laptop_dmic_init_verbs },
13897 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
13898 .dac_nids = alc269_dac_nids,
13899 .hp_nid = 0x03,
13900 .num_channel_mode = ARRAY_SIZE(alc269_modes),
13901 .channel_mode = alc269_modes,
13902 .unsol_event = alc269_laptop_unsol_event,
13903 .setup = alc269vb_laptop_dmic_setup,
13904 .init_hook = alc269_laptop_inithook,
13768 }, 13905 },
13769 [ALC269_FUJITSU] = { 13906 [ALC269_FUJITSU] = {
13770 .mixers = { alc269_fujitsu_mixer }, 13907 .mixers = { alc269_fujitsu_mixer },
13771 .cap_mixer = alc269_epc_capture_mixer, 13908 .cap_mixer = alc269_laptop_digital_capture_mixer,
13772 .init_verbs = { alc269_init_verbs, 13909 .init_verbs = { alc269_init_verbs,
13773 alc269_eeepc_dmic_init_verbs }, 13910 alc269_laptop_dmic_init_verbs },
13774 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13911 .num_dacs = ARRAY_SIZE(alc269_dac_nids),
13775 .dac_nids = alc269_dac_nids, 13912 .dac_nids = alc269_dac_nids,
13776 .hp_nid = 0x03, 13913 .hp_nid = 0x03,
13777 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13914 .num_channel_mode = ARRAY_SIZE(alc269_modes),
13778 .channel_mode = alc269_modes, 13915 .channel_mode = alc269_modes,
13779 .unsol_event = alc269_eeepc_unsol_event, 13916 .unsol_event = alc269_laptop_unsol_event,
13780 .setup = alc269_eeepc_dmic_setup, 13917 .setup = alc269_laptop_dmic_setup,
13781 .init_hook = alc269_eeepc_inithook, 13918 .init_hook = alc269_laptop_inithook,
13782 }, 13919 },
13783 [ALC269_LIFEBOOK] = { 13920 [ALC269_LIFEBOOK] = {
13784 .mixers = { alc269_lifebook_mixer }, 13921 .mixers = { alc269_lifebook_mixer },
@@ -13799,6 +13936,7 @@ static int patch_alc269(struct hda_codec *codec)
13799 struct alc_spec *spec; 13936 struct alc_spec *spec;
13800 int board_config; 13937 int board_config;
13801 int err; 13938 int err;
13939 int is_alc269vb = 0;
13802 13940
13803 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 13941 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
13804 if (spec == NULL) 13942 if (spec == NULL)
@@ -13815,6 +13953,7 @@ static int patch_alc269(struct hda_codec *codec)
13815 alc_free(codec); 13953 alc_free(codec);
13816 return -ENOMEM; 13954 return -ENOMEM;
13817 } 13955 }
13956 is_alc269vb = 1;
13818 } 13957 }
13819 13958
13820 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, 13959 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
@@ -13850,7 +13989,7 @@ static int patch_alc269(struct hda_codec *codec)
13850 if (board_config != ALC269_AUTO) 13989 if (board_config != ALC269_AUTO)
13851 setup_preset(codec, &alc269_presets[board_config]); 13990 setup_preset(codec, &alc269_presets[board_config]);
13852 13991
13853 if (codec->subsystem_id == 0x17aa3bf8) { 13992 if (board_config == ALC269_QUANTA_FL1) {
13854 /* Due to a hardware problem on Lenovo Ideadpad, we need to 13993 /* Due to a hardware problem on Lenovo Ideadpad, we need to
13855 * fix the sample rate of analog I/O to 44.1kHz 13994 * fix the sample rate of analog I/O to 44.1kHz
13856 */ 13995 */
@@ -13863,9 +14002,16 @@ static int patch_alc269(struct hda_codec *codec)
13863 spec->stream_digital_playback = &alc269_pcm_digital_playback; 14002 spec->stream_digital_playback = &alc269_pcm_digital_playback;
13864 spec->stream_digital_capture = &alc269_pcm_digital_capture; 14003 spec->stream_digital_capture = &alc269_pcm_digital_capture;
13865 14004
13866 spec->adc_nids = alc269_adc_nids; 14005 if (!is_alc269vb) {
13867 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 14006 spec->adc_nids = alc269_adc_nids;
13868 spec->capsrc_nids = alc269_capsrc_nids; 14007 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
14008 spec->capsrc_nids = alc269_capsrc_nids;
14009 } else {
14010 spec->adc_nids = alc269vb_adc_nids;
14011 spec->num_adc_nids = ARRAY_SIZE(alc269vb_adc_nids);
14012 spec->capsrc_nids = alc269vb_capsrc_nids;
14013 }
14014
13869 if (!spec->cap_mixer) 14015 if (!spec->cap_mixer)
13870 set_capture_mixer(codec); 14016 set_capture_mixer(codec);
13871 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 14017 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);