aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-01-19 09:46:37 -0500
committerTakashi Iwai <tiwai@suse.de>2010-01-19 09:50:26 -0500
commit3fb4a508b8e7957aa899f32cd6d9d462e102c7ca (patch)
treeb2cf780d6907b92d1b90bd82f9578c5f9d765205 /sound
parent4feabefe53eb3742f0b2773a43200d1686f3a288 (diff)
ALSA: hda - Turn on EAPD only if available for Realtek codecs
Some codecs disable widgets used for output pins and reserve as vendor- spec widgets. Thus we need to check the widget type and pin cap before actually sending SET_EAPD verbs in the auto-configuration mode. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 79cdae324c5e..6ae610c0111e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1093,6 +1093,16 @@ static void alc889_coef_init(struct hda_codec *codec)
1093 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010); 1093 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010);
1094} 1094}
1095 1095
1096/* turn on/off EAPD control (only if available) */
1097static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
1098{
1099 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
1100 return;
1101 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
1102 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
1103 on ? 2 : 0);
1104}
1105
1096static void alc_auto_init_amp(struct hda_codec *codec, int type) 1106static void alc_auto_init_amp(struct hda_codec *codec, int type)
1097{ 1107{
1098 unsigned int tmp; 1108 unsigned int tmp;
@@ -1110,25 +1120,22 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)
1110 case ALC_INIT_DEFAULT: 1120 case ALC_INIT_DEFAULT:
1111 switch (codec->vendor_id) { 1121 switch (codec->vendor_id) {
1112 case 0x10ec0260: 1122 case 0x10ec0260:
1113 snd_hda_codec_write(codec, 0x0f, 0, 1123 set_eapd(codec, 0x0f, 1);
1114 AC_VERB_SET_EAPD_BTLENABLE, 2); 1124 set_eapd(codec, 0x10, 1);
1115 snd_hda_codec_write(codec, 0x10, 0,
1116 AC_VERB_SET_EAPD_BTLENABLE, 2);
1117 break; 1125 break;
1118 case 0x10ec0262: 1126 case 0x10ec0262:
1119 case 0x10ec0267: 1127 case 0x10ec0267:
1120 case 0x10ec0268: 1128 case 0x10ec0268:
1121 case 0x10ec0269: 1129 case 0x10ec0269:
1130 case 0x10ec0270:
1122 case 0x10ec0272: 1131 case 0x10ec0272:
1123 case 0x10ec0660: 1132 case 0x10ec0660:
1124 case 0x10ec0662: 1133 case 0x10ec0662:
1125 case 0x10ec0663: 1134 case 0x10ec0663:
1126 case 0x10ec0862: 1135 case 0x10ec0862:
1127 case 0x10ec0889: 1136 case 0x10ec0889:
1128 snd_hda_codec_write(codec, 0x14, 0, 1137 set_eapd(codec, 0x14, 1);
1129 AC_VERB_SET_EAPD_BTLENABLE, 2); 1138 set_eapd(codec, 0x15, 1);
1130 snd_hda_codec_write(codec, 0x15, 0,
1131 AC_VERB_SET_EAPD_BTLENABLE, 2);
1132 break; 1139 break;
1133 } 1140 }
1134 switch (codec->vendor_id) { 1141 switch (codec->vendor_id) {
@@ -1836,10 +1843,8 @@ static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
1836#ifdef CONFIG_SND_HDA_POWER_SAVE 1843#ifdef CONFIG_SND_HDA_POWER_SAVE
1837static void alc889_power_eapd(struct hda_codec *codec, int power) 1844static void alc889_power_eapd(struct hda_codec *codec, int power)
1838{ 1845{
1839 snd_hda_codec_write(codec, 0x14, 0, 1846 set_eapd(codec, 0x14, power);
1840 AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0); 1847 set_eapd(codec, 0x15, power);
1841 snd_hda_codec_write(codec, 0x15, 0,
1842 AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0);
1843} 1848}
1844#endif 1849#endif
1845 1850