diff options
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 692 |
1 files changed, 464 insertions, 228 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index fe51ef3e49d2..6f4a39273b98 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -37,14 +37,37 @@ | |||
37 | #define NUM_CONTROL_ALLOC 32 | 37 | #define NUM_CONTROL_ALLOC 32 |
38 | #define STAC_HP_EVENT 0x37 | 38 | #define STAC_HP_EVENT 0x37 |
39 | 39 | ||
40 | #define STAC_REF 0 | 40 | enum { |
41 | #define STAC_D945GTP3 1 | 41 | STAC_REF, |
42 | #define STAC_D945GTP5 2 | 42 | STAC_9200_MODELS |
43 | #define STAC_MACMINI 3 | 43 | }; |
44 | #define STAC_922X_MODELS 4 /* number of 922x models */ | 44 | |
45 | #define STAC_D965_3ST 4 | 45 | enum { |
46 | #define STAC_D965_5ST 5 | 46 | STAC_9205_REF, |
47 | #define STAC_927X_MODELS 6 /* number of 922x models */ | 47 | STAC_9205_MODELS |
48 | }; | ||
49 | |||
50 | enum { | ||
51 | STAC_925x_REF, | ||
52 | STAC_M2_2, | ||
53 | STAC_MA6, | ||
54 | STAC_925x_MODELS | ||
55 | }; | ||
56 | |||
57 | enum { | ||
58 | STAC_D945_REF, | ||
59 | STAC_D945GTP3, | ||
60 | STAC_D945GTP5, | ||
61 | STAC_MACMINI, | ||
62 | STAC_922X_MODELS | ||
63 | }; | ||
64 | |||
65 | enum { | ||
66 | STAC_D965_REF, | ||
67 | STAC_D965_3ST, | ||
68 | STAC_D965_5ST, | ||
69 | STAC_927X_MODELS | ||
70 | }; | ||
48 | 71 | ||
49 | struct sigmatel_spec { | 72 | struct sigmatel_spec { |
50 | struct snd_kcontrol_new *mixers[4]; | 73 | struct snd_kcontrol_new *mixers[4]; |
@@ -67,6 +90,9 @@ struct sigmatel_spec { | |||
67 | unsigned int num_adcs; | 90 | unsigned int num_adcs; |
68 | hda_nid_t *mux_nids; | 91 | hda_nid_t *mux_nids; |
69 | unsigned int num_muxes; | 92 | unsigned int num_muxes; |
93 | hda_nid_t *dmic_nids; | ||
94 | unsigned int num_dmics; | ||
95 | hda_nid_t dmux_nid; | ||
70 | hda_nid_t dig_in_nid; | 96 | hda_nid_t dig_in_nid; |
71 | 97 | ||
72 | /* pin widgets */ | 98 | /* pin widgets */ |
@@ -80,6 +106,8 @@ struct sigmatel_spec { | |||
80 | struct snd_kcontrol_new *mixer; | 106 | struct snd_kcontrol_new *mixer; |
81 | 107 | ||
82 | /* capture source */ | 108 | /* capture source */ |
109 | struct hda_input_mux *dinput_mux; | ||
110 | unsigned int cur_dmux; | ||
83 | struct hda_input_mux *input_mux; | 111 | struct hda_input_mux *input_mux; |
84 | unsigned int cur_mux[3]; | 112 | unsigned int cur_mux[3]; |
85 | 113 | ||
@@ -92,6 +120,7 @@ struct sigmatel_spec { | |||
92 | struct auto_pin_cfg autocfg; | 120 | struct auto_pin_cfg autocfg; |
93 | unsigned int num_kctl_alloc, num_kctl_used; | 121 | unsigned int num_kctl_alloc, num_kctl_used; |
94 | struct snd_kcontrol_new *kctl_alloc; | 122 | struct snd_kcontrol_new *kctl_alloc; |
123 | struct hda_input_mux private_dimux; | ||
95 | struct hda_input_mux private_imux; | 124 | struct hda_input_mux private_imux; |
96 | }; | 125 | }; |
97 | 126 | ||
@@ -107,6 +136,18 @@ static hda_nid_t stac9200_dac_nids[1] = { | |||
107 | 0x02, | 136 | 0x02, |
108 | }; | 137 | }; |
109 | 138 | ||
139 | static hda_nid_t stac925x_adc_nids[1] = { | ||
140 | 0x03, | ||
141 | }; | ||
142 | |||
143 | static hda_nid_t stac925x_mux_nids[1] = { | ||
144 | 0x0f, | ||
145 | }; | ||
146 | |||
147 | static hda_nid_t stac925x_dac_nids[1] = { | ||
148 | 0x02, | ||
149 | }; | ||
150 | |||
110 | static hda_nid_t stac922x_adc_nids[2] = { | 151 | static hda_nid_t stac922x_adc_nids[2] = { |
111 | 0x06, 0x07, | 152 | 0x06, 0x07, |
112 | }; | 153 | }; |
@@ -131,11 +172,20 @@ static hda_nid_t stac9205_mux_nids[2] = { | |||
131 | 0x19, 0x1a | 172 | 0x19, 0x1a |
132 | }; | 173 | }; |
133 | 174 | ||
175 | static hda_nid_t stac9205_dmic_nids[3] = { | ||
176 | 0x17, 0x18, 0 | ||
177 | }; | ||
178 | |||
134 | static hda_nid_t stac9200_pin_nids[8] = { | 179 | static hda_nid_t stac9200_pin_nids[8] = { |
135 | 0x08, 0x09, 0x0d, 0x0e, | 180 | 0x08, 0x09, 0x0d, 0x0e, |
136 | 0x0f, 0x10, 0x11, 0x12, | 181 | 0x0f, 0x10, 0x11, 0x12, |
137 | }; | 182 | }; |
138 | 183 | ||
184 | static hda_nid_t stac925x_pin_nids[8] = { | ||
185 | 0x07, 0x08, 0x0a, 0x0b, | ||
186 | 0x0c, 0x0d, 0x10, 0x11, | ||
187 | }; | ||
188 | |||
139 | static hda_nid_t stac922x_pin_nids[10] = { | 189 | static hda_nid_t stac922x_pin_nids[10] = { |
140 | 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, | 190 | 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, |
141 | 0x0f, 0x10, 0x11, 0x15, 0x1b, | 191 | 0x0f, 0x10, 0x11, 0x15, 0x1b, |
@@ -154,6 +204,34 @@ static hda_nid_t stac9205_pin_nids[12] = { | |||
154 | 204 | ||
155 | }; | 205 | }; |
156 | 206 | ||
207 | static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol, | ||
208 | struct snd_ctl_elem_info *uinfo) | ||
209 | { | ||
210 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
211 | struct sigmatel_spec *spec = codec->spec; | ||
212 | return snd_hda_input_mux_info(spec->dinput_mux, uinfo); | ||
213 | } | ||
214 | |||
215 | static int stac92xx_dmux_enum_get(struct snd_kcontrol *kcontrol, | ||
216 | struct snd_ctl_elem_value *ucontrol) | ||
217 | { | ||
218 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
219 | struct sigmatel_spec *spec = codec->spec; | ||
220 | |||
221 | ucontrol->value.enumerated.item[0] = spec->cur_dmux; | ||
222 | return 0; | ||
223 | } | ||
224 | |||
225 | static int stac92xx_dmux_enum_put(struct snd_kcontrol *kcontrol, | ||
226 | struct snd_ctl_elem_value *ucontrol) | ||
227 | { | ||
228 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | ||
229 | struct sigmatel_spec *spec = codec->spec; | ||
230 | |||
231 | return snd_hda_input_mux_put(codec, spec->dinput_mux, ucontrol, | ||
232 | spec->dmux_nid, &spec->cur_dmux); | ||
233 | } | ||
234 | |||
157 | static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 235 | static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
158 | { | 236 | { |
159 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 237 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
@@ -187,6 +265,12 @@ static struct hda_verb stac9200_core_init[] = { | |||
187 | {} | 265 | {} |
188 | }; | 266 | }; |
189 | 267 | ||
268 | static struct hda_verb stac925x_core_init[] = { | ||
269 | /* set dac0mux for dac converter */ | ||
270 | { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
271 | {} | ||
272 | }; | ||
273 | |||
190 | static struct hda_verb stac922x_core_init[] = { | 274 | static struct hda_verb stac922x_core_init[] = { |
191 | /* set master volume and direct control */ | 275 | /* set master volume and direct control */ |
192 | { 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, | 276 | { 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, |
@@ -232,6 +316,23 @@ static struct snd_kcontrol_new stac9200_mixer[] = { | |||
232 | { } /* end */ | 316 | { } /* end */ |
233 | }; | 317 | }; |
234 | 318 | ||
319 | static struct snd_kcontrol_new stac925x_mixer[] = { | ||
320 | HDA_CODEC_VOLUME("Master Playback Volume", 0xe, 0, HDA_OUTPUT), | ||
321 | HDA_CODEC_MUTE("Master Playback Switch", 0xe, 0, HDA_OUTPUT), | ||
322 | { | ||
323 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
324 | .name = "Input Source", | ||
325 | .count = 1, | ||
326 | .info = stac92xx_mux_enum_info, | ||
327 | .get = stac92xx_mux_enum_get, | ||
328 | .put = stac92xx_mux_enum_put, | ||
329 | }, | ||
330 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), | ||
331 | HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT), | ||
332 | HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT), | ||
333 | { } /* end */ | ||
334 | }; | ||
335 | |||
235 | /* This needs to be generated dynamically based on sequence */ | 336 | /* This needs to be generated dynamically based on sequence */ |
236 | static struct snd_kcontrol_new stac922x_mixer[] = { | 337 | static struct snd_kcontrol_new stac922x_mixer[] = { |
237 | { | 338 | { |
@@ -263,7 +364,7 @@ static struct snd_kcontrol_new stac9227_mixer[] = { | |||
263 | { } /* end */ | 364 | { } /* end */ |
264 | }; | 365 | }; |
265 | 366 | ||
266 | static snd_kcontrol_new_t stac927x_mixer[] = { | 367 | static struct snd_kcontrol_new stac927x_mixer[] = { |
267 | { | 368 | { |
268 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 369 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
269 | .name = "Input Source", | 370 | .name = "Input Source", |
@@ -278,7 +379,15 @@ static snd_kcontrol_new_t stac927x_mixer[] = { | |||
278 | { } /* end */ | 379 | { } /* end */ |
279 | }; | 380 | }; |
280 | 381 | ||
281 | static snd_kcontrol_new_t stac9205_mixer[] = { | 382 | static struct snd_kcontrol_new stac9205_mixer[] = { |
383 | { | ||
384 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
385 | .name = "Digital Input Source", | ||
386 | .count = 1, | ||
387 | .info = stac92xx_dmux_enum_info, | ||
388 | .get = stac92xx_dmux_enum_get, | ||
389 | .put = stac92xx_dmux_enum_put, | ||
390 | }, | ||
282 | { | 391 | { |
283 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 392 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
284 | .name = "Input Source", | 393 | .name = "Input Source", |
@@ -327,22 +436,64 @@ static unsigned int ref9200_pin_configs[8] = { | |||
327 | 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, | 436 | 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, |
328 | }; | 437 | }; |
329 | 438 | ||
330 | static unsigned int *stac9200_brd_tbl[] = { | 439 | static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = { |
331 | ref9200_pin_configs, | 440 | [STAC_REF] = ref9200_pin_configs, |
441 | }; | ||
442 | |||
443 | static const char *stac9200_models[STAC_9200_MODELS] = { | ||
444 | [STAC_REF] = "ref", | ||
332 | }; | 445 | }; |
333 | 446 | ||
334 | static struct hda_board_config stac9200_cfg_tbl[] = { | 447 | static struct snd_pci_quirk stac9200_cfg_tbl[] = { |
335 | { .modelname = "ref", | 448 | /* SigmaTel reference board */ |
336 | .pci_subvendor = PCI_VENDOR_ID_INTEL, | 449 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
337 | .pci_subdevice = 0x2668, /* DFI LanParty */ | 450 | "DFI LanParty", STAC_REF), |
338 | .config = STAC_REF }, | ||
339 | /* Dell laptops have BIOS problem */ | 451 | /* Dell laptops have BIOS problem */ |
340 | { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01b5, | 452 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5, |
341 | .config = STAC_REF }, /* Dell Inspiron 630m */ | 453 | "Dell Inspiron 630m", STAC_REF), |
342 | { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01c2, | 454 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2, |
343 | .config = STAC_REF }, /* Dell Latitude D620 */ | 455 | "Dell Latitude D620", STAC_REF), |
344 | { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01cb, | 456 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb, |
345 | .config = STAC_REF }, /* Dell Latitude 120L */ | 457 | "Dell Latitude 120L", STAC_REF), |
458 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc, | ||
459 | "Dell Latitude D820", STAC_REF), | ||
460 | {} /* terminator */ | ||
461 | }; | ||
462 | |||
463 | static unsigned int ref925x_pin_configs[8] = { | ||
464 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | ||
465 | 0x90a70320, 0x02214210, 0x400003f1, 0x9033032e, | ||
466 | }; | ||
467 | |||
468 | static unsigned int stac925x_MA6_pin_configs[8] = { | ||
469 | 0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021, | ||
470 | 0x90a70320, 0x90100211, 0x400003f1, 0x9033032e, | ||
471 | }; | ||
472 | |||
473 | static unsigned int stac925xM2_2_pin_configs[8] = { | ||
474 | 0x40c003f3, 0x424503f2, 0x041800f4, 0x02a19020, | ||
475 | 0x50a103F0, 0x90100210, 0x400003f1, 0x9033032e, | ||
476 | }; | ||
477 | |||
478 | static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { | ||
479 | [STAC_REF] = ref925x_pin_configs, | ||
480 | [STAC_M2_2] = stac925xM2_2_pin_configs, | ||
481 | [STAC_MA6] = stac925x_MA6_pin_configs, | ||
482 | }; | ||
483 | |||
484 | static const char *stac925x_models[STAC_925x_MODELS] = { | ||
485 | [STAC_REF] = "ref", | ||
486 | [STAC_M2_2] = "m2-2", | ||
487 | [STAC_MA6] = "m6", | ||
488 | }; | ||
489 | |||
490 | static struct snd_pci_quirk stac925x_cfg_tbl[] = { | ||
491 | /* SigmaTel reference board */ | ||
492 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), | ||
493 | SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF), | ||
494 | SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF), | ||
495 | SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6), | ||
496 | SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2), | ||
346 | {} /* terminator */ | 497 | {} /* terminator */ |
347 | }; | 498 | }; |
348 | 499 | ||
@@ -365,100 +516,80 @@ static unsigned int d945gtp5_pin_configs[10] = { | |||
365 | }; | 516 | }; |
366 | 517 | ||
367 | static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { | 518 | static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { |
368 | [STAC_REF] = ref922x_pin_configs, | 519 | [STAC_D945_REF] = ref922x_pin_configs, |
369 | [STAC_D945GTP3] = d945gtp3_pin_configs, | 520 | [STAC_D945GTP3] = d945gtp3_pin_configs, |
370 | [STAC_D945GTP5] = d945gtp5_pin_configs, | 521 | [STAC_D945GTP5] = d945gtp5_pin_configs, |
371 | [STAC_MACMINI] = d945gtp5_pin_configs, | 522 | [STAC_MACMINI] = d945gtp5_pin_configs, |
372 | }; | 523 | }; |
373 | 524 | ||
374 | static struct hda_board_config stac922x_cfg_tbl[] = { | 525 | static const char *stac922x_models[STAC_922X_MODELS] = { |
375 | { .modelname = "5stack", .config = STAC_D945GTP5 }, | 526 | [STAC_D945_REF] = "ref", |
376 | { .modelname = "3stack", .config = STAC_D945GTP3 }, | 527 | [STAC_D945GTP5] = "5stack", |
377 | { .modelname = "ref", | 528 | [STAC_D945GTP3] = "3stack", |
378 | .pci_subvendor = PCI_VENDOR_ID_INTEL, | 529 | [STAC_MACMINI] = "macmini", |
379 | .pci_subdevice = 0x2668, /* DFI LanParty */ | 530 | }; |
380 | .config = STAC_REF }, /* SigmaTel reference board */ | 531 | |
381 | /* Intel 945G based systems */ | 532 | static struct snd_pci_quirk stac922x_cfg_tbl[] = { |
382 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 533 | /* SigmaTel reference board */ |
383 | .pci_subdevice = 0x0101, | 534 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, |
384 | .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ | 535 | "DFI LanParty", STAC_D945_REF), |
385 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 536 | /* Intel 945G based systems */ |
386 | .pci_subdevice = 0x0202, | 537 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101, |
387 | .config = STAC_D945GTP3 }, /* Intel D945GNT - 3 Stack */ | 538 | "Intel D945G", STAC_D945GTP3), |
388 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 539 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202, |
389 | .pci_subdevice = 0x0606, | 540 | "Intel D945G", STAC_D945GTP3), |
390 | .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ | 541 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606, |
391 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 542 | "Intel D945G", STAC_D945GTP3), |
392 | .pci_subdevice = 0x0601, | 543 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601, |
393 | .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ | 544 | "Intel D945G", STAC_D945GTP3), |
394 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 545 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111, |
395 | .pci_subdevice = 0x0111, | 546 | "Intel D945G", STAC_D945GTP3), |
396 | .config = STAC_D945GTP3 }, /* Intel D945GZP - 3 Stack */ | 547 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115, |
397 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 548 | "Intel D945G", STAC_D945GTP3), |
398 | .pci_subdevice = 0x1115, | 549 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116, |
399 | .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ | 550 | "Intel D945G", STAC_D945GTP3), |
400 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 551 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117, |
401 | .pci_subdevice = 0x1116, | 552 | "Intel D945G", STAC_D945GTP3), |
402 | .config = STAC_D945GTP3 }, /* Intel D945GBO - 3 Stack */ | 553 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118, |
403 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 554 | "Intel D945G", STAC_D945GTP3), |
404 | .pci_subdevice = 0x1117, | 555 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119, |
405 | .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ | 556 | "Intel D945G", STAC_D945GTP3), |
406 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 557 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826, |
407 | .pci_subdevice = 0x1118, | 558 | "Intel D945G", STAC_D945GTP3), |
408 | .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ | 559 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049, |
409 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 560 | "Intel D945G", STAC_D945GTP3), |
410 | .pci_subdevice = 0x1119, | 561 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055, |
411 | .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ | 562 | "Intel D945G", STAC_D945GTP3), |
412 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 563 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048, |
413 | .pci_subdevice = 0x8826, | 564 | "Intel D945G", STAC_D945GTP3), |
414 | .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ | 565 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110, |
415 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 566 | "Intel D945G", STAC_D945GTP3), |
416 | .pci_subdevice = 0x5049, | 567 | /* Intel D945G 5-stack systems */ |
417 | .config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ | 568 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404, |
418 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 569 | "Intel D945G", STAC_D945GTP5), |
419 | .pci_subdevice = 0x5055, | 570 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303, |
420 | .config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ | 571 | "Intel D945G", STAC_D945GTP5), |
421 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 572 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013, |
422 | .pci_subdevice = 0x5048, | 573 | "Intel D945G", STAC_D945GTP5), |
423 | .config = STAC_D945GTP3 }, /* Intel D945GPB - 3 Stack */ | 574 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417, |
424 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 575 | "Intel D945G", STAC_D945GTP5), |
425 | .pci_subdevice = 0x0110, | 576 | /* Intel 945P based systems */ |
426 | .config = STAC_D945GTP3 }, /* Intel D945GLR - 3 Stack */ | 577 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b, |
427 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 578 | "Intel D945P", STAC_D945GTP3), |
428 | .pci_subdevice = 0x0404, | 579 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112, |
429 | .config = STAC_D945GTP5 }, /* Intel D945GTP - 5 Stack */ | 580 | "Intel D945P", STAC_D945GTP3), |
430 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 581 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d, |
431 | .pci_subdevice = 0x0303, | 582 | "Intel D945P", STAC_D945GTP3), |
432 | .config = STAC_D945GTP5 }, /* Intel D945GNT - 5 Stack */ | 583 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909, |
433 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 584 | "Intel D945P", STAC_D945GTP3), |
434 | .pci_subdevice = 0x0013, | 585 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505, |
435 | .config = STAC_D945GTP5 }, /* Intel D955XBK - 5 Stack */ | 586 | "Intel D945P", STAC_D945GTP3), |
436 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 587 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, |
437 | .pci_subdevice = 0x0417, | 588 | "Intel D945P", STAC_D945GTP5), |
438 | .config = STAC_D945GTP5 }, /* Intel D975XBK - 5 Stack */ | 589 | /* other systems */ |
439 | /* Intel 945P based systems */ | 590 | /* Apple Mac Mini (early 2006) */ |
440 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 591 | SND_PCI_QUIRK(0x8384, 0x7680, |
441 | .pci_subdevice = 0x0b0b, | 592 | "Mac Mini", STAC_MACMINI), |
442 | .config = STAC_D945GTP3 }, /* Intel D945PSN - 3 Stack */ | ||
443 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
444 | .pci_subdevice = 0x0112, | ||
445 | .config = STAC_D945GTP3 }, /* Intel D945PLN - 3 Stack */ | ||
446 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
447 | .pci_subdevice = 0x0d0d, | ||
448 | .config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */ | ||
449 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
450 | .pci_subdevice = 0x0909, | ||
451 | .config = STAC_D945GTP3 }, /* Intel D945PAW - 3 Stack */ | ||
452 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
453 | .pci_subdevice = 0x0505, | ||
454 | .config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */ | ||
455 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
456 | .pci_subdevice = 0x0707, | ||
457 | .config = STAC_D945GTP5 }, /* Intel D945PSV - 5 Stack */ | ||
458 | /* other systems */ | ||
459 | { .pci_subvendor = 0x8384, | ||
460 | .pci_subdevice = 0x7680, | ||
461 | .config = STAC_MACMINI }, /* Apple Mac Mini (early 2006) */ | ||
462 | {} /* terminator */ | 593 | {} /* terminator */ |
463 | }; | 594 | }; |
464 | 595 | ||
@@ -484,120 +615,72 @@ static unsigned int d965_5st_pin_configs[14] = { | |||
484 | }; | 615 | }; |
485 | 616 | ||
486 | static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { | 617 | static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { |
487 | [STAC_REF] = ref927x_pin_configs, | 618 | [STAC_D965_REF] = ref927x_pin_configs, |
488 | [STAC_D965_3ST] = d965_3st_pin_configs, | 619 | [STAC_D965_3ST] = d965_3st_pin_configs, |
489 | [STAC_D965_5ST] = d965_5st_pin_configs, | 620 | [STAC_D965_5ST] = d965_5st_pin_configs, |
490 | }; | 621 | }; |
491 | 622 | ||
492 | static struct hda_board_config stac927x_cfg_tbl[] = { | 623 | static const char *stac927x_models[STAC_927X_MODELS] = { |
493 | { .modelname = "5stack", .config = STAC_D965_5ST }, | 624 | [STAC_D965_REF] = "ref", |
494 | { .modelname = "3stack", .config = STAC_D965_3ST }, | 625 | [STAC_D965_3ST] = "3stack", |
495 | { .modelname = "ref", | 626 | [STAC_D965_5ST] = "5stack", |
496 | .pci_subvendor = PCI_VENDOR_ID_INTEL, | 627 | }; |
497 | .pci_subdevice = 0x2668, /* DFI LanParty */ | 628 | |
498 | .config = STAC_REF }, /* SigmaTel reference board */ | 629 | static struct snd_pci_quirk stac927x_cfg_tbl[] = { |
630 | /* SigmaTel reference board */ | ||
631 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, | ||
632 | "DFI LanParty", STAC_D965_REF), | ||
499 | /* Intel 946 based systems */ | 633 | /* Intel 946 based systems */ |
500 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 634 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST), |
501 | .pci_subdevice = 0x3d01, | 635 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST), |
502 | .config = STAC_D965_3ST }, /* D946 configuration */ | ||
503 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
504 | .pci_subdevice = 0xa301, | ||
505 | .config = STAC_D965_3ST }, /* Intel D946GZT - 3 stack */ | ||
506 | /* 965 based 3 stack systems */ | 636 | /* 965 based 3 stack systems */ |
507 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 637 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2116, "Intel D965", STAC_D965_3ST), |
508 | .pci_subdevice = 0x2116, | 638 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2115, "Intel D965", STAC_D965_3ST), |
509 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | 639 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2114, "Intel D965", STAC_D965_3ST), |
510 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 640 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2113, "Intel D965", STAC_D965_3ST), |
511 | .pci_subdevice = 0x2115, | 641 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2112, "Intel D965", STAC_D965_3ST), |
512 | .config = STAC_D965_3ST }, /* Intel DQ965WC - 3 Stack */ | 642 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2111, "Intel D965", STAC_D965_3ST), |
513 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 643 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2110, "Intel D965", STAC_D965_3ST), |
514 | .pci_subdevice = 0x2114, | 644 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2009, "Intel D965", STAC_D965_3ST), |
515 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | 645 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2008, "Intel D965", STAC_D965_3ST), |
516 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 646 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2007, "Intel D965", STAC_D965_3ST), |
517 | .pci_subdevice = 0x2113, | 647 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2006, "Intel D965", STAC_D965_3ST), |
518 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | 648 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2005, "Intel D965", STAC_D965_3ST), |
519 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 649 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2004, "Intel D965", STAC_D965_3ST), |
520 | .pci_subdevice = 0x2112, | 650 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST), |
521 | .config = STAC_D965_3ST }, /* Intel DG965MS - 3 Stack */ | 651 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST), |
522 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 652 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST), |
523 | .pci_subdevice = 0x2111, | ||
524 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
525 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
526 | .pci_subdevice = 0x2110, | ||
527 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
528 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
529 | .pci_subdevice = 0x2009, | ||
530 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
531 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
532 | .pci_subdevice = 0x2008, | ||
533 | .config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */ | ||
534 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
535 | .pci_subdevice = 0x2007, | ||
536 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
537 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
538 | .pci_subdevice = 0x2006, | ||
539 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
540 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
541 | .pci_subdevice = 0x2005, | ||
542 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
543 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
544 | .pci_subdevice = 0x2004, | ||
545 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
546 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
547 | .pci_subdevice = 0x2003, | ||
548 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
549 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
550 | .pci_subdevice = 0x2002, | ||
551 | .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ | ||
552 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
553 | .pci_subdevice = 0x2001, | ||
554 | .config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */ | ||
555 | /* 965 based 5 stack systems */ | 653 | /* 965 based 5 stack systems */ |
556 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 654 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST), |
557 | .pci_subdevice = 0x2301, | 655 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST), |
558 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | 656 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST), |
559 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 657 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2304, "Intel D965", STAC_D965_5ST), |
560 | .pci_subdevice = 0x2302, | 658 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2305, "Intel D965", STAC_D965_5ST), |
561 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | 659 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2501, "Intel D965", STAC_D965_5ST), |
562 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | 660 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2502, "Intel D965", STAC_D965_5ST), |
563 | .pci_subdevice = 0x2303, | 661 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2503, "Intel D965", STAC_D965_5ST), |
564 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | 662 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2504, "Intel D965", STAC_D965_5ST), |
565 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
566 | .pci_subdevice = 0x2304, | ||
567 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | ||
568 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
569 | .pci_subdevice = 0x2305, | ||
570 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | ||
571 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
572 | .pci_subdevice = 0x2501, | ||
573 | .config = STAC_D965_5ST }, /* Intel DG965MQ - 5 Stack */ | ||
574 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
575 | .pci_subdevice = 0x2502, | ||
576 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | ||
577 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
578 | .pci_subdevice = 0x2503, | ||
579 | .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ | ||
580 | { .pci_subvendor = PCI_VENDOR_ID_INTEL, | ||
581 | .pci_subdevice = 0x2504, | ||
582 | .config = STAC_D965_5ST }, /* Intel DQ965GF - 5 Stack */ | ||
583 | {} /* terminator */ | 663 | {} /* terminator */ |
584 | }; | 664 | }; |
585 | 665 | ||
586 | static unsigned int ref9205_pin_configs[12] = { | 666 | static unsigned int ref9205_pin_configs[12] = { |
587 | 0x40000100, 0x40000100, 0x01016011, 0x01014010, | 667 | 0x40000100, 0x40000100, 0x01016011, 0x01014010, |
588 | 0x01813122, 0x01a19021, 0x40000100, 0x40000100, | 668 | 0x01813122, 0x01a19021, 0x40000100, 0x40000100, |
589 | 0x40000100, 0x40000100, 0x01441030, 0x01c41030 | 669 | 0x90a000f0, 0x90a000f0, 0x01441030, 0x01c41030 |
590 | }; | 670 | }; |
591 | 671 | ||
592 | static unsigned int *stac9205_brd_tbl[] = { | 672 | static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = { |
593 | ref9205_pin_configs, | 673 | ref9205_pin_configs, |
594 | }; | 674 | }; |
595 | 675 | ||
596 | static struct hda_board_config stac9205_cfg_tbl[] = { | 676 | static const char *stac9205_models[STAC_9205_MODELS] = { |
597 | { .modelname = "ref", | 677 | [STAC_9205_REF] = "ref", |
598 | .pci_subvendor = PCI_VENDOR_ID_INTEL, | 678 | }; |
599 | .pci_subdevice = 0x2668, /* DFI LanParty */ | 679 | |
600 | .config = STAC_REF }, /* SigmaTel reference board */ | 680 | static struct snd_pci_quirk stac9205_cfg_tbl[] = { |
681 | /* SigmaTel reference board */ | ||
682 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, | ||
683 | "DFI LanParty", STAC_9205_REF), | ||
601 | {} /* terminator */ | 684 | {} /* terminator */ |
602 | }; | 685 | }; |
603 | 686 | ||
@@ -1154,6 +1237,58 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, | |||
1154 | return 0; | 1237 | return 0; |
1155 | } | 1238 | } |
1156 | 1239 | ||
1240 | /* labels for dmic mux inputs */ | ||
1241 | static const char *stac92xx_dmic_labels[5] = { | ||
1242 | "Analog Inputs", "Digital Mic 1", "Digital Mic 2", | ||
1243 | "Digital Mic 3", "Digital Mic 4" | ||
1244 | }; | ||
1245 | |||
1246 | /* create playback/capture controls for input pins on dmic capable codecs */ | ||
1247 | static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec, | ||
1248 | const struct auto_pin_cfg *cfg) | ||
1249 | { | ||
1250 | struct sigmatel_spec *spec = codec->spec; | ||
1251 | struct hda_input_mux *dimux = &spec->private_dimux; | ||
1252 | hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; | ||
1253 | int i, j; | ||
1254 | |||
1255 | dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0]; | ||
1256 | dimux->items[dimux->num_items].index = 0; | ||
1257 | dimux->num_items++; | ||
1258 | |||
1259 | for (i = 0; i < spec->num_dmics; i++) { | ||
1260 | int index; | ||
1261 | int num_cons; | ||
1262 | unsigned int def_conf; | ||
1263 | |||
1264 | def_conf = snd_hda_codec_read(codec, | ||
1265 | spec->dmic_nids[i], | ||
1266 | 0, | ||
1267 | AC_VERB_GET_CONFIG_DEFAULT, | ||
1268 | 0); | ||
1269 | if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) | ||
1270 | continue; | ||
1271 | |||
1272 | num_cons = snd_hda_get_connections(codec, | ||
1273 | spec->dmux_nid, | ||
1274 | con_lst, | ||
1275 | HDA_MAX_NUM_INPUTS); | ||
1276 | for (j = 0; j < num_cons; j++) | ||
1277 | if (con_lst[j] == spec->dmic_nids[i]) { | ||
1278 | index = j; | ||
1279 | goto found; | ||
1280 | } | ||
1281 | continue; | ||
1282 | found: | ||
1283 | dimux->items[dimux->num_items].label = | ||
1284 | stac92xx_dmic_labels[dimux->num_items]; | ||
1285 | dimux->items[dimux->num_items].index = index; | ||
1286 | dimux->num_items++; | ||
1287 | } | ||
1288 | |||
1289 | return 0; | ||
1290 | } | ||
1291 | |||
1157 | /* create playback/capture controls for input pins */ | 1292 | /* create playback/capture controls for input pins */ |
1158 | static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const struct auto_pin_cfg *cfg) | 1293 | static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const struct auto_pin_cfg *cfg) |
1159 | { | 1294 | { |
@@ -1238,7 +1373,9 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
1238 | struct sigmatel_spec *spec = codec->spec; | 1373 | struct sigmatel_spec *spec = codec->spec; |
1239 | int err; | 1374 | int err; |
1240 | 1375 | ||
1241 | if ((err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL)) < 0) | 1376 | if ((err = snd_hda_parse_pin_def_config(codec, |
1377 | &spec->autocfg, | ||
1378 | spec->dmic_nids)) < 0) | ||
1242 | return err; | 1379 | return err; |
1243 | if (! spec->autocfg.line_outs) | 1380 | if (! spec->autocfg.line_outs) |
1244 | return 0; /* can't find valid pin config */ | 1381 | return 0; /* can't find valid pin config */ |
@@ -1254,6 +1391,11 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
1254 | (err = stac92xx_auto_create_analog_input_ctls(codec, &spec->autocfg)) < 0) | 1391 | (err = stac92xx_auto_create_analog_input_ctls(codec, &spec->autocfg)) < 0) |
1255 | return err; | 1392 | return err; |
1256 | 1393 | ||
1394 | if (spec->num_dmics > 0) | ||
1395 | if ((err = stac92xx_auto_create_dmic_input_ctls(codec, | ||
1396 | &spec->autocfg)) < 0) | ||
1397 | return err; | ||
1398 | |||
1257 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 1399 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
1258 | if (spec->multiout.max_channels > 2) | 1400 | if (spec->multiout.max_channels > 2) |
1259 | spec->surr_switch = 1; | 1401 | spec->surr_switch = 1; |
@@ -1267,6 +1409,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out | |||
1267 | spec->mixers[spec->num_mixers++] = spec->kctl_alloc; | 1409 | spec->mixers[spec->num_mixers++] = spec->kctl_alloc; |
1268 | 1410 | ||
1269 | spec->input_mux = &spec->private_imux; | 1411 | spec->input_mux = &spec->private_imux; |
1412 | spec->dinput_mux = &spec->private_dimux; | ||
1270 | 1413 | ||
1271 | return 1; | 1414 | return 1; |
1272 | } | 1415 | } |
@@ -1366,6 +1509,7 @@ static int stac9200_parse_auto_config(struct hda_codec *codec) | |||
1366 | spec->mixers[spec->num_mixers++] = spec->kctl_alloc; | 1509 | spec->mixers[spec->num_mixers++] = spec->kctl_alloc; |
1367 | 1510 | ||
1368 | spec->input_mux = &spec->private_imux; | 1511 | spec->input_mux = &spec->private_imux; |
1512 | spec->dinput_mux = &spec->private_dimux; | ||
1369 | 1513 | ||
1370 | return 1; | 1514 | return 1; |
1371 | } | 1515 | } |
@@ -1448,6 +1592,11 @@ static int stac92xx_init(struct hda_codec *codec) | |||
1448 | stac92xx_auto_set_pinctl(codec, nid, pinctl); | 1592 | stac92xx_auto_set_pinctl(codec, nid, pinctl); |
1449 | } | 1593 | } |
1450 | } | 1594 | } |
1595 | if (spec->num_dmics > 0) | ||
1596 | for (i = 0; i < spec->num_dmics; i++) | ||
1597 | stac92xx_auto_set_pinctl(codec, spec->dmic_nids[i], | ||
1598 | AC_PINCTL_IN_EN); | ||
1599 | |||
1451 | if (cfg->dig_out_pin) | 1600 | if (cfg->dig_out_pin) |
1452 | stac92xx_auto_set_pinctl(codec, cfg->dig_out_pin, | 1601 | stac92xx_auto_set_pinctl(codec, cfg->dig_out_pin, |
1453 | AC_PINCTL_OUT_EN); | 1602 | AC_PINCTL_OUT_EN); |
@@ -1598,7 +1747,9 @@ static int patch_stac9200(struct hda_codec *codec) | |||
1598 | codec->spec = spec; | 1747 | codec->spec = spec; |
1599 | spec->num_pins = 8; | 1748 | spec->num_pins = 8; |
1600 | spec->pin_nids = stac9200_pin_nids; | 1749 | spec->pin_nids = stac9200_pin_nids; |
1601 | spec->board_config = snd_hda_check_board_config(codec, stac9200_cfg_tbl); | 1750 | spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, |
1751 | stac9200_models, | ||
1752 | stac9200_cfg_tbl); | ||
1602 | if (spec->board_config < 0) { | 1753 | if (spec->board_config < 0) { |
1603 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n"); | 1754 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n"); |
1604 | err = stac92xx_save_bios_config_regs(codec); | 1755 | err = stac92xx_save_bios_config_regs(codec); |
@@ -1618,6 +1769,7 @@ static int patch_stac9200(struct hda_codec *codec) | |||
1618 | spec->adc_nids = stac9200_adc_nids; | 1769 | spec->adc_nids = stac9200_adc_nids; |
1619 | spec->mux_nids = stac9200_mux_nids; | 1770 | spec->mux_nids = stac9200_mux_nids; |
1620 | spec->num_muxes = 1; | 1771 | spec->num_muxes = 1; |
1772 | spec->num_dmics = 0; | ||
1621 | 1773 | ||
1622 | spec->init = stac9200_core_init; | 1774 | spec->init = stac9200_core_init; |
1623 | spec->mixer = stac9200_mixer; | 1775 | spec->mixer = stac9200_mixer; |
@@ -1633,6 +1785,56 @@ static int patch_stac9200(struct hda_codec *codec) | |||
1633 | return 0; | 1785 | return 0; |
1634 | } | 1786 | } |
1635 | 1787 | ||
1788 | static int patch_stac925x(struct hda_codec *codec) | ||
1789 | { | ||
1790 | struct sigmatel_spec *spec; | ||
1791 | int err; | ||
1792 | |||
1793 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | ||
1794 | if (spec == NULL) | ||
1795 | return -ENOMEM; | ||
1796 | |||
1797 | codec->spec = spec; | ||
1798 | spec->num_pins = 8; | ||
1799 | spec->pin_nids = stac925x_pin_nids; | ||
1800 | spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, | ||
1801 | stac925x_models, | ||
1802 | stac925x_cfg_tbl); | ||
1803 | if (spec->board_config < 0) { | ||
1804 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n"); | ||
1805 | err = stac92xx_save_bios_config_regs(codec); | ||
1806 | if (err < 0) { | ||
1807 | stac92xx_free(codec); | ||
1808 | return err; | ||
1809 | } | ||
1810 | spec->pin_configs = spec->bios_pin_configs; | ||
1811 | } else if (stac925x_brd_tbl[spec->board_config] != NULL){ | ||
1812 | spec->pin_configs = stac925x_brd_tbl[spec->board_config]; | ||
1813 | stac92xx_set_config_regs(codec); | ||
1814 | } | ||
1815 | |||
1816 | spec->multiout.max_channels = 2; | ||
1817 | spec->multiout.num_dacs = 1; | ||
1818 | spec->multiout.dac_nids = stac925x_dac_nids; | ||
1819 | spec->adc_nids = stac925x_adc_nids; | ||
1820 | spec->mux_nids = stac925x_mux_nids; | ||
1821 | spec->num_muxes = 1; | ||
1822 | spec->num_dmics = 0; | ||
1823 | |||
1824 | spec->init = stac925x_core_init; | ||
1825 | spec->mixer = stac925x_mixer; | ||
1826 | |||
1827 | err = stac92xx_parse_auto_config(codec, 0x8, 0x7); | ||
1828 | if (err < 0) { | ||
1829 | stac92xx_free(codec); | ||
1830 | return err; | ||
1831 | } | ||
1832 | |||
1833 | codec->patch_ops = stac92xx_patch_ops; | ||
1834 | |||
1835 | return 0; | ||
1836 | } | ||
1837 | |||
1636 | static int patch_stac922x(struct hda_codec *codec) | 1838 | static int patch_stac922x(struct hda_codec *codec) |
1637 | { | 1839 | { |
1638 | struct sigmatel_spec *spec; | 1840 | struct sigmatel_spec *spec; |
@@ -1645,7 +1847,9 @@ static int patch_stac922x(struct hda_codec *codec) | |||
1645 | codec->spec = spec; | 1847 | codec->spec = spec; |
1646 | spec->num_pins = 10; | 1848 | spec->num_pins = 10; |
1647 | spec->pin_nids = stac922x_pin_nids; | 1849 | spec->pin_nids = stac922x_pin_nids; |
1648 | spec->board_config = snd_hda_check_board_config(codec, stac922x_cfg_tbl); | 1850 | spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, |
1851 | stac922x_models, | ||
1852 | stac922x_cfg_tbl); | ||
1649 | if (spec->board_config < 0) { | 1853 | if (spec->board_config < 0) { |
1650 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " | 1854 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " |
1651 | "using BIOS defaults\n"); | 1855 | "using BIOS defaults\n"); |
@@ -1663,6 +1867,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
1663 | spec->adc_nids = stac922x_adc_nids; | 1867 | spec->adc_nids = stac922x_adc_nids; |
1664 | spec->mux_nids = stac922x_mux_nids; | 1868 | spec->mux_nids = stac922x_mux_nids; |
1665 | spec->num_muxes = 2; | 1869 | spec->num_muxes = 2; |
1870 | spec->num_dmics = 0; | ||
1666 | 1871 | ||
1667 | spec->init = stac922x_core_init; | 1872 | spec->init = stac922x_core_init; |
1668 | spec->mixer = stac922x_mixer; | 1873 | spec->mixer = stac922x_mixer; |
@@ -1695,7 +1900,9 @@ static int patch_stac927x(struct hda_codec *codec) | |||
1695 | codec->spec = spec; | 1900 | codec->spec = spec; |
1696 | spec->num_pins = 14; | 1901 | spec->num_pins = 14; |
1697 | spec->pin_nids = stac927x_pin_nids; | 1902 | spec->pin_nids = stac927x_pin_nids; |
1698 | spec->board_config = snd_hda_check_board_config(codec, stac927x_cfg_tbl); | 1903 | spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, |
1904 | stac927x_models, | ||
1905 | stac927x_cfg_tbl); | ||
1699 | if (spec->board_config < 0) { | 1906 | if (spec->board_config < 0) { |
1700 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); | 1907 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); |
1701 | err = stac92xx_save_bios_config_regs(codec); | 1908 | err = stac92xx_save_bios_config_regs(codec); |
@@ -1714,6 +1921,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
1714 | spec->adc_nids = stac927x_adc_nids; | 1921 | spec->adc_nids = stac927x_adc_nids; |
1715 | spec->mux_nids = stac927x_mux_nids; | 1922 | spec->mux_nids = stac927x_mux_nids; |
1716 | spec->num_muxes = 3; | 1923 | spec->num_muxes = 3; |
1924 | spec->num_dmics = 0; | ||
1717 | spec->init = d965_core_init; | 1925 | spec->init = d965_core_init; |
1718 | spec->mixer = stac9227_mixer; | 1926 | spec->mixer = stac9227_mixer; |
1719 | break; | 1927 | break; |
@@ -1721,6 +1929,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
1721 | spec->adc_nids = stac927x_adc_nids; | 1929 | spec->adc_nids = stac927x_adc_nids; |
1722 | spec->mux_nids = stac927x_mux_nids; | 1930 | spec->mux_nids = stac927x_mux_nids; |
1723 | spec->num_muxes = 3; | 1931 | spec->num_muxes = 3; |
1932 | spec->num_dmics = 0; | ||
1724 | spec->init = d965_core_init; | 1933 | spec->init = d965_core_init; |
1725 | spec->mixer = stac9227_mixer; | 1934 | spec->mixer = stac9227_mixer; |
1726 | break; | 1935 | break; |
@@ -1728,6 +1937,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
1728 | spec->adc_nids = stac927x_adc_nids; | 1937 | spec->adc_nids = stac927x_adc_nids; |
1729 | spec->mux_nids = stac927x_mux_nids; | 1938 | spec->mux_nids = stac927x_mux_nids; |
1730 | spec->num_muxes = 3; | 1939 | spec->num_muxes = 3; |
1940 | spec->num_dmics = 0; | ||
1731 | spec->init = stac927x_core_init; | 1941 | spec->init = stac927x_core_init; |
1732 | spec->mixer = stac927x_mixer; | 1942 | spec->mixer = stac927x_mixer; |
1733 | } | 1943 | } |
@@ -1757,7 +1967,9 @@ static int patch_stac9205(struct hda_codec *codec) | |||
1757 | codec->spec = spec; | 1967 | codec->spec = spec; |
1758 | spec->num_pins = 14; | 1968 | spec->num_pins = 14; |
1759 | spec->pin_nids = stac9205_pin_nids; | 1969 | spec->pin_nids = stac9205_pin_nids; |
1760 | spec->board_config = snd_hda_check_board_config(codec, stac9205_cfg_tbl); | 1970 | spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS, |
1971 | stac9205_models, | ||
1972 | stac9205_cfg_tbl); | ||
1761 | if (spec->board_config < 0) { | 1973 | if (spec->board_config < 0) { |
1762 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); | 1974 | snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); |
1763 | err = stac92xx_save_bios_config_regs(codec); | 1975 | err = stac92xx_save_bios_config_regs(codec); |
@@ -1773,13 +1985,28 @@ static int patch_stac9205(struct hda_codec *codec) | |||
1773 | 1985 | ||
1774 | spec->adc_nids = stac9205_adc_nids; | 1986 | spec->adc_nids = stac9205_adc_nids; |
1775 | spec->mux_nids = stac9205_mux_nids; | 1987 | spec->mux_nids = stac9205_mux_nids; |
1776 | spec->num_muxes = 3; | 1988 | spec->num_muxes = 2; |
1989 | spec->dmic_nids = stac9205_dmic_nids; | ||
1990 | spec->num_dmics = 2; | ||
1991 | spec->dmux_nid = 0x1d; | ||
1777 | 1992 | ||
1778 | spec->init = stac9205_core_init; | 1993 | spec->init = stac9205_core_init; |
1779 | spec->mixer = stac9205_mixer; | 1994 | spec->mixer = stac9205_mixer; |
1780 | 1995 | ||
1781 | spec->multiout.dac_nids = spec->dac_nids; | 1996 | spec->multiout.dac_nids = spec->dac_nids; |
1782 | 1997 | ||
1998 | /* Configure GPIO0 as EAPD output */ | ||
1999 | snd_hda_codec_write(codec, codec->afg, 0, | ||
2000 | AC_VERB_SET_GPIO_DIRECTION, 0x00000001); | ||
2001 | /* Configure GPIO0 as CMOS */ | ||
2002 | snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0x00000000); | ||
2003 | /* Assert GPIO0 high */ | ||
2004 | snd_hda_codec_write(codec, codec->afg, 0, | ||
2005 | AC_VERB_SET_GPIO_DATA, 0x00000001); | ||
2006 | /* Enable GPIO0 */ | ||
2007 | snd_hda_codec_write(codec, codec->afg, 0, | ||
2008 | AC_VERB_SET_GPIO_MASK, 0x00000001); | ||
2009 | |||
1783 | err = stac92xx_parse_auto_config(codec, 0x1f, 0x20); | 2010 | err = stac92xx_parse_auto_config(codec, 0x1f, 0x20); |
1784 | if (err < 0) { | 2011 | if (err < 0) { |
1785 | stac92xx_free(codec); | 2012 | stac92xx_free(codec); |
@@ -1963,18 +2190,19 @@ enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */ | |||
1963 | /* Unknown. id=0x83847661 and subsys=0x104D1200. */ | 2190 | /* Unknown. id=0x83847661 and subsys=0x104D1200. */ |
1964 | STAC9872K_VAIO, | 2191 | STAC9872K_VAIO, |
1965 | /* AR Series. id=0x83847664 and subsys=104D1300 */ | 2192 | /* AR Series. id=0x83847664 and subsys=104D1300 */ |
1966 | CXD9872AKD_VAIO | 2193 | CXD9872AKD_VAIO, |
1967 | }; | 2194 | STAC_9872_MODELS, |
1968 | 2195 | }; | |
1969 | static struct hda_board_config stac9872_cfg_tbl[] = { | 2196 | |
1970 | { .modelname = "vaio", .config = CXD9872RD_VAIO }, | 2197 | static const char *stac9872_models[STAC_9872_MODELS] = { |
1971 | { .modelname = "vaio-ar", .config = CXD9872AKD_VAIO }, | 2198 | [CXD9872RD_VAIO] = "vaio", |
1972 | { .pci_subvendor = 0x104d, .pci_subdevice = 0x81e6, | 2199 | [CXD9872AKD_VAIO] = "vaio-ar", |
1973 | .config = CXD9872RD_VAIO }, | 2200 | }; |
1974 | { .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef, | 2201 | |
1975 | .config = CXD9872RD_VAIO }, | 2202 | static struct snd_pci_quirk stac9872_cfg_tbl[] = { |
1976 | { .pci_subvendor = 0x104d, .pci_subdevice = 0x81fd, | 2203 | SND_PCI_QUIRK(0x104d, 0x81e6, "Sony VAIO F/S", CXD9872RD_VAIO), |
1977 | .config = CXD9872AKD_VAIO }, | 2204 | SND_PCI_QUIRK(0x104d, 0x81ef, "Sony VAIO F/S", CXD9872RD_VAIO), |
2205 | SND_PCI_QUIRK(0x104d, 0x81fd, "Sony VAIO AR", CXD9872AKD_VAIO), | ||
1978 | {} | 2206 | {} |
1979 | }; | 2207 | }; |
1980 | 2208 | ||
@@ -1983,7 +2211,9 @@ static int patch_stac9872(struct hda_codec *codec) | |||
1983 | struct sigmatel_spec *spec; | 2211 | struct sigmatel_spec *spec; |
1984 | int board_config; | 2212 | int board_config; |
1985 | 2213 | ||
1986 | board_config = snd_hda_check_board_config(codec, stac9872_cfg_tbl); | 2214 | board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS, |
2215 | stac9872_models, | ||
2216 | stac9872_cfg_tbl); | ||
1987 | if (board_config < 0) | 2217 | if (board_config < 0) |
1988 | /* unknown config, let generic-parser do its job... */ | 2218 | /* unknown config, let generic-parser do its job... */ |
1989 | return snd_hda_parse_generic_codec(codec); | 2219 | return snd_hda_parse_generic_codec(codec); |
@@ -2055,6 +2285,12 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = { | |||
2055 | { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x }, | 2285 | { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x }, |
2056 | { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x }, | 2286 | { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x }, |
2057 | { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x }, | 2287 | { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x }, |
2288 | { .id = 0x83847632, .name = "STAC9202", .patch = patch_stac925x }, | ||
2289 | { .id = 0x83847633, .name = "STAC9202D", .patch = patch_stac925x }, | ||
2290 | { .id = 0x83847634, .name = "STAC9250", .patch = patch_stac925x }, | ||
2291 | { .id = 0x83847635, .name = "STAC9250D", .patch = patch_stac925x }, | ||
2292 | { .id = 0x83847636, .name = "STAC9251", .patch = patch_stac925x }, | ||
2293 | { .id = 0x83847637, .name = "STAC9250D", .patch = patch_stac925x }, | ||
2058 | /* The following does not take into account .id=0x83847661 when subsys = | 2294 | /* The following does not take into account .id=0x83847661 when subsys = |
2059 | * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are | 2295 | * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are |
2060 | * currently not fully supported. | 2296 | * currently not fully supported. |