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.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 224410e8e9e7..aa4c25e0f327 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1896,6 +1896,7 @@ static int alc_init(struct hda_codec *codec)
1896 alc_fix_pll(codec); 1896 alc_fix_pll(codec);
1897 alc_auto_init_amp(codec, spec->init_amp); 1897 alc_auto_init_amp(codec, spec->init_amp);
1898 1898
1899 snd_hda_gen_apply_verbs(codec);
1899 alc_init_special_input_src(codec); 1900 alc_init_special_input_src(codec);
1900 alc_auto_init_std(codec); 1901 alc_auto_init_std(codec);
1901 1902
@@ -2288,6 +2289,7 @@ static void alc_free(struct hda_codec *codec)
2288 alc_shutup(codec); 2289 alc_shutup(codec);
2289 alc_free_kctls(codec); 2290 alc_free_kctls(codec);
2290 alc_free_bind_ctls(codec); 2291 alc_free_bind_ctls(codec);
2292 snd_hda_gen_free(&spec->gen);
2291 kfree(spec); 2293 kfree(spec);
2292 snd_hda_detach_beep_device(codec); 2294 snd_hda_detach_beep_device(codec);
2293} 2295}
@@ -4252,6 +4254,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
4252 return -ENOMEM; 4254 return -ENOMEM;
4253 codec->spec = spec; 4255 codec->spec = spec;
4254 spec->mixer_nid = mixer_nid; 4256 spec->mixer_nid = mixer_nid;
4257 snd_hda_gen_init(&spec->gen);
4255 4258
4256 err = alc_codec_rename_from_preset(codec); 4259 err = alc_codec_rename_from_preset(codec);
4257 if (err < 0) { 4260 if (err < 0) {
@@ -6439,6 +6442,7 @@ enum {
6439 ALC662_FIXUP_ASUS_MODE7, 6442 ALC662_FIXUP_ASUS_MODE7,
6440 ALC662_FIXUP_ASUS_MODE8, 6443 ALC662_FIXUP_ASUS_MODE8,
6441 ALC662_FIXUP_NO_JACK_DETECT, 6444 ALC662_FIXUP_NO_JACK_DETECT,
6445 ALC662_FIXUP_ZOTAC_Z68,
6442}; 6446};
6443 6447
6444static const struct alc_fixup alc662_fixups[] = { 6448static const struct alc_fixup alc662_fixups[] = {
@@ -6588,6 +6592,13 @@ static const struct alc_fixup alc662_fixups[] = {
6588 .type = ALC_FIXUP_FUNC, 6592 .type = ALC_FIXUP_FUNC,
6589 .v.func = alc_fixup_no_jack_detect, 6593 .v.func = alc_fixup_no_jack_detect,
6590 }, 6594 },
6595 [ALC662_FIXUP_ZOTAC_Z68] = {
6596 .type = ALC_FIXUP_PINS,
6597 .v.pins = (const struct alc_pincfg[]) {
6598 { 0x1b, 0x02214020 }, /* Front HP */
6599 { }
6600 }
6601 },
6591}; 6602};
6592 6603
6593static const struct snd_pci_quirk alc662_fixup_tbl[] = { 6604static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -6601,6 +6612,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
6601 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 6612 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
6602 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 6613 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6603 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 6614 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
6615 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
6604 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 6616 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
6605 6617
6606#if 0 6618#if 0
@@ -6676,6 +6688,31 @@ static const struct alc_model_fixup alc662_fixup_models[] = {
6676 {} 6688 {}
6677}; 6689};
6678 6690
6691static void alc662_fill_coef(struct hda_codec *codec)
6692{
6693 int val, coef;
6694
6695 coef = alc_get_coef0(codec);
6696
6697 switch (codec->vendor_id) {
6698 case 0x10ec0662:
6699 if ((coef & 0x00f0) == 0x0030) {
6700 val = alc_read_coef_idx(codec, 0x4); /* EAPD Ctrl */
6701 alc_write_coef_idx(codec, 0x4, val & ~(1<<10));
6702 }
6703 break;
6704 case 0x10ec0272:
6705 case 0x10ec0273:
6706 case 0x10ec0663:
6707 case 0x10ec0665:
6708 case 0x10ec0670:
6709 case 0x10ec0671:
6710 case 0x10ec0672:
6711 val = alc_read_coef_idx(codec, 0xd); /* EAPD Ctrl */
6712 alc_write_coef_idx(codec, 0xd, val | (1<<14));
6713 break;
6714 }
6715}
6679 6716
6680/* 6717/*
6681 */ 6718 */
@@ -6695,12 +6732,8 @@ static int patch_alc662(struct hda_codec *codec)
6695 6732
6696 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6733 alc_fix_pll_init(codec, 0x20, 0x04, 15);
6697 6734
6698 if ((alc_get_coef0(codec) & (1 << 14)) && 6735 spec->init_hook = alc662_fill_coef;
6699 codec->bus->pci->subsystem_vendor == 0x1025 && 6736 alc662_fill_coef(codec);
6700 spec->cdefine.platform_type == 1) {
6701 if (alc_codec_rename(codec, "ALC272X") < 0)
6702 goto error;
6703 }
6704 6737
6705 alc_pick_fixup(codec, alc662_fixup_models, 6738 alc_pick_fixup(codec, alc662_fixup_models,
6706 alc662_fixup_tbl, alc662_fixups); 6739 alc662_fixup_tbl, alc662_fixups);
@@ -6708,6 +6741,13 @@ static int patch_alc662(struct hda_codec *codec)
6708 6741
6709 alc_auto_parse_customize_define(codec); 6742 alc_auto_parse_customize_define(codec);
6710 6743
6744 if ((alc_get_coef0(codec) & (1 << 14)) &&
6745 codec->bus->pci->subsystem_vendor == 0x1025 &&
6746 spec->cdefine.platform_type == 1) {
6747 if (alc_codec_rename(codec, "ALC272X") < 0)
6748 goto error;
6749 }
6750
6711 /* automatic parse from the BIOS config */ 6751 /* automatic parse from the BIOS config */
6712 err = alc662_parse_auto_config(codec); 6752 err = alc662_parse_auto_config(codec);
6713 if (err < 0) 6753 if (err < 0)
@@ -6790,6 +6830,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
6790 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, 6830 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
6791 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, 6831 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
6792 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, 6832 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
6833 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
6793 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 6834 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
6794 .patch = patch_alc861 }, 6835 .patch = patch_alc861 },
6795 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, 6836 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },