aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorMatt Porter <mporter@embeddedalley.com>2006-07-31 06:49:34 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:39:41 -0400
commitf3302a59cf6961712658db63b66ea5902c17d5e1 (patch)
treeb32ae62fd508fba16a9096ba8f30e883eb164443 /sound/pci/hda
parent7012b2dac71988f61b520b33c70c63be372b5994 (diff)
[ALSA] hda: sigmatel 9205 family support
Adds support for the '9205 family' which includes some other part numbers but 9205 is the first one. These are 4 channel codecs, some have digital mic capability. Support for the digital mic feature will come later. Signed-off-by: Matt Porter <mporter@embeddedalley.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_sigmatel.c102
1 files changed, 102 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ac96336f3484..d572f030c3e9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -136,6 +136,14 @@ static hda_nid_t stac927x_mux_nids[3] = {
136 0x15, 0x16, 0x17 136 0x15, 0x16, 0x17
137}; 137};
138 138
139static hda_nid_t stac9205_adc_nids[2] = {
140 0x12, 0x13
141};
142
143static hda_nid_t stac9205_mux_nids[2] = {
144 0x19, 0x1a
145};
146
139static hda_nid_t stac9200_pin_nids[8] = { 147static hda_nid_t stac9200_pin_nids[8] = {
140 0x08, 0x09, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 148 0x08, 0x09, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
141}; 149};
@@ -151,6 +159,13 @@ static hda_nid_t stac927x_pin_nids[14] = {
151 0x14, 0x21, 0x22, 0x23, 159 0x14, 0x21, 0x22, 0x23,
152}; 160};
153 161
162static hda_nid_t stac9205_pin_nids[12] = {
163 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
164 0x0f, 0x14, 0x16, 0x17, 0x18,
165 0x21, 0x22,
166
167};
168
154static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 169static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
155{ 170{
156 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 171 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
@@ -214,6 +229,12 @@ static struct hda_verb stac927x_core_init[] = {
214 {} 229 {}
215}; 230};
216 231
232static struct hda_verb stac9205_core_init[] = {
233 /* set master volume and direct control */
234 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
235 {}
236};
237
217static struct snd_kcontrol_new stac9200_mixer[] = { 238static struct snd_kcontrol_new stac9200_mixer[] = {
218 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), 239 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT),
219 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), 240 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT),
@@ -277,6 +298,21 @@ static snd_kcontrol_new_t stac927x_mixer[] = {
277 { } /* end */ 298 { } /* end */
278}; 299};
279 300
301static snd_kcontrol_new_t stac9205_mixer[] = {
302 {
303 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
304 .name = "Input Source",
305 .count = 1,
306 .info = stac92xx_mux_enum_info,
307 .get = stac92xx_mux_enum_get,
308 .put = stac92xx_mux_enum_put,
309 },
310 HDA_CODEC_VOLUME("InMux Capture Volume", 0x19, 0x0, HDA_OUTPUT),
311 HDA_CODEC_VOLUME("InVol Capture Volume", 0x1b, 0x0, HDA_INPUT),
312 HDA_CODEC_MUTE("ADCMux Capture Switch", 0x1d, 0x0, HDA_OUTPUT),
313 { } /* end */
314};
315
280static int stac92xx_build_controls(struct hda_codec *codec) 316static int stac92xx_build_controls(struct hda_codec *codec)
281{ 317{
282 struct sigmatel_spec *spec = codec->spec; 318 struct sigmatel_spec *spec = codec->spec;
@@ -415,6 +451,24 @@ static struct hda_board_config stac927x_cfg_tbl[] = {
415 {} /* terminator */ 451 {} /* terminator */
416}; 452};
417 453
454static unsigned int ref9205_pin_configs[12] = {
455 0x40000100, 0x40000100, 0x01016011, 0x01014010,
456 0x01813122, 0x01a19021, 0x40000100, 0x40000100,
457 0x40000100, 0x40000100, 0x01441030, 0x01c41030
458};
459
460static unsigned int *stac9205_brd_tbl[] = {
461 ref9205_pin_configs,
462};
463
464static struct hda_board_config stac9205_cfg_tbl[] = {
465 { .modelname = "ref",
466 .pci_subvendor = PCI_VENDOR_ID_INTEL,
467 .pci_subdevice = 0x2668, /* DFI LanParty */
468 .config = STAC_REF }, /* SigmaTel reference board */
469 {} /* terminator */
470};
471
418static void stac92xx_set_config_regs(struct hda_codec *codec) 472static void stac92xx_set_config_regs(struct hda_codec *codec)
419{ 473{
420 int i; 474 int i;
@@ -1354,6 +1408,46 @@ static int patch_stac927x(struct hda_codec *codec)
1354 return 0; 1408 return 0;
1355} 1409}
1356 1410
1411static int patch_stac9205(struct hda_codec *codec)
1412{
1413 struct sigmatel_spec *spec;
1414 int err;
1415
1416 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1417 if (spec == NULL)
1418 return -ENOMEM;
1419
1420 codec->spec = spec;
1421 spec->board_config = snd_hda_check_board_config(codec, stac9205_cfg_tbl);
1422 if (spec->board_config < 0)
1423 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n");
1424 else {
1425 spec->num_pins = 14;
1426 spec->pin_nids = stac9205_pin_nids;
1427 spec->pin_configs = stac9205_brd_tbl[spec->board_config];
1428 stac92xx_set_config_regs(codec);
1429 }
1430
1431 spec->adc_nids = stac9205_adc_nids;
1432 spec->mux_nids = stac9205_mux_nids;
1433 spec->num_muxes = 3;
1434
1435 spec->init = stac9205_core_init;
1436 spec->mixer = stac9205_mixer;
1437
1438 spec->multiout.dac_nids = spec->dac_nids;
1439
1440 err = stac92xx_parse_auto_config(codec, 0x1f, 0x20);
1441 if (err < 0) {
1442 stac92xx_free(codec);
1443 return err;
1444 }
1445
1446 codec->patch_ops = stac92xx_patch_ops;
1447
1448 return 0;
1449}
1450
1357/* 1451/*
1358 * STAC 7661(?) hack 1452 * STAC 7661(?) hack
1359 */ 1453 */
@@ -1542,5 +1636,13 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = {
1542 { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x }, 1636 { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
1543 { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x }, 1637 { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
1544 { .id = 0x83847661, .name = "STAC7661", .patch = patch_stac7661 }, 1638 { .id = 0x83847661, .name = "STAC7661", .patch = patch_stac7661 },
1639 { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 },
1640 { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 },
1641 { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 },
1642 { .id = 0x838476a3, .name = "STAC9204D", .patch = patch_stac9205 },
1643 { .id = 0x838476a4, .name = "STAC9255", .patch = patch_stac9205 },
1644 { .id = 0x838476a5, .name = "STAC9255D", .patch = patch_stac9205 },
1645 { .id = 0x838476a6, .name = "STAC9254", .patch = patch_stac9205 },
1646 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 },
1545 {} /* terminator */ 1647 {} /* terminator */
1546}; 1648};