diff options
author | Kailang Yang <kailang@realtek.com> | 2012-05-25 02:08:38 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-25 02:08:38 -0400 |
commit | adcc70b249ca77c1197eb62b1645146721ba6e5b (patch) | |
tree | 0c4a215d062af077eeac2ff835322cba49393a68 /sound/pci/hda | |
parent | 3509a03f4dcf7fedb8880180fed3f7f791ce5598 (diff) |
ALSA: hda/realtek - Add new codec support for ALC269VD
Also fix some settings applied only for ALC269VB.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3cb1f7128b5f..1ce7feaed91c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2368,6 +2368,7 @@ static struct alc_codec_rename_table rename_tbl[] = { | |||
2368 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, | 2368 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
2369 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, | 2369 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
2370 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, | 2370 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
2371 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, | ||
2371 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, | 2372 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
2372 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, | 2373 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
2373 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, | 2374 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
@@ -5614,6 +5615,7 @@ enum { | |||
5614 | ALC269_TYPE_ALC269VA, | 5615 | ALC269_TYPE_ALC269VA, |
5615 | ALC269_TYPE_ALC269VB, | 5616 | ALC269_TYPE_ALC269VB, |
5616 | ALC269_TYPE_ALC269VC, | 5617 | ALC269_TYPE_ALC269VC, |
5618 | ALC269_TYPE_ALC269VD, | ||
5617 | }; | 5619 | }; |
5618 | 5620 | ||
5619 | /* | 5621 | /* |
@@ -5625,8 +5627,21 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
5625 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; | 5627 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
5626 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | 5628 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
5627 | struct alc_spec *spec = codec->spec; | 5629 | struct alc_spec *spec = codec->spec; |
5628 | const hda_nid_t *ssids = spec->codec_variant == ALC269_TYPE_ALC269VA ? | 5630 | const hda_nid_t *ssids; |
5629 | alc269va_ssids : alc269_ssids; | 5631 | |
5632 | switch (spec->codec_variant) { | ||
5633 | case ALC269_TYPE_ALC269VA: | ||
5634 | case ALC269_TYPE_ALC269VC: | ||
5635 | ssids = alc269va_ssids; | ||
5636 | break; | ||
5637 | case ALC269_TYPE_ALC269VB: | ||
5638 | case ALC269_TYPE_ALC269VD: | ||
5639 | ssids = alc269_ssids; | ||
5640 | break; | ||
5641 | default: | ||
5642 | ssids = alc269_ssids; | ||
5643 | break; | ||
5644 | } | ||
5630 | 5645 | ||
5631 | return alc_parse_auto_config(codec, alc269_ignore, ssids); | 5646 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
5632 | } | 5647 | } |
@@ -5643,6 +5658,11 @@ static void alc269_toggle_power_output(struct hda_codec *codec, int power_up) | |||
5643 | 5658 | ||
5644 | static void alc269_shutup(struct hda_codec *codec) | 5659 | static void alc269_shutup(struct hda_codec *codec) |
5645 | { | 5660 | { |
5661 | struct alc_spec *spec = codec->spec; | ||
5662 | |||
5663 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) | ||
5664 | return; | ||
5665 | |||
5646 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) | 5666 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) |
5647 | alc269_toggle_power_output(codec, 0); | 5667 | alc269_toggle_power_output(codec, 0); |
5648 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { | 5668 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
@@ -5654,19 +5674,24 @@ static void alc269_shutup(struct hda_codec *codec) | |||
5654 | #ifdef CONFIG_PM | 5674 | #ifdef CONFIG_PM |
5655 | static int alc269_resume(struct hda_codec *codec) | 5675 | static int alc269_resume(struct hda_codec *codec) |
5656 | { | 5676 | { |
5657 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { | 5677 | struct alc_spec *spec = codec->spec; |
5678 | |||
5679 | if (spec->codec_variant == ALC269_TYPE_ALC269VB || | ||
5680 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | ||
5658 | alc269_toggle_power_output(codec, 0); | 5681 | alc269_toggle_power_output(codec, 0); |
5659 | msleep(150); | 5682 | msleep(150); |
5660 | } | 5683 | } |
5661 | 5684 | ||
5662 | codec->patch_ops.init(codec); | 5685 | codec->patch_ops.init(codec); |
5663 | 5686 | ||
5664 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { | 5687 | if (spec->codec_variant == ALC269_TYPE_ALC269VB || |
5688 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { | ||
5665 | alc269_toggle_power_output(codec, 1); | 5689 | alc269_toggle_power_output(codec, 1); |
5666 | msleep(200); | 5690 | msleep(200); |
5667 | } | 5691 | } |
5668 | 5692 | ||
5669 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) | 5693 | if (spec->codec_variant == ALC269_TYPE_ALC269VB || |
5694 | (alc_get_coef0(codec) & 0x00ff) == 0x018) | ||
5670 | alc269_toggle_power_output(codec, 1); | 5695 | alc269_toggle_power_output(codec, 1); |
5671 | 5696 | ||
5672 | snd_hda_codec_resume_amp(codec); | 5697 | snd_hda_codec_resume_amp(codec); |
@@ -6081,6 +6106,9 @@ static int patch_alc269(struct hda_codec *codec) | |||
6081 | err = alc_codec_rename(codec, "ALC3202"); | 6106 | err = alc_codec_rename(codec, "ALC3202"); |
6082 | spec->codec_variant = ALC269_TYPE_ALC269VC; | 6107 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
6083 | break; | 6108 | break; |
6109 | case 0x0030: | ||
6110 | spec->codec_variant = ALC269_TYPE_ALC269VD; | ||
6111 | break; | ||
6084 | default: | 6112 | default: |
6085 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 6113 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
6086 | } | 6114 | } |