aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c110
1 files changed, 91 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5f00589cb791..427da45d7906 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1614,6 +1614,7 @@ do_sku:
1614 spec->init_amp = ALC_INIT_GPIO3; 1614 spec->init_amp = ALC_INIT_GPIO3;
1615 break; 1615 break;
1616 case 5: 1616 case 5:
1617 default:
1617 spec->init_amp = ALC_INIT_DEFAULT; 1618 spec->init_amp = ALC_INIT_DEFAULT;
1618 break; 1619 break;
1619 } 1620 }
@@ -2014,6 +2015,36 @@ static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
2014}; 2015};
2015 2016
2016/* 2017/*
2018 *ALC888 Acer Aspire 7730G model
2019 */
2020
2021static struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
2022/* Bias voltage on for external mic port */
2023 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
2024/* Front Mic: set to PIN_IN (empty by default) */
2025 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2026/* Unselect Front Mic by default in input mixer 3 */
2027 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
2028/* Enable unsolicited event for HP jack */
2029 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
2030/* Enable speaker output */
2031 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2032 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2033 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
2034/* Enable headphone output */
2035 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
2036 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2037 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2038 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
2039/*Enable internal subwoofer */
2040 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2041 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2042 {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
2043 {0x17, AC_VERB_SET_EAPD_BTLENABLE, 2},
2044 { }
2045};
2046
2047/*
2017 * ALC889 Acer Aspire 8930G model 2048 * ALC889 Acer Aspire 8930G model
2018 */ 2049 */
2019 2050
@@ -2200,6 +2231,16 @@ static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
2200 spec->autocfg.speaker_pins[2] = 0x17; 2231 spec->autocfg.speaker_pins[2] = 0x17;
2201} 2232}
2202 2233
2234static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec)
2235{
2236 struct alc_spec *spec = codec->spec;
2237
2238 spec->autocfg.hp_pins[0] = 0x15;
2239 spec->autocfg.speaker_pins[0] = 0x14;
2240 spec->autocfg.speaker_pins[1] = 0x16;
2241 spec->autocfg.speaker_pins[2] = 0x17;
2242}
2243
2203static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) 2244static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
2204{ 2245{
2205 struct alc_spec *spec = codec->spec; 2246 struct alc_spec *spec = codec->spec;
@@ -4554,6 +4595,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = {
4554 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU), 4595 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
4555 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW), 4596 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
4556 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG), 4597 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
4598 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
4557 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG), 4599 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
4558 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW), 4600 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
4559 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700), 4601 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
@@ -9524,13 +9566,6 @@ static struct hda_verb alc883_acer_eapd_verbs[] = {
9524 { } 9566 { }
9525}; 9567};
9526 9568
9527static struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
9528 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
9529 {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
9530 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9531 { } /* end */
9532};
9533
9534static void alc888_6st_dell_setup(struct hda_codec *codec) 9569static void alc888_6st_dell_setup(struct hda_codec *codec)
9535{ 9570{
9536 struct alc_spec *spec = codec->spec; 9571 struct alc_spec *spec = codec->spec;
@@ -9831,7 +9866,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
9831 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), 9866 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763),
9832 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), 9867 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
9833 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), 9868 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY),
9834 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2),
9835 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), 9869 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG),
9836 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), 9870 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
9837 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), 9871 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
@@ -10328,7 +10362,7 @@ static struct alc_config_preset alc882_presets[] = {
10328 .const_channel_count = 6, 10362 .const_channel_count = 6,
10329 .input_mux = &alc883_capture_source, 10363 .input_mux = &alc883_capture_source,
10330 .unsol_event = alc_automute_amp_unsol_event, 10364 .unsol_event = alc_automute_amp_unsol_event,
10331 .setup = alc888_acer_aspire_6530g_setup, 10365 .setup = alc888_acer_aspire_7730g_setup,
10332 .init_hook = alc_automute_amp, 10366 .init_hook = alc_automute_amp,
10333 }, 10367 },
10334 [ALC883_MEDION] = { 10368 [ALC883_MEDION] = {
@@ -10796,7 +10830,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)
10796{ 10830{
10797 struct alc_spec *spec = codec->spec; 10831 struct alc_spec *spec = codec->spec;
10798 struct auto_pin_cfg *cfg = &spec->autocfg; 10832 struct auto_pin_cfg *cfg = &spec->autocfg;
10799 int i, err; 10833 int i, err, type;
10834 int type_idx = 0;
10800 hda_nid_t nid; 10835 hda_nid_t nid;
10801 10836
10802 for (i = 0; i < cfg->num_inputs; i++) { 10837 for (i = 0; i < cfg->num_inputs; i++) {
@@ -10805,9 +10840,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)
10805 nid = cfg->inputs[i].pin; 10840 nid = cfg->inputs[i].pin;
10806 if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { 10841 if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) {
10807 char label[32]; 10842 char label[32];
10843 type = cfg->inputs[i].type;
10844 if (i > 0 && type == cfg->inputs[i - 1].type)
10845 type_idx++;
10846 else
10847 type_idx = 0;
10808 snprintf(label, sizeof(label), "%s Boost", 10848 snprintf(label, sizeof(label), "%s Boost",
10809 hda_get_autocfg_input_label(codec, cfg, i)); 10849 hda_get_autocfg_input_label(codec, cfg, i));
10810 err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0, 10850 err = add_control(spec, ALC_CTL_WIDGET_VOL, label,
10851 type_idx,
10811 HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); 10852 HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
10812 if (err < 0) 10853 if (err < 0)
10813 return err; 10854 return err;
@@ -14623,7 +14664,10 @@ static int alc275_setup_dual_adc(struct hda_codec *codec)
14623/* different alc269-variants */ 14664/* different alc269-variants */
14624enum { 14665enum {
14625 ALC269_TYPE_NORMAL, 14666 ALC269_TYPE_NORMAL,
14667 ALC269_TYPE_ALC258,
14626 ALC269_TYPE_ALC259, 14668 ALC269_TYPE_ALC259,
14669 ALC269_TYPE_ALC269VB,
14670 ALC269_TYPE_ALC270,
14627 ALC269_TYPE_ALC271X, 14671 ALC269_TYPE_ALC271X,
14628}; 14672};
14629 14673
@@ -14763,6 +14807,8 @@ static int alc269_resume(struct hda_codec *codec)
14763enum { 14807enum {
14764 ALC269_FIXUP_SONY_VAIO, 14808 ALC269_FIXUP_SONY_VAIO,
14765 ALC269_FIXUP_DELL_M101Z, 14809 ALC269_FIXUP_DELL_M101Z,
14810 ALC269_FIXUP_LENOVO_EDGE14,
14811 ALC269_FIXUP_ASUS_G73JW,
14766}; 14812};
14767 14813
14768static const struct alc_fixup alc269_fixups[] = { 14814static const struct alc_fixup alc269_fixups[] = {
@@ -14780,11 +14826,22 @@ static const struct alc_fixup alc269_fixups[] = {
14780 {} 14826 {}
14781 } 14827 }
14782 }, 14828 },
14829 [ALC269_FIXUP_LENOVO_EDGE14] = {
14830 .sku = ALC_FIXUP_SKU_IGNORE,
14831 },
14832 [ALC269_FIXUP_ASUS_G73JW] = {
14833 .pins = (const struct alc_pincfg[]) {
14834 { 0x17, 0x99130111 }, /* subwoofer */
14835 { }
14836 }
14837 },
14783}; 14838};
14784 14839
14785static struct snd_pci_quirk alc269_fixup_tbl[] = { 14840static struct snd_pci_quirk alc269_fixup_tbl[] = {
14786 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 14841 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14787 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 14842 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
14843 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_LENOVO_EDGE14),
14844 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
14788 {} 14845 {}
14789}; 14846};
14790 14847
@@ -15023,7 +15080,7 @@ static int alc269_fill_coef(struct hda_codec *codec)
15023static int patch_alc269(struct hda_codec *codec) 15080static int patch_alc269(struct hda_codec *codec)
15024{ 15081{
15025 struct alc_spec *spec; 15082 struct alc_spec *spec;
15026 int board_config; 15083 int board_config, coef;
15027 int err; 15084 int err;
15028 15085
15029 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 15086 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -15034,14 +15091,23 @@ static int patch_alc269(struct hda_codec *codec)
15034 15091
15035 alc_auto_parse_customize_define(codec); 15092 alc_auto_parse_customize_define(codec);
15036 15093
15037 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ 15094 coef = alc_read_coef_idx(codec, 0);
15095 if ((coef & 0x00f0) == 0x0010) {
15038 if (codec->bus->pci->subsystem_vendor == 0x1025 && 15096 if (codec->bus->pci->subsystem_vendor == 0x1025 &&
15039 spec->cdefine.platform_type == 1) { 15097 spec->cdefine.platform_type == 1) {
15040 alc_codec_rename(codec, "ALC271X"); 15098 alc_codec_rename(codec, "ALC271X");
15041 spec->codec_variant = ALC269_TYPE_ALC271X; 15099 spec->codec_variant = ALC269_TYPE_ALC271X;
15042 } else { 15100 } else if ((coef & 0xf000) == 0x1000) {
15101 spec->codec_variant = ALC269_TYPE_ALC270;
15102 } else if ((coef & 0xf000) == 0x2000) {
15043 alc_codec_rename(codec, "ALC259"); 15103 alc_codec_rename(codec, "ALC259");
15044 spec->codec_variant = ALC269_TYPE_ALC259; 15104 spec->codec_variant = ALC269_TYPE_ALC259;
15105 } else if ((coef & 0xf000) == 0x3000) {
15106 alc_codec_rename(codec, "ALC258");
15107 spec->codec_variant = ALC269_TYPE_ALC258;
15108 } else {
15109 alc_codec_rename(codec, "ALC269VB");
15110 spec->codec_variant = ALC269_TYPE_ALC269VB;
15045 } 15111 }
15046 } else 15112 } else
15047 alc_fix_pll_init(codec, 0x20, 0x04, 15); 15113 alc_fix_pll_init(codec, 0x20, 0x04, 15);
@@ -15104,7 +15170,7 @@ static int patch_alc269(struct hda_codec *codec)
15104 spec->stream_digital_capture = &alc269_pcm_digital_capture; 15170 spec->stream_digital_capture = &alc269_pcm_digital_capture;
15105 15171
15106 if (!spec->adc_nids) { /* wasn't filled automatically? use default */ 15172 if (!spec->adc_nids) { /* wasn't filled automatically? use default */
15107 if (spec->codec_variant != ALC269_TYPE_NORMAL) { 15173 if (spec->codec_variant == ALC269_TYPE_NORMAL) {
15108 spec->adc_nids = alc269_adc_nids; 15174 spec->adc_nids = alc269_adc_nids;
15109 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 15175 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
15110 spec->capsrc_nids = alc269_capsrc_nids; 15176 spec->capsrc_nids = alc269_capsrc_nids;
@@ -16898,7 +16964,7 @@ static struct alc_config_preset alc861vd_presets[] = {
16898static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 16964static int alc861vd_auto_create_input_ctls(struct hda_codec *codec,
16899 const struct auto_pin_cfg *cfg) 16965 const struct auto_pin_cfg *cfg)
16900{ 16966{
16901 return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); 16967 return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x22, 0);
16902} 16968}
16903 16969
16904 16970
@@ -18952,6 +19018,8 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid)
18952 return 0x02; 19018 return 0x02;
18953 else if (nid >= 0x0c && nid <= 0x0e) 19019 else if (nid >= 0x0c && nid <= 0x0e)
18954 return nid - 0x0c + 0x02; 19020 return nid - 0x0c + 0x02;
19021 else if (nid == 0x26) /* ALC887-VD has this DAC too */
19022 return 0x25;
18955 else 19023 else
18956 return 0; 19024 return 0;
18957} 19025}
@@ -18960,7 +19028,7 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid)
18960static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin, 19028static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin,
18961 hda_nid_t dac) 19029 hda_nid_t dac)
18962{ 19030{
18963 hda_nid_t mix[4]; 19031 hda_nid_t mix[5];
18964 int i, num; 19032 int i, num;
18965 19033
18966 num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix)); 19034 num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix));
@@ -19298,6 +19366,7 @@ static const struct alc_fixup alc662_fixups[] = {
19298 19366
19299static struct snd_pci_quirk alc662_fixup_tbl[] = { 19367static struct snd_pci_quirk alc662_fixup_tbl[] = {
19300 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 19368 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
19369 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
19301 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 19370 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
19302 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 19371 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
19303 {} 19372 {}
@@ -19419,7 +19488,10 @@ static int patch_alc888(struct hda_codec *codec)
19419{ 19488{
19420 if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){ 19489 if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){
19421 kfree(codec->chip_name); 19490 kfree(codec->chip_name);
19422 codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); 19491 if (codec->vendor_id == 0x10ec0887)
19492 codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL);
19493 else
19494 codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL);
19423 if (!codec->chip_name) { 19495 if (!codec->chip_name) {
19424 alc_free(codec); 19496 alc_free(codec);
19425 return -ENOMEM; 19497 return -ENOMEM;
@@ -19909,7 +19981,7 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
19909 { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", 19981 { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
19910 .patch = patch_alc882 }, 19982 .patch = patch_alc882 },
19911 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, 19983 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
19912 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, 19984 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 },
19913 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 19985 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
19914 .patch = patch_alc882 }, 19986 .patch = patch_alc882 },
19915 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 }, 19987 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },