aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com.tw>2008-05-27 06:32:25 -0400
committerTakashi Iwai <tiwai@suse.de>2008-05-27 09:56:22 -0400
commitf9423e7a94eb2dfef3503dde76d17eaf342ab962 (patch)
tree06ababb31667c7b7073dc1464039c4377e86a058
parent2f8932863d243a744ccd3dc005490ad9d2eae478 (diff)
[ALSA] hda - Fix EAPD and COEF setups for realtek codecs
Fixed EAPD and COEF setups for Realtek ALC662/663, 660-VD and 888 codecs. Signed-off-by: Kailang Yang <kailang@realtek.com.tw> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5770b9c3efa..cb3e0283f0c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -780,6 +780,24 @@ static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
780 alc_sku_automute(codec); 780 alc_sku_automute(codec);
781} 781}
782 782
783/* additional initialization for ALC888 variants */
784static void alc888_coef_init(struct hda_codec *codec)
785{
786 unsigned int tmp;
787
788 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0);
789 tmp = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_PROC_COEF, 0);
790 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 7);
791 if ((tmp & 0xf0) == 2)
792 /* alc888S-VC */
793 snd_hda_codec_read(codec, 0x20, 0,
794 AC_VERB_SET_PROC_COEF, 0x830);
795 else
796 /* alc888-VB */
797 snd_hda_codec_read(codec, 0x20, 0,
798 AC_VERB_SET_PROC_COEF, 0x3030);
799}
800
783/* 32-bit subsystem ID for BIOS loading in HD Audio codec. 801/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
784 * 31 ~ 16 : Manufacture ID 802 * 31 ~ 16 : Manufacture ID
785 * 15 ~ 8 : SKU ID 803 * 15 ~ 8 : SKU ID
@@ -855,8 +873,10 @@ do_sku:
855 case 0x10ec0267: 873 case 0x10ec0267:
856 case 0x10ec0268: 874 case 0x10ec0268:
857 case 0x10ec0269: 875 case 0x10ec0269:
876 case 0x10ec0660:
877 case 0x10ec0662:
878 case 0x10ec0663:
858 case 0x10ec0862: 879 case 0x10ec0862:
859 case 0x10ec0662:
860 case 0x10ec0889: 880 case 0x10ec0889:
861 snd_hda_codec_write(codec, 0x14, 0, 881 snd_hda_codec_write(codec, 0x14, 0,
862 AC_VERB_SET_EAPD_BTLENABLE, 2); 882 AC_VERB_SET_EAPD_BTLENABLE, 2);
@@ -881,7 +901,6 @@ do_sku:
881 case 0x10ec0882: 901 case 0x10ec0882:
882 case 0x10ec0883: 902 case 0x10ec0883:
883 case 0x10ec0885: 903 case 0x10ec0885:
884 case 0x10ec0888:
885 case 0x10ec0889: 904 case 0x10ec0889:
886 snd_hda_codec_write(codec, 0x20, 0, 905 snd_hda_codec_write(codec, 0x20, 0,
887 AC_VERB_SET_COEF_INDEX, 7); 906 AC_VERB_SET_COEF_INDEX, 7);
@@ -893,6 +912,9 @@ do_sku:
893 AC_VERB_SET_PROC_COEF, 912 AC_VERB_SET_PROC_COEF,
894 tmp | 0x2010); 913 tmp | 0x2010);
895 break; 914 break;
915 case 0x10ec0888:
916 alc888_coef_init(codec);
917 break;
896 case 0x10ec0267: 918 case 0x10ec0267:
897 case 0x10ec0268: 919 case 0x10ec0268:
898 snd_hda_codec_write(codec, 0x20, 0, 920 snd_hda_codec_write(codec, 0x20, 0,
@@ -8214,6 +8236,9 @@ static int patch_alc883(struct hda_codec *codec)
8214 codec->patch_ops = alc_patch_ops; 8236 codec->patch_ops = alc_patch_ops;
8215 if (board_config == ALC883_AUTO) 8237 if (board_config == ALC883_AUTO)
8216 spec->init_hook = alc883_auto_init; 8238 spec->init_hook = alc883_auto_init;
8239 else if (codec->vendor_id == 0x10ec0888)
8240 spec->init_hook = alc888_coef_init;
8241
8217#ifdef CONFIG_SND_HDA_POWER_SAVE 8242#ifdef CONFIG_SND_HDA_POWER_SAVE
8218 if (!spec->loopback.amplist) 8243 if (!spec->loopback.amplist)
8219 spec->loopback.amplist = alc883_loopbacks; 8244 spec->loopback.amplist = alc883_loopbacks;
@@ -12662,6 +12687,12 @@ static struct hda_verb alc861vd_eapd_verbs[] = {
12662 { } 12687 { }
12663}; 12688};
12664 12689
12690static struct hda_verb alc660vd_eapd_verbs[] = {
12691 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
12692 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
12693 { }
12694};
12695
12665static struct hda_verb alc861vd_lenovo_unsol_verbs[] = { 12696static struct hda_verb alc861vd_lenovo_unsol_verbs[] = {
12666 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 12697 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12667 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 12698 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -13202,6 +13233,8 @@ static int patch_alc861vd(struct hda_codec *codec)
13202 if (codec->vendor_id == 0x10ec0660) { 13233 if (codec->vendor_id == 0x10ec0660) {
13203 spec->stream_name_analog = "ALC660-VD Analog"; 13234 spec->stream_name_analog = "ALC660-VD Analog";
13204 spec->stream_name_digital = "ALC660-VD Digital"; 13235 spec->stream_name_digital = "ALC660-VD Digital";
13236 /* always turn on EAPD */
13237 spec->init_verbs[spec->num_init_verbs++] = alc660vd_eapd_verbs;
13205 } else { 13238 } else {
13206 spec->stream_name_analog = "ALC861VD Analog"; 13239 spec->stream_name_analog = "ALC861VD Analog";
13207 spec->stream_name_digital = "ALC861VD Digital"; 13240 spec->stream_name_digital = "ALC861VD Digital";