diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f8f4906e498d..aa4c25e0f327 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2289,6 +2289,7 @@ static void alc_free(struct hda_codec *codec) | |||
2289 | alc_shutup(codec); | 2289 | alc_shutup(codec); |
2290 | alc_free_kctls(codec); | 2290 | alc_free_kctls(codec); |
2291 | alc_free_bind_ctls(codec); | 2291 | alc_free_bind_ctls(codec); |
2292 | snd_hda_gen_free(&spec->gen); | ||
2292 | kfree(spec); | 2293 | kfree(spec); |
2293 | snd_hda_detach_beep_device(codec); | 2294 | snd_hda_detach_beep_device(codec); |
2294 | } | 2295 | } |
@@ -4253,6 +4254,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |||
4253 | return -ENOMEM; | 4254 | return -ENOMEM; |
4254 | codec->spec = spec; | 4255 | codec->spec = spec; |
4255 | spec->mixer_nid = mixer_nid; | 4256 | spec->mixer_nid = mixer_nid; |
4257 | snd_hda_gen_init(&spec->gen); | ||
4256 | 4258 | ||
4257 | err = alc_codec_rename_from_preset(codec); | 4259 | err = alc_codec_rename_from_preset(codec); |
4258 | if (err < 0) { | 4260 | if (err < 0) { |
@@ -6686,6 +6688,31 @@ static const struct alc_model_fixup alc662_fixup_models[] = { | |||
6686 | {} | 6688 | {} |
6687 | }; | 6689 | }; |
6688 | 6690 | ||
6691 | static 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 | } | ||
6689 | 6716 | ||
6690 | /* | 6717 | /* |
6691 | */ | 6718 | */ |
@@ -6705,12 +6732,8 @@ static int patch_alc662(struct hda_codec *codec) | |||
6705 | 6732 | ||
6706 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 6733 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
6707 | 6734 | ||
6708 | if ((alc_get_coef0(codec) & (1 << 14)) && | 6735 | spec->init_hook = alc662_fill_coef; |
6709 | codec->bus->pci->subsystem_vendor == 0x1025 && | 6736 | alc662_fill_coef(codec); |
6710 | spec->cdefine.platform_type == 1) { | ||
6711 | if (alc_codec_rename(codec, "ALC272X") < 0) | ||
6712 | goto error; | ||
6713 | } | ||
6714 | 6737 | ||
6715 | alc_pick_fixup(codec, alc662_fixup_models, | 6738 | alc_pick_fixup(codec, alc662_fixup_models, |
6716 | alc662_fixup_tbl, alc662_fixups); | 6739 | alc662_fixup_tbl, alc662_fixups); |
@@ -6718,6 +6741,13 @@ static int patch_alc662(struct hda_codec *codec) | |||
6718 | 6741 | ||
6719 | alc_auto_parse_customize_define(codec); | 6742 | alc_auto_parse_customize_define(codec); |
6720 | 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 | |||
6721 | /* automatic parse from the BIOS config */ | 6751 | /* automatic parse from the BIOS config */ |
6722 | err = alc662_parse_auto_config(codec); | 6752 | err = alc662_parse_auto_config(codec); |
6723 | if (err < 0) | 6753 | if (err < 0) |
@@ -6800,6 +6830,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { | |||
6800 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, | 6830 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, |
6801 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, | 6831 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, |
6802 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, | 6832 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, |
6833 | { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, | ||
6803 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", | 6834 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", |
6804 | .patch = patch_alc861 }, | 6835 | .patch = patch_alc861 }, |
6805 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, | 6836 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, |