aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-21 10:36:15 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:29:29 -0500
commit2e5b9567f7444673a93cbacdcbeb3feacdb4914f (patch)
treeca09ff107a1e28da797e5a2c27f689fed524678f /sound
parentd25695056ff2e1e048cfc8d7dbafaf80c3c46d5d (diff)
[ALSA] hda-codec - Fix AD1988 support
Modules: HDA Codec driver Fix AD1988 support. As default, 6stack model is used. Still no auto-BIOS setup is implemented. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_analog.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 25116a883ca6..3799d8a1afae 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -50,6 +50,7 @@ struct ad198x_spec {
50 50
51 /* capture source */ 51 /* capture source */
52 const struct hda_input_mux *input_mux; 52 const struct hda_input_mux *input_mux;
53 hda_nid_t *capsrc_nids;
53 unsigned int cur_mux[3]; 54 unsigned int cur_mux[3];
54 55
55 /* channel model */ 56 /* channel model */
@@ -91,7 +92,8 @@ static int ad198x_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
91 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 92 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
92 93
93 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, 94 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
94 spec->adc_nids[adc_idx], &spec->cur_mux[adc_idx]); 95 spec->capsrc_nids[adc_idx],
96 &spec->cur_mux[adc_idx]);
95} 97}
96 98
97/* 99/*
@@ -536,6 +538,7 @@ static int patch_ad1986a(struct hda_codec *codec)
536 spec->multiout.dig_out_nid = AD1986A_SPDIF_OUT; 538 spec->multiout.dig_out_nid = AD1986A_SPDIF_OUT;
537 spec->num_adc_nids = 1; 539 spec->num_adc_nids = 1;
538 spec->adc_nids = ad1986a_adc_nids; 540 spec->adc_nids = ad1986a_adc_nids;
541 spec->capsrc_nids = ad1986a_adc_nids;
539 spec->input_mux = &ad1986a_capture_source; 542 spec->input_mux = &ad1986a_capture_source;
540 spec->num_mixers = 1; 543 spec->num_mixers = 1;
541 spec->mixers[0] = ad1986a_mixers; 544 spec->mixers[0] = ad1986a_mixers;
@@ -699,6 +702,7 @@ static int patch_ad1983(struct hda_codec *codec)
699 spec->multiout.dig_out_nid = AD1983_SPDIF_OUT; 702 spec->multiout.dig_out_nid = AD1983_SPDIF_OUT;
700 spec->num_adc_nids = 1; 703 spec->num_adc_nids = 1;
701 spec->adc_nids = ad1983_adc_nids; 704 spec->adc_nids = ad1983_adc_nids;
705 spec->capsrc_nids = ad1983_adc_nids;
702 spec->input_mux = &ad1983_capture_source; 706 spec->input_mux = &ad1983_capture_source;
703 spec->num_mixers = 1; 707 spec->num_mixers = 1;
704 spec->mixers[0] = ad1983_mixers; 708 spec->mixers[0] = ad1983_mixers;
@@ -844,6 +848,7 @@ static int patch_ad1981(struct hda_codec *codec)
844 spec->multiout.dig_out_nid = AD1981_SPDIF_OUT; 848 spec->multiout.dig_out_nid = AD1981_SPDIF_OUT;
845 spec->num_adc_nids = 1; 849 spec->num_adc_nids = 1;
846 spec->adc_nids = ad1981_adc_nids; 850 spec->adc_nids = ad1981_adc_nids;
851 spec->capsrc_nids = ad1981_adc_nids;
847 spec->input_mux = &ad1981_capture_source; 852 spec->input_mux = &ad1981_capture_source;
848 spec->num_mixers = 1; 853 spec->num_mixers = 1;
849 spec->mixers[0] = ad1981_mixers; 854 spec->mixers[0] = ad1981_mixers;
@@ -968,6 +973,10 @@ static hda_nid_t ad1988_adc_nids[3] = {
968 0x08, 0x09, 0x0f 973 0x08, 0x09, 0x0f
969}; 974};
970 975
976static hda_nid_t ad1988_capsrc_nids[3] = {
977 0x0c, 0x0d, 0x0e
978};
979
971#define AD1988_SPDIF_OUT 0x02 980#define AD1988_SPDIF_OUT 0x02
972#define AD1988_SPDIF_IN 0x07 981#define AD1988_SPDIF_IN 0x07
973 982
@@ -1086,7 +1095,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers[] = {
1086 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT), 1095 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT),
1087 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT), 1096 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT),
1088 1097
1089 HDA_CODEC_VOLUME("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1098 HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
1090 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1099 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
1091 1100
1092 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), 1101 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT),
@@ -1121,7 +1130,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers[] = {
1121 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT), 1130 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT),
1122 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT), 1131 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT),
1123 1132
1124 HDA_CODEC_VOLUME("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1133 HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
1125 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1134 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
1126 1135
1127 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), 1136 HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT),
@@ -1153,7 +1162,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
1153 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT), 1162 HDA_CODEC_VOLUME("Beep Playback Volume", 0x10, 0x0, HDA_OUTPUT),
1154 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT), 1163 HDA_CODEC_MUTE("Beep Playback Switch", 0x10, 0x0, HDA_OUTPUT),
1155 1164
1156 HDA_CODEC_VOLUME("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1165 HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
1157 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), 1166 HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
1158 1167
1159 HDA_CODEC_VOLUME("Mic Boost", 0x39, 0x0, HDA_OUTPUT), 1168 HDA_CODEC_VOLUME("Mic Boost", 0x39, 0x0, HDA_OUTPUT),
@@ -1277,11 +1286,11 @@ static struct snd_kcontrol_new ad1988_spdif_in_mixers[] = {
1277 * for 6-stack (+dig) 1286 * for 6-stack (+dig)
1278 */ 1287 */
1279static struct hda_verb ad1988_6stack_init_verbs[] = { 1288static struct hda_verb ad1988_6stack_init_verbs[] = {
1280 /* Front, Surround, CLFE, side DAC; mute as default */ 1289 /* Front, Surround, CLFE, side DAC; unmute as default */
1281 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1290 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1282 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1291 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1283 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1292 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1284 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1293 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1285 /* Port-A front headphon path */ 1294 /* Port-A front headphon path */
1286 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 1295 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */
1287 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 1296 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -1396,11 +1405,11 @@ static struct hda_channel_mode ad1988_3stack_modes[2] = {
1396}; 1405};
1397 1406
1398static struct hda_verb ad1988_3stack_init_verbs[] = { 1407static struct hda_verb ad1988_3stack_init_verbs[] = {
1399 /* Front, Surround, CLFE, side DAC; mute as default */ 1408 /* Front, Surround, CLFE, side DAC; unmute as default */
1400 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1409 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1401 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1410 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1402 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1411 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1403 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1412 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1404 /* Port-A front headphon path */ 1413 /* Port-A front headphon path */
1405 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 1414 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */
1406 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 1415 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -1471,11 +1480,11 @@ static struct hda_verb ad1988_laptop_hp_off[] = {
1471#define AD1988_HP_EVENT 0x01 1480#define AD1988_HP_EVENT 0x01
1472 1481
1473static struct hda_verb ad1988_laptop_init_verbs[] = { 1482static struct hda_verb ad1988_laptop_init_verbs[] = {
1474 /* Front, Surround, CLFE, side DAC; mute as default */ 1483 /* Front, Surround, CLFE, side DAC; unmute as default */
1475 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1484 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1476 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1485 {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1477 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1486 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1478 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 1487 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1479 /* Port-A front headphon path */ 1488 /* Port-A front headphon path */
1480 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */ 1489 {0x37, AC_VERB_SET_CONNECT_SEL, 0x01}, /* DAC1:04h */
1481 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 1490 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -1563,7 +1572,7 @@ static int patch_ad1988(struct hda_codec *codec)
1563 1572
1564 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); 1573 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl);
1565 if (board_config < 0 || board_config >= AD1988_MODEL_LAST) { 1574 if (board_config < 0 || board_config >= AD1988_MODEL_LAST) {
1566 printk(KERN_INFO "hda_codec: Unknown model for ALC880, trying auto-probe from BIOS...\n"); 1575 printk(KERN_INFO "hda_codec: Unknown model for AD1988, using 6stack model...\n");
1567 board_config = AD1988_6STACK; 1576 board_config = AD1988_6STACK;
1568 } 1577 }
1569 1578
@@ -1575,6 +1584,7 @@ static int patch_ad1988(struct hda_codec *codec)
1575 spec->multiout.dac_nids = ad1988_dac_nids; 1584 spec->multiout.dac_nids = ad1988_dac_nids;
1576 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids); 1585 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids);
1577 spec->adc_nids = ad1988_adc_nids; 1586 spec->adc_nids = ad1988_adc_nids;
1587 spec->capsrc_nids = ad1988_capsrc_nids;
1578 spec->input_mux = &ad1988_6stack_capture_source; 1588 spec->input_mux = &ad1988_6stack_capture_source;
1579 spec->num_mixers = 1; 1589 spec->num_mixers = 1;
1580 spec->mixers[0] = ad1988_6stack_mixers; 1590 spec->mixers[0] = ad1988_6stack_mixers;
@@ -1592,6 +1602,7 @@ static int patch_ad1988(struct hda_codec *codec)
1592 spec->multiout.dac_nids = ad1988_dac_nids; 1602 spec->multiout.dac_nids = ad1988_dac_nids;
1593 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids); 1603 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids);
1594 spec->adc_nids = ad1988_adc_nids; 1604 spec->adc_nids = ad1988_adc_nids;
1605 spec->capsrc_nids = ad1988_capsrc_nids;
1595 spec->input_mux = &ad1988_6stack_capture_source; 1606 spec->input_mux = &ad1988_6stack_capture_source;
1596 spec->channel_mode = ad1988_3stack_modes; 1607 spec->channel_mode = ad1988_3stack_modes;
1597 spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes); 1608 spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes);
@@ -1609,6 +1620,7 @@ static int patch_ad1988(struct hda_codec *codec)
1609 spec->multiout.dac_nids = ad1988_dac_nids; 1620 spec->multiout.dac_nids = ad1988_dac_nids;
1610 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids); 1621 spec->num_adc_nids = ARRAY_SIZE(ad1988_adc_nids);
1611 spec->adc_nids = ad1988_adc_nids; 1622 spec->adc_nids = ad1988_adc_nids;
1623 spec->capsrc_nids = ad1988_capsrc_nids;
1612 spec->input_mux = &ad1988_laptop_capture_source; 1624 spec->input_mux = &ad1988_laptop_capture_source;
1613 spec->num_mixers = 1; 1625 spec->num_mixers = 1;
1614 spec->mixers[0] = ad1988_laptop_mixers; 1626 spec->mixers[0] = ad1988_laptop_mixers;