aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorVincent Petry <PVince81@yahoo.fr>2008-11-18 09:21:57 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-20 02:22:24 -0500
commit5b2d1ecac2a79b9438aed731557b8912564cedfd (patch)
treeb76ffcf524961f9f95249ebccf648a75d6cdf7f1 /sound/pci/hda/patch_realtek.c
parent41dda0fdd2cb22d989aa76fbbbd5a6514a3e0802 (diff)
ALSA: hda: Added Realtek ALC888 model entry for Acer Aspire 4930G laptop
Added Realtek ALC888 model entry for the Acer Aspire 4930G laptop that fixes the following features: - internal microphone - heaphone jack sense - channel mode Signed-off-by: Vincent Petry <PVince81@yahoo.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c115
1 files changed, 115 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b7d34390eff4..6ec56c62cb18 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -216,6 +216,7 @@ enum {
216 ALC883_TARGA_2ch_DIG, 216 ALC883_TARGA_2ch_DIG,
217 ALC883_ACER, 217 ALC883_ACER,
218 ALC883_ACER_ASPIRE, 218 ALC883_ACER_ASPIRE,
219 ALC888_ACER_ASPIRE_4930G,
219 ALC883_MEDION, 220 ALC883_MEDION,
220 ALC883_MEDION_MD2, 221 ALC883_MEDION_MD2,
221 ALC883_LAPTOP_EAPD, 222 ALC883_LAPTOP_EAPD,
@@ -1155,6 +1156,90 @@ static void alc_fix_pincfg(struct hda_codec *codec,
1155} 1156}
1156 1157
1157/* 1158/*
1159 * ALC888 Acer Aspire 4930G model
1160 */
1161
1162static struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
1163/* Front Mic: set to PIN_IN (empty by default) */
1164 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1165/* Unselect Front Mic by default in input mixer 3 */
1166 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1167/* enable unsolicited event fpr HP jack */
1168 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1169/* Connect Internal HP to front */
1170 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1171 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1172 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1173/* Connect HP out to front */
1174 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1175 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1176 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1177 { }
1178};
1179
1180static struct hda_input_mux alc888_acer_aspire_4930g_capture_source[2] = {
1181 /* Front mic only available on one ADC */
1182 {
1183 .num_items = 4,
1184 .items = {
1185 { "Mic", 0x0 },
1186 { "Line", 0x2 },
1187 { "CD", 0x4 },
1188 { "Front Mic", 0xb },
1189 },
1190 },
1191 {
1192 .num_items = 3,
1193 .items = {
1194 { "Mic", 0x0 },
1195 { "Line", 0x2 },
1196 { "CD", 0x4 },
1197 },
1198 }
1199};
1200
1201static struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
1202 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1203 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1204 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1205 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1206 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1207 HDA_OUTPUT),
1208 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1209 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1210 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1211 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1212 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1213 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1214 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1215 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1216 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1217 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1218 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
1219 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1220 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
1221 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
1222 { } /* end */
1223};
1224
1225static void alc888_acer_aspire_4930g_automute(struct hda_codec *codec)
1226{
1227 unsigned int present;
1228 present = snd_hda_codec_read(codec, 0x15, 0,
1229 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
1230 /* Toggle the internal HP PIN (regular muting doesn't work) */
1231 snd_hda_codec_write(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
1232 (present ? 0x0 : PIN_OUT));
1233}
1234
1235static void alc888_acer_aspire_4930g_unsol_event(struct hda_codec *codec,
1236 unsigned int res)
1237{
1238 if (res >> 26 == ALC880_HP_EVENT)
1239 alc888_acer_aspire_4930g_automute(codec);
1240}
1241
1242/*
1158 * ALC880 3-stack model 1243 * ALC880 3-stack model
1159 * 1244 *
1160 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e) 1245 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
@@ -6887,8 +6972,15 @@ static hda_nid_t alc883_adc_nids_alt[1] = {
6887 0x08, 6972 0x08,
6888}; 6973};
6889 6974
6975static hda_nid_t alc883_adc_nids_rev[2] = {
6976 /* ADC2-1 */
6977 0x09, 0x08
6978};
6979
6890static hda_nid_t alc883_capsrc_nids[2] = { 0x23, 0x22 }; 6980static hda_nid_t alc883_capsrc_nids[2] = { 0x23, 0x22 };
6891 6981
6982static hda_nid_t alc883_capsrc_nids_rev[2] = { 0x22, 0x23 };
6983
6892/* input MUX */ 6984/* input MUX */
6893/* FIXME: should be a matrix-type input source selection */ 6985/* FIXME: should be a matrix-type input source selection */
6894 6986
@@ -8180,6 +8272,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
8180 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig", 8272 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
8181 [ALC883_ACER] = "acer", 8273 [ALC883_ACER] = "acer",
8182 [ALC883_ACER_ASPIRE] = "acer-aspire", 8274 [ALC883_ACER_ASPIRE] = "acer-aspire",
8275 [ALC888_ACER_ASPIRE_4930G] = "acer-aspire-4930g",
8183 [ALC883_MEDION] = "medion", 8276 [ALC883_MEDION] = "medion",
8184 [ALC883_MEDION_MD2] = "medion-md2", 8277 [ALC883_MEDION_MD2] = "medion-md2",
8185 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 8278 [ALC883_LAPTOP_EAPD] = "laptop-eapd",
@@ -8205,6 +8298,8 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
8205 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), 8298 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
8206 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), 8299 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
8207 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), 8300 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
8301 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
8302 ALC888_ACER_ASPIRE_4930G),
8208 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ 8303 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */
8209 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), 8304 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
8210 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), 8305 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG),
@@ -8376,6 +8471,26 @@ static struct alc_config_preset alc883_presets[] = {
8376 .unsol_event = alc883_acer_aspire_unsol_event, 8471 .unsol_event = alc883_acer_aspire_unsol_event,
8377 .init_hook = alc883_acer_aspire_automute, 8472 .init_hook = alc883_acer_aspire_automute,
8378 }, 8473 },
8474 [ALC888_ACER_ASPIRE_4930G] = {
8475 .mixers = { alc888_acer_aspire_4930g_mixer,
8476 alc883_chmode_mixer },
8477 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
8478 alc888_acer_aspire_4930g_verbs },
8479 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8480 .dac_nids = alc883_dac_nids,
8481 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
8482 .adc_nids = alc883_adc_nids_rev,
8483 .capsrc_nids = alc883_capsrc_nids_rev,
8484 .dig_out_nid = ALC883_DIGOUT_NID,
8485 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
8486 .channel_mode = alc883_3ST_6ch_modes,
8487 .need_dac_fix = 1,
8488 .num_mux_defs =
8489 ARRAY_SIZE(alc888_acer_aspire_4930g_capture_source),
8490 .input_mux = alc888_acer_aspire_4930g_capture_source,
8491 .unsol_event = alc888_acer_aspire_4930g_unsol_event,
8492 .init_hook = alc888_acer_aspire_4930g_automute,
8493 },
8379 [ALC883_MEDION] = { 8494 [ALC883_MEDION] = {
8380 .mixers = { alc883_fivestack_mixer, 8495 .mixers = { alc883_fivestack_mixer,
8381 alc883_chmode_mixer }, 8496 alc883_chmode_mixer },