aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-11-24 11:07:44 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:02:04 -0500
commitf5fcc13c2fc62da6f75d80189a51c2492afb39c0 (patch)
treea08340173113cd5f64653b81b656f58ecb27a091
parent0b830bac35dd6e3996bee675c3893857da8a4d0a (diff)
[ALSA] hda-codec - Use snd_pci_quirk_lookup() for board config lookup
Use snd_pci_quirk_lookup() for looking up a board config table. The config table is sorted in numerical order of PCI SSIDs. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--Documentation/sound/alsa/hda_codec.txt10
-rw-r--r--sound/pci/hda/hda_codec.c57
-rw-r--r--sound/pci/hda/hda_local.h11
-rw-r--r--sound/pci/hda/patch_analog.c145
-rw-r--r--sound/pci/hda/patch_cmedia.c24
-rw-r--r--sound/pci/hda/patch_conexant.c65
-rw-r--r--sound/pci/hda/patch_realtek.c550
-rw-r--r--sound/pci/hda/patch_sigmatel.c406
8 files changed, 580 insertions, 688 deletions
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt
index 0be57ed8130..4eaae2a4553 100644
--- a/Documentation/sound/alsa/hda_codec.txt
+++ b/Documentation/sound/alsa/hda_codec.txt
@@ -277,11 +277,11 @@ Helper Functions
277snd_hda_get_codec_name() stores the codec name on the given string. 277snd_hda_get_codec_name() stores the codec name on the given string.
278 278
279snd_hda_check_board_config() can be used to obtain the configuration 279snd_hda_check_board_config() can be used to obtain the configuration
280information matching with the device. Define the table with struct 280information matching with the device. Define the model string table
281hda_board_config entries (zero-terminated), and pass it to the 281and the table with struct snd_pci_quirk entries (zero-terminated),
282function. The function checks the modelname given as a module 282and pass it to the function. The function checks the modelname given
283parameter, and PCI subsystem IDs. If the matching entry is found, it 283as a module parameter, and PCI subsystem IDs. If the matching entry
284returns the config field value. 284is found, it returns the config field value.
285 285
286snd_hda_add_new_ctls() can be used to create and add control entries. 286snd_hda_add_new_ctls() can be used to create and add control entries.
287Pass the zero-terminated array of struct snd_kcontrol_new. The same array 287Pass the zero-terminated array of struct snd_kcontrol_new. The same array
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 18bbc87e376..c07d5db6b05 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1714,6 +1714,8 @@ EXPORT_SYMBOL(snd_hda_build_pcms);
1714/** 1714/**
1715 * snd_hda_check_board_config - compare the current codec with the config table 1715 * snd_hda_check_board_config - compare the current codec with the config table
1716 * @codec: the HDA codec 1716 * @codec: the HDA codec
1717 * @num_configs: number of config enums
1718 * @models: array of model name strings
1717 * @tbl: configuration table, terminated by null entries 1719 * @tbl: configuration table, terminated by null entries
1718 * 1720 *
1719 * Compares the modelname or PCI subsystem id of the current codec with the 1721 * Compares the modelname or PCI subsystem id of the current codec with the
@@ -1722,33 +1724,44 @@ EXPORT_SYMBOL(snd_hda_build_pcms);
1722 * 1724 *
1723 * If no entries are matching, the function returns a negative value. 1725 * If no entries are matching, the function returns a negative value.
1724 */ 1726 */
1725int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_config *tbl) 1727int snd_hda_check_board_config(struct hda_codec *codec,
1726{ 1728 int num_configs, const char **models,
1727 const struct hda_board_config *c; 1729 const struct snd_pci_quirk *tbl)
1728 1730{
1729 if (codec->bus->modelname) { 1731 if (codec->bus->modelname && models) {
1730 for (c = tbl; c->modelname || c->pci_subvendor; c++) { 1732 int i;
1731 if (c->modelname && 1733 for (i = 0; i < num_configs; i++) {
1732 ! strcmp(codec->bus->modelname, c->modelname)) { 1734 if (models[i] &&
1733 snd_printd(KERN_INFO "hda_codec: model '%s' is selected\n", c->modelname); 1735 !strcmp(codec->bus->modelname, models[i])) {
1734 return c->config; 1736 snd_printd(KERN_INFO "hda_codec: model '%s' is "
1737 "selected\n", models[i]);
1738 return i;
1735 } 1739 }
1736 } 1740 }
1737 } 1741 }
1738 1742
1739 if (codec->bus->pci) { 1743 if (!codec->bus->pci || !tbl)
1740 u16 subsystem_vendor, subsystem_device; 1744 return -1;
1741 pci_read_config_word(codec->bus->pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor); 1745
1742 pci_read_config_word(codec->bus->pci, PCI_SUBSYSTEM_ID, &subsystem_device); 1746 tbl = snd_pci_quirk_lookup(codec->bus->pci, tbl);
1743 for (c = tbl; c->modelname || c->pci_subvendor; c++) { 1747 if (!tbl)
1744 if (c->pci_subvendor == subsystem_vendor && 1748 return -1;
1745 (! c->pci_subdevice /* all match */|| 1749 if (tbl->value >= 0 && tbl->value < num_configs) {
1746 (c->pci_subdevice == subsystem_device))) { 1750#ifdef CONFIG_SND_DEBUG_DETECT
1747 snd_printdd(KERN_INFO "hda_codec: PCI %x:%x, codec config %d is selected\n", 1751 char tmp[10];
1748 subsystem_vendor, subsystem_device, c->config); 1752 const char *model = NULL;
1749 return c->config; 1753 if (models)
1750 } 1754 model = models[tbl->value];
1755 if (!model) {
1756 sprintf(tmp, "#%d", tbl->value);
1757 model = tmp;
1751 } 1758 }
1759 snd_printdd(KERN_INFO "hda_codec: model '%s' is selected "
1760 "for config %x:%x (%s)\n",
1761 model, tbl->subvendor, tbl->subdevice,
1762 (tbl->name ? tbl->name : "Unknown device"));
1763#endif
1764 return tbl->value;
1752 } 1765 }
1753 return -1; 1766 return -1;
1754} 1767}
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 9ca1baf860b..b2f56d68885 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -173,14 +173,9 @@ static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; }
173/* 173/*
174 * Misc 174 * Misc
175 */ 175 */
176struct hda_board_config { 176int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
177 const char *modelname; 177 const char **modelnames,
178 int config; 178 const struct snd_pci_quirk *pci_list);
179 unsigned short pci_subvendor;
180 unsigned short pci_subdevice;
181};
182
183int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_config *tbl);
184int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); 179int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew);
185 180
186/* 181/*
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 9ce4c9f869b..2e18a716a09 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -787,55 +787,43 @@ static struct hda_verb ad1986a_eapd_init_verbs[] = {
787}; 787};
788 788
789/* models */ 789/* models */
790enum { AD1986A_6STACK, AD1986A_3STACK, AD1986A_LAPTOP, AD1986A_LAPTOP_EAPD }; 790enum {
791 791 AD1986A_6STACK,
792static struct hda_board_config ad1986a_cfg_tbl[] = { 792 AD1986A_3STACK,
793 { .modelname = "6stack", .config = AD1986A_6STACK }, 793 AD1986A_LAPTOP,
794 { .modelname = "3stack", .config = AD1986A_3STACK }, 794 AD1986A_LAPTOP_EAPD,
795 { .pci_subvendor = 0x10de, .pci_subdevice = 0xcb84, 795 AD1986A_MODELS
796 .config = AD1986A_3STACK }, /* ASUS A8N-VM CSM */ 796};
797 { .pci_subvendor = 0x1043, .pci_subdevice = 0x817f, 797
798 .config = AD1986A_3STACK }, /* ASUS P5P-L2 */ 798static const char *ad1986a_models[AD1986A_MODELS] = {
799 { .pci_subvendor = 0x1043, .pci_subdevice = 0x81b3, 799 [AD1986A_6STACK] = "6stack",
800 .config = AD1986A_3STACK }, /* ASUS P5RD2-VM / P5GPL-X SE */ 800 [AD1986A_3STACK] = "3stack",
801 { .pci_subvendor = 0x1043, .pci_subdevice = 0x81cb, 801 [AD1986A_LAPTOP] = "laptop",
802 .config = AD1986A_3STACK }, /* ASUS M2NPV-VM */ 802 [AD1986A_LAPTOP_EAPD] = "laptop-eapd",
803 { .pci_subvendor = 0x1043, .pci_subdevice = 0x8234, 803};
804 .config = AD1986A_3STACK }, /* ASUS M2N-MX */ 804
805 { .pci_subvendor = 0x17aa, .pci_subdevice = 0x1017, 805static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
806 .config = AD1986A_3STACK }, /* Lenovo A60 desktop */ 806 SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD),
807 { .modelname = "laptop", .config = AD1986A_LAPTOP }, 807 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK),
808 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e, 808 SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD),
809 .config = AD1986A_LAPTOP }, /* FSC V2060 */ 809 SND_PCI_QUIRK(0x1043, 0x1213, "ASUS A6J", AD1986A_LAPTOP_EAPD),
810 { .pci_subvendor = 0x17c0, .pci_subdevice = 0x2017, 810 SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", AD1986A_LAPTOP_EAPD),
811 .config = AD1986A_LAPTOP }, /* Samsung M50 */ 811 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS U5F", AD1986A_LAPTOP_EAPD),
812 { .pci_subvendor = 0x1043, .pci_subdevice = 0x818f, 812 SND_PCI_QUIRK(0x1043, 0x1297, "ASUS Z62F", AD1986A_LAPTOP_EAPD),
813 .config = AD1986A_LAPTOP }, /* ASUS P5GV-MX */ 813 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS V1j", AD1986A_LAPTOP_EAPD),
814 { .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD }, 814 SND_PCI_QUIRK(0x1043, 0x1302, "ASUS W3j", AD1986A_LAPTOP_EAPD),
815 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc023, 815 SND_PCI_QUIRK(0x1043, 0x817f, "ASUS P5", AD1986A_3STACK),
816 .config = AD1986A_LAPTOP_EAPD }, /* Samsung X60 Chane */ 816 SND_PCI_QUIRK(0x1043, 0x818f, "ASUS P5", AD1986A_LAPTOP),
817 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc024, 817 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK),
818 .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */ 818 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
819 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc026, 819 SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
820 .config = AD1986A_LAPTOP_EAPD }, /* Samsung X11-T2300 Culesa */ 820 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
821 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1153, 821 SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD),
822 .config = AD1986A_LAPTOP_EAPD }, /* ASUS M9 */ 822 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
823 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213, 823 SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
824 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ 824 SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
825 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, 825 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD),
826 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ 826 SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP),
827 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1263,
828 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5F */
829 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297,
830 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
831 { .pci_subvendor = 0x1043, .pci_subdevice = 0x12b3,
832 .config = AD1986A_LAPTOP_EAPD }, /* ASUS V1j */
833 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1302,
834 .config = AD1986A_LAPTOP_EAPD }, /* ASUS W3j */
835 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
836 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */
837 { .pci_subvendor = 0x17aa, .pci_subdevice = 0x2066,
838 .config = AD1986A_LAPTOP_EAPD }, /* Lenovo 3000 N100-07684JU */
839 {} 827 {}
840}; 828};
841 829
@@ -867,7 +855,9 @@ static int patch_ad1986a(struct hda_codec *codec)
867 codec->patch_ops = ad198x_patch_ops; 855 codec->patch_ops = ad198x_patch_ops;
868 856
869 /* override some parameters */ 857 /* override some parameters */
870 board_config = snd_hda_check_board_config(codec, ad1986a_cfg_tbl); 858 board_config = snd_hda_check_board_config(codec, AD1986A_MODELS,
859 ad1986a_models,
860 ad1986a_cfg_tbl);
871 switch (board_config) { 861 switch (board_config) {
872 case AD1986A_3STACK: 862 case AD1986A_3STACK:
873 spec->num_mixers = 2; 863 spec->num_mixers = 2;
@@ -1397,20 +1387,27 @@ static struct hda_input_mux ad1981_thinkpad_capture_source = {
1397}; 1387};
1398 1388
1399/* models */ 1389/* models */
1400enum { AD1981_BASIC, AD1981_HP, AD1981_THINKPAD }; 1390enum {
1391 AD1981_BASIC,
1392 AD1981_HP,
1393 AD1981_THINKPAD,
1394 AD1981_MODELS
1395};
1401 1396
1402static struct hda_board_config ad1981_cfg_tbl[] = { 1397static const char *ad1981_models[AD1981_MODELS] = {
1403 { .modelname = "hp", .config = AD1981_HP }, 1398 [AD1981_HP] = "hp",
1399 [AD1981_THINKPAD] = "thinkpad",
1400 [AD1981_BASIC] = "basic",
1401};
1402
1403static struct snd_pci_quirk ad1981_cfg_tbl[] = {
1404 /* All HP models */ 1404 /* All HP models */
1405 { .pci_subvendor = 0x103c, .config = AD1981_HP }, 1405 SND_PCI_QUIRK(0x103c, 0, "HP nx", AD1981_HP),
1406 { .pci_subvendor = 0x30b0, .pci_subdevice = 0x103c, 1406 /* HP nx6320 (reversed SSID, H/W bug) */
1407 .config = AD1981_HP }, /* HP nx6320 (reversed SSID, H/W bug) */ 1407 SND_PCI_QUIRK(0x30b0, 0x103c, "HP nx6320", AD1981_HP),
1408 { .modelname = "thinkpad", .config = AD1981_THINKPAD },
1409 /* Lenovo Thinkpad T60/X60/Z6xx */ 1408 /* Lenovo Thinkpad T60/X60/Z6xx */
1410 { .pci_subvendor = 0x17aa, .config = AD1981_THINKPAD }, 1409 SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD),
1411 { .pci_subvendor = 0x1014, .pci_subdevice = 0x0597, 1410 SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
1412 .config = AD1981_THINKPAD }, /* Z60m/t */
1413 { .modelname = "basic", .config = AD1981_BASIC },
1414 {} 1411 {}
1415}; 1412};
1416 1413
@@ -1443,7 +1440,9 @@ static int patch_ad1981(struct hda_codec *codec)
1443 codec->patch_ops = ad198x_patch_ops; 1440 codec->patch_ops = ad198x_patch_ops;
1444 1441
1445 /* override some parameters */ 1442 /* override some parameters */
1446 board_config = snd_hda_check_board_config(codec, ad1981_cfg_tbl); 1443 board_config = snd_hda_check_board_config(codec, AD1981_MODELS,
1444 ad1981_models,
1445 ad1981_cfg_tbl);
1447 switch (board_config) { 1446 switch (board_config) {
1448 case AD1981_HP: 1447 case AD1981_HP:
1449 spec->mixers[0] = ad1981_hp_mixers; 1448 spec->mixers[0] = ad1981_hp_mixers;
@@ -2571,15 +2570,14 @@ static int ad1988_auto_init(struct hda_codec *codec)
2571/* 2570/*
2572 */ 2571 */
2573 2572
2574static struct hda_board_config ad1988_cfg_tbl[] = { 2573static const char *ad1988_models[AD1988_MODEL_LAST] = {
2575 { .modelname = "6stack", .config = AD1988_6STACK }, 2574 [AD1988_6STACK] = "6stack",
2576 { .modelname = "6stack-dig", .config = AD1988_6STACK_DIG }, 2575 [AD1988_6STACK_DIG] = "6stack-dig",
2577 { .modelname = "3stack", .config = AD1988_3STACK }, 2576 [AD1988_3STACK] = "3stack",
2578 { .modelname = "3stack-dig", .config = AD1988_3STACK_DIG }, 2577 [AD1988_3STACK_DIG] = "3stack-dig",
2579 { .modelname = "laptop", .config = AD1988_LAPTOP }, 2578 [AD1988_LAPTOP] = "laptop",
2580 { .modelname = "laptop-dig", .config = AD1988_LAPTOP_DIG }, 2579 [AD1988_LAPTOP_DIG] = "laptop-dig",
2581 { .modelname = "auto", .config = AD1988_AUTO }, 2580 [AD1988_AUTO] = "auto",
2582 {}
2583}; 2581};
2584 2582
2585static int patch_ad1988(struct hda_codec *codec) 2583static int patch_ad1988(struct hda_codec *codec)
@@ -2597,8 +2595,9 @@ static int patch_ad1988(struct hda_codec *codec)
2597 if (is_rev2(codec)) 2595 if (is_rev2(codec))
2598 snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); 2596 snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
2599 2597
2600 board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); 2598 board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST,
2601 if (board_config < 0 || board_config >= AD1988_MODEL_LAST) { 2599 ad1988_models, NULL);
2600 if (board_config < 0) {
2602 printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n"); 2601 printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n");
2603 board_config = AD1988_AUTO; 2602 board_config = AD1988_AUTO;
2604 } 2603 }
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index d38ce22507a..5b9d3a31a1a 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -40,6 +40,7 @@ enum {
40 CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */ 40 CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */
41 CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */ 41 CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */
42 CMI_AUTO, /* let driver guess it */ 42 CMI_AUTO, /* let driver guess it */
43 CMI_MODELS
43}; 44};
44 45
45struct cmi_spec { 46struct cmi_spec {
@@ -603,14 +604,17 @@ static void cmi9880_free(struct hda_codec *codec)
603/* 604/*
604 */ 605 */
605 606
606static struct hda_board_config cmi9880_cfg_tbl[] = { 607static const char *cmi9880_models[CMI_MODELS] = {
607 { .modelname = "minimal", .config = CMI_MINIMAL }, 608 [CMI_MINIMAL] = "minimal",
608 { .modelname = "min_fp", .config = CMI_MIN_FP }, 609 [CMI_MIN_FP] = "min_fp",
609 { .modelname = "full", .config = CMI_FULL }, 610 [CMI_FULL] = "full",
610 { .modelname = "full_dig", .config = CMI_FULL_DIG }, 611 [CMI_FULL_DIG] = "full_dig",
611 { .pci_subvendor = 0x1043, .pci_subdevice = 0x813d, .config = CMI_FULL_DIG }, /* ASUS P5AD2 */ 612 [CMI_ALLOUT] = "allout",
612 { .modelname = "allout", .config = CMI_ALLOUT }, 613 [CMI_AUTO] = "auto",
613 { .modelname = "auto", .config = CMI_AUTO }, 614};
615
616static struct snd_pci_quirk cmi9880_cfg_tbl[] = {
617 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG),
614 {} /* terminator */ 618 {} /* terminator */
615}; 619};
616 620
@@ -633,7 +637,9 @@ static int patch_cmi9880(struct hda_codec *codec)
633 return -ENOMEM; 637 return -ENOMEM;
634 638
635 codec->spec = spec; 639 codec->spec = spec;
636 spec->board_config = snd_hda_check_board_config(codec, cmi9880_cfg_tbl); 640 spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
641 cmi9880_models,
642 cmi9880_cfg_tbl);
637 if (spec->board_config < 0) { 643 if (spec->board_config < 0) {
638 snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n"); 644 snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n");
639 spec->board_config = CMI_AUTO; /* try everything */ 645 spec->board_config = CMI_AUTO; /* try everything */
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7e7d0c110c4..dec8f9747fc 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -802,22 +802,22 @@ static int cxt5045_init(struct hda_codec *codec)
802 802
803 803
804enum { 804enum {
805 CXT5045_LAPTOP, 805 CXT5045_LAPTOP, /* Laptops w/ EAPD support */
806#ifdef CONFIG_SND_DEBUG 806#ifdef CONFIG_SND_DEBUG
807 CXT5045_TEST, 807 CXT5045_TEST,
808#endif 808#endif
809 CXT5045_MODELS
809}; 810};
810 811
811static struct hda_board_config cxt5045_cfg_tbl[] = { 812static const char *cxt5045_models[CXT5045_MODELS] = {
812 /* Laptops w/ EAPD support */ 813 [CXT5045_LAPTOP] = "laptop",
813 { .modelname = "laptop", .config = CXT5045_LAPTOP },
814 /* HP DV6000Z */
815 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b7,
816 .config = CXT5045_LAPTOP },
817#ifdef CONFIG_SND_DEBUG 814#ifdef CONFIG_SND_DEBUG
818 { .modelname = "test", .config = CXT5045_TEST }, 815 [CXT5045_TEST] = "test",
819#endif 816#endif
820 817};
818
819static struct snd_pci_quirk cxt5045_cfg_tbl[] = {
820 SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP),
821 {} 821 {}
822}; 822};
823 823
@@ -852,7 +852,9 @@ static int patch_cxt5045(struct hda_codec *codec)
852 codec->patch_ops = conexant_patch_ops; 852 codec->patch_ops = conexant_patch_ops;
853 codec->patch_ops.unsol_event = cxt5045_hp_unsol_event; 853 codec->patch_ops.unsol_event = cxt5045_hp_unsol_event;
854 854
855 board_config = snd_hda_check_board_config(codec, cxt5045_cfg_tbl); 855 board_config = snd_hda_check_board_config(codec, CXT5045_MODELS,
856 cxt5045_models,
857 cxt5045_cfg_tbl);
856 switch (board_config) { 858 switch (board_config) {
857 case CXT5045_LAPTOP: 859 case CXT5045_LAPTOP:
858 spec->input_mux = &cxt5045_capture_source; 860 spec->input_mux = &cxt5045_capture_source;
@@ -1214,36 +1216,29 @@ static int cxt5047_hp_init(struct hda_codec *codec)
1214 1216
1215 1217
1216enum { 1218enum {
1217 CXT5047_LAPTOP, 1219 CXT5047_LAPTOP, /* Laptops w/o EAPD support */
1220 CXT5047_LAPTOP_HP, /* Some HP laptops */
1221 CXT5047_LAPTOP_EAPD, /* Laptops with EAPD support */
1218#ifdef CONFIG_SND_DEBUG 1222#ifdef CONFIG_SND_DEBUG
1219 CXT5047_TEST, 1223 CXT5047_TEST,
1220#endif 1224#endif
1221 CXT5047_LAPTOP_HP, 1225 CXT5047_MODELS
1222 CXT5047_LAPTOP_EAPD
1223}; 1226};
1224 1227
1225static struct hda_board_config cxt5047_cfg_tbl[] = { 1228static const char *cxt5047_models[CXT5047_MODELS] = {
1226 /* Laptops w/o EAPD support */ 1229 [CXT5047_LAPTOP] = "laptop",
1227 { .modelname = "laptop", .config = CXT5047_LAPTOP }, 1230 [CXT5047_LAPTOP_HP] = "laptop-hp",
1228 /*HP DV1000 */ 1231 [CXT5047_LAPTOP_EAPD] = "laptop-eapd",
1229 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a0,
1230 .config = CXT5047_LAPTOP },
1231 /*HP DV2000T/DV3000T */
1232 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b2,
1233 .config = CXT5047_LAPTOP },
1234 /* Not all HP's are created equal */
1235 { .modelname = "laptop-hp", .config = CXT5047_LAPTOP_HP },
1236 /*HP DV5200TX/DV8000T / Compaq V5209US/V5204NR */
1237 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a5,
1238 .config = CXT5047_LAPTOP_HP },
1239 /* Laptops with EAPD support */
1240 { .modelname = "laptop-eapd", .config = CXT5047_LAPTOP_EAPD },
1241 { .pci_subvendor = 0x1179, .pci_subdevice = 0xff31,
1242 .config = CXT5047_LAPTOP_EAPD }, /* Toshiba P100 */
1243#ifdef CONFIG_SND_DEBUG 1232#ifdef CONFIG_SND_DEBUG
1244 { .modelname = "test", .config = CXT5047_TEST }, 1233 [CXT5047_TEST] = "test",
1245#endif 1234#endif
1246 1235};
1236
1237static struct snd_pci_quirk cxt5047_cfg_tbl[] = {
1238 SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP),
1239 SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP),
1240 SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP),
1241 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD),
1247 {} 1242 {}
1248}; 1243};
1249 1244
@@ -1277,7 +1272,9 @@ static int patch_cxt5047(struct hda_codec *codec)
1277 codec->patch_ops = conexant_patch_ops; 1272 codec->patch_ops = conexant_patch_ops;
1278 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event; 1273 codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
1279 1274
1280 board_config = snd_hda_check_board_config(codec, cxt5047_cfg_tbl); 1275 board_config = snd_hda_check_board_config(codec, CXT5047_MODELS,
1276 cxt5047_models,
1277 cxt5047_cfg_tbl);
1281 switch (board_config) { 1278 switch (board_config) {
1282 case CXT5047_LAPTOP: 1279 case CXT5047_LAPTOP:
1283 break; 1280 break;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 02c465147d9..415a6db4c90 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2328,162 +2328,108 @@ static struct hda_verb alc880_test_init_verbs[] = {
2328/* 2328/*
2329 */ 2329 */
2330 2330
2331static struct hda_board_config alc880_cfg_tbl[] = { 2331static const char *alc880_models[ALC880_MODEL_LAST] = {
2332 /* Back 3 jack, front 2 jack */ 2332 [ALC880_3ST] = "3stack",
2333 { .modelname = "3stack", .config = ALC880_3ST }, 2333 [ALC880_TCL_S700] = "tcl",
2334 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe200, .config = ALC880_3ST }, 2334 [ALC880_3ST_DIG] = "3stack-digout",
2335 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe201, .config = ALC880_3ST }, 2335 [ALC880_CLEVO] = "clevo",
2336 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe202, .config = ALC880_3ST }, 2336 [ALC880_5ST] = "5stack",
2337 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe203, .config = ALC880_3ST }, 2337 [ALC880_5ST_DIG] = "5stack-digout",
2338 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe204, .config = ALC880_3ST }, 2338 [ALC880_W810] = "w810",
2339 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe205, .config = ALC880_3ST }, 2339 [ALC880_Z71V] = "z71v",
2340 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe206, .config = ALC880_3ST }, 2340 [ALC880_6ST] = "6stack",
2341 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe207, .config = ALC880_3ST }, 2341 [ALC880_6ST_DIG] = "6stack-digout",
2342 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe208, .config = ALC880_3ST }, 2342 [ALC880_ASUS] = "asus",
2343 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe209, .config = ALC880_3ST }, 2343 [ALC880_ASUS_W1V] = "asus-w1v",
2344 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20a, .config = ALC880_3ST }, 2344 [ALC880_ASUS_DIG] = "asus-dig",
2345 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20b, .config = ALC880_3ST }, 2345 [ALC880_ASUS_DIG2] = "asus-dig2",
2346 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20c, .config = ALC880_3ST }, 2346 [ALC880_UNIWILL_DIG] = "uniwill",
2347 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20d, .config = ALC880_3ST }, 2347 [ALC880_F1734] = "F1734",
2348 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20e, .config = ALC880_3ST }, 2348 [ALC880_LG] = "lg",
2349 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe20f, .config = ALC880_3ST }, 2349 [ALC880_LG_LW] = "lg-lw",
2350 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe210, .config = ALC880_3ST },
2351 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe211, .config = ALC880_3ST },
2352 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe212, .config = ALC880_3ST },
2353 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe213, .config = ALC880_3ST },
2354 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe214, .config = ALC880_3ST },
2355 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe234, .config = ALC880_3ST },
2356 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe302, .config = ALC880_3ST },
2357 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe303, .config = ALC880_3ST },
2358 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe304, .config = ALC880_3ST },
2359 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe306, .config = ALC880_3ST },
2360 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe307, .config = ALC880_3ST },
2361 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe404, .config = ALC880_3ST },
2362 { .pci_subvendor = 0x8086, .pci_subdevice = 0xa101, .config = ALC880_3ST },
2363 { .pci_subvendor = 0x107b, .pci_subdevice = 0x3031, .config = ALC880_3ST },
2364 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4036, .config = ALC880_3ST },
2365 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4037, .config = ALC880_3ST },
2366 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4038, .config = ALC880_3ST },
2367 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4040, .config = ALC880_3ST },
2368 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4041, .config = ALC880_3ST },
2369 /* TCL S700 */
2370 { .modelname = "tcl", .config = ALC880_TCL_S700 },
2371 { .pci_subvendor = 0x19db, .pci_subdevice = 0x4188, .config = ALC880_TCL_S700 },
2372
2373 /* Back 3 jack, front 2 jack (Internal add Aux-In) */
2374 { .pci_subvendor = 0x1025, .pci_subdevice = 0xe310, .config = ALC880_3ST },
2375 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81d6, .config = ALC880_3ST },
2376 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81a0, .config = ALC880_3ST },
2377
2378 /* Back 3 jack plus 1 SPDIF out jack, front 2 jack */
2379 { .modelname = "3stack-digout", .config = ALC880_3ST_DIG },
2380 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe308, .config = ALC880_3ST_DIG },
2381 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0070, .config = ALC880_3ST_DIG },
2382
2383 /* Clevo laptops */
2384 { .modelname = "clevo", .config = ALC880_CLEVO },
2385 { .pci_subvendor = 0x1558, .pci_subdevice = 0x0520,
2386 .config = ALC880_CLEVO }, /* Clevo m520G NB */
2387 { .pci_subvendor = 0x1558, .pci_subdevice = 0x0660,
2388 .config = ALC880_CLEVO }, /* Clevo m665n */
2389
2390 /* Back 3 jack plus 1 SPDIF out jack, front 2 jack (Internal add Aux-In)*/
2391 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe305, .config = ALC880_3ST_DIG },
2392 { .pci_subvendor = 0x8086, .pci_subdevice = 0xd402, .config = ALC880_3ST_DIG },
2393 { .pci_subvendor = 0x1025, .pci_subdevice = 0xe309, .config = ALC880_3ST_DIG },
2394
2395 /* Back 5 jack, front 2 jack */
2396 { .modelname = "5stack", .config = ALC880_5ST },
2397 { .pci_subvendor = 0x107b, .pci_subdevice = 0x3033, .config = ALC880_5ST },
2398 { .pci_subvendor = 0x107b, .pci_subdevice = 0x4039, .config = ALC880_5ST },
2399 { .pci_subvendor = 0x107b, .pci_subdevice = 0x3032, .config = ALC880_5ST },
2400 { .pci_subvendor = 0x103c, .pci_subdevice = 0x2a09, .config = ALC880_5ST },
2401 { .pci_subvendor = 0x1043, .pci_subdevice = 0x814e, .config = ALC880_5ST },
2402
2403 /* Back 5 jack plus 1 SPDIF out jack, front 2 jack */
2404 { .modelname = "5stack-digout", .config = ALC880_5ST_DIG },
2405 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe224, .config = ALC880_5ST_DIG },
2406 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe400, .config = ALC880_5ST_DIG },
2407 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe401, .config = ALC880_5ST_DIG },
2408 { .pci_subvendor = 0x8086, .pci_subdevice = 0xe402, .config = ALC880_5ST_DIG },
2409 { .pci_subvendor = 0x8086, .pci_subdevice = 0xd400, .config = ALC880_5ST_DIG },
2410 { .pci_subvendor = 0x8086, .pci_subdevice = 0xd401, .config = ALC880_5ST_DIG },
2411 { .pci_subvendor = 0x8086, .pci_subdevice = 0xa100, .config = ALC880_5ST_DIG },
2412 { .pci_subvendor = 0x1565, .pci_subdevice = 0x8202, .config = ALC880_5ST_DIG },
2413 { .pci_subvendor = 0x1019, .pci_subdevice = 0xa880, .config = ALC880_5ST_DIG },
2414 { .pci_subvendor = 0xa0a0, .pci_subdevice = 0x0560,
2415 .config = ALC880_5ST_DIG }, /* Aopen i915GMm-HFS */
2416 /* { .pci_subvendor = 0x1019, .pci_subdevice = 0xa884, .config = ALC880_5ST_DIG }, */ /* conflict with 6stack */
2417 { .pci_subvendor = 0x1695, .pci_subdevice = 0x400d, .config = ALC880_5ST_DIG },
2418 /* note subvendor = 0 below */
2419 /* { .pci_subvendor = 0x0000, .pci_subdevice = 0x8086, .config = ALC880_5ST_DIG }, */
2420
2421 { .modelname = "w810", .config = ALC880_W810 },
2422 { .pci_subvendor = 0x161f, .pci_subdevice = 0x203d, .config = ALC880_W810 },
2423
2424 { .modelname = "z71v", .config = ALC880_Z71V },
2425 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_Z71V },
2426
2427 { .modelname = "6stack", .config = ALC880_6ST },
2428 { .pci_subvendor = 0x1043, .pci_subdevice = 0x8196, .config = ALC880_6ST }, /* ASUS P5GD1-HVM */
2429 { .pci_subvendor = 0x1043, .pci_subdevice = 0x81b4, .config = ALC880_6ST },
2430 { .pci_subvendor = 0x1019, .pci_subdevice = 0xa884, .config = ALC880_6ST }, /* Acer APFV */
2431
2432 { .modelname = "6stack-digout", .config = ALC880_6ST_DIG },
2433 { .pci_subvendor = 0x2668, .pci_subdevice = 0x8086, .config = ALC880_6ST_DIG },
2434 { .pci_subvendor = 0x8086, .pci_subdevice = 0x2668, .config = ALC880_6ST_DIG },
2435 { .pci_subvendor = 0x1462, .pci_subdevice = 0x1150, .config = ALC880_6ST_DIG },
2436 { .pci_subvendor = 0xe803, .pci_subdevice = 0x1019, .config = ALC880_6ST_DIG },
2437 { .pci_subvendor = 0x1039, .pci_subdevice = 0x1234, .config = ALC880_6ST_DIG },
2438 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0077, .config = ALC880_6ST_DIG },
2439 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0078, .config = ALC880_6ST_DIG },
2440 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG },
2441 { .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */
2442 { .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */
2443 { .pci_subvendor = 0x1695, .pci_subdevice = 0x4012, .config = ALC880_5ST_DIG }, /* Epox EP-5LDA+ GLi */
2444 { .pci_subvendor = 0x1458, .pci_subdevice = 0xa102, .config = ALC880_6ST_DIG }, /* Gigabyte K8N51 */
2445
2446 { .modelname = "asus", .config = ALC880_ASUS },
2447 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG },
2448 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1973, .config = ALC880_ASUS_DIG },
2449 { .pci_subvendor = 0x1043, .pci_subdevice = 0x19b3, .config = ALC880_ASUS_DIG },
2450 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1113, .config = ALC880_ASUS_DIG },
2451 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1173, .config = ALC880_ASUS_DIG },
2452 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1993, .config = ALC880_ASUS },
2453 { .pci_subvendor = 0x1043, .pci_subdevice = 0x10c2, .config = ALC880_ASUS_DIG }, /* Asus W6A */
2454 { .pci_subvendor = 0x1043, .pci_subdevice = 0x10c3, .config = ALC880_ASUS_DIG },
2455 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1133, .config = ALC880_ASUS },
2456 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1123, .config = ALC880_ASUS_DIG },
2457 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1143, .config = ALC880_ASUS },
2458 { .modelname = "asus-w1v", .config = ALC880_ASUS_W1V },
2459 { .pci_subvendor = 0x1043, .pci_subdevice = 0x10b3, .config = ALC880_ASUS_W1V },
2460 { .modelname = "asus-dig", .config = ALC880_ASUS_DIG },
2461 { .pci_subvendor = 0x1043, .pci_subdevice = 0x8181, .config = ALC880_ASUS_DIG }, /* ASUS P4GPL-X */
2462 { .modelname = "asus-dig2", .config = ALC880_ASUS_DIG2 },
2463 { .pci_subvendor = 0x1558, .pci_subdevice = 0x5401, .config = ALC880_ASUS_DIG2 },
2464
2465 { .modelname = "uniwill", .config = ALC880_UNIWILL_DIG },
2466 { .pci_subvendor = 0x1584, .pci_subdevice = 0x9050, .config = ALC880_UNIWILL_DIG },
2467 { .pci_subvendor = 0x1584, .pci_subdevice = 0x9070, .config = ALC880_UNIWILL },
2468 { .pci_subvendor = 0x1734, .pci_subdevice = 0x10ac, .config = ALC880_UNIWILL },
2469 { .pci_subvendor = 0x1584, .pci_subdevice = 0x9077, .config = ALC880_UNIWILL_P53 },
2470
2471 { .modelname = "F1734", .config = ALC880_F1734 },
2472 { .pci_subvendor = 0x1734, .pci_subdevice = 0x107c, .config = ALC880_F1734 },
2473 { .pci_subvendor = 0x1584, .pci_subdevice = 0x9054, .config = ALC880_F1734 },
2474
2475 { .modelname = "lg", .config = ALC880_LG },
2476 { .pci_subvendor = 0x1854, .pci_subdevice = 0x003b, .config = ALC880_LG },
2477 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0068, .config = ALC880_LG },
2478
2479 { .modelname = "lg-lw", .config = ALC880_LG_LW },
2480 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0018, .config = ALC880_LG_LW },
2481 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0077, .config = ALC880_LG_LW },
2482
2483#ifdef CONFIG_SND_DEBUG 2350#ifdef CONFIG_SND_DEBUG
2484 { .modelname = "test", .config = ALC880_TEST }, 2351 [ALC880_TEST] = "test",
2485#endif 2352#endif
2486 { .modelname = "auto", .config = ALC880_AUTO }, 2353 [ALC880_AUTO] = "auto",
2354};
2355
2356static struct snd_pci_quirk alc880_cfg_tbl[] = {
2357 /* Broken BIOS configuration */
2358 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG),
2359 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
2360
2361 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
2362 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
2363 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
2364 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
2365 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
2366 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
2367 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
2368 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
2369
2370 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
2371 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
2372
2373 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
2374 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
2375 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
2376 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
2377 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
2378 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
2379 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
2380 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
2381 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
2382 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
2383 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS", ALC880_5ST),
2384 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
2385 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
2386 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
2387 SND_PCI_QUIRK(0x1043, 0, "ASUS", ALC880_ASUS),
2388
2389 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
2390 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
2391 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
2392 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
2393 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
2394 SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
2395 SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
2396 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
2397 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
2398 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
2399 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
2400 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
2401 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
2402 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
2403 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
2404 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
2405 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
2406 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
2407
2408 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
2409 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
2410 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
2411 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwlll", ALC880_F1734),
2412
2413 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
2414 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC", ALC880_UNIWILL),
2415 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
2416
2417 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
2418 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
2419 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
2420 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
2421
2422 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
2423 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
2424 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
2425 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
2426 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
2427 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
2428 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
2429 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
2430 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
2431 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
2432 SND_PCI_QUIRK(0x8086, 0, "Intel mobo", ALC880_3ST),
2487 2433
2488 {} 2434 {}
2489}; 2435};
@@ -3074,8 +3020,10 @@ static int patch_alc880(struct hda_codec *codec)
3074 3020
3075 codec->spec = spec; 3021 codec->spec = spec;
3076 3022
3077 board_config = snd_hda_check_board_config(codec, alc880_cfg_tbl); 3023 board_config = snd_hda_check_board_config(codec, ALC880_MODEL_LAST,
3078 if (board_config < 0 || board_config >= ALC880_MODEL_LAST) { 3024 alc880_models,
3025 alc880_cfg_tbl);
3026 if (board_config < 0) {
3079 printk(KERN_INFO "hda_codec: Unknown model for ALC880, " 3027 printk(KERN_INFO "hda_codec: Unknown model for ALC880, "
3080 "trying auto-probe from BIOS...\n"); 3028 "trying auto-probe from BIOS...\n");
3081 board_config = ALC880_AUTO; 3029 board_config = ALC880_AUTO;
@@ -4161,33 +4109,32 @@ static void alc260_auto_init(struct hda_codec *codec)
4161/* 4109/*
4162 * ALC260 configurations 4110 * ALC260 configurations
4163 */ 4111 */
4164static struct hda_board_config alc260_cfg_tbl[] = { 4112static const char *alc260_models[ALC260_MODEL_LAST] = {
4165 { .modelname = "basic", .config = ALC260_BASIC }, 4113 [ALC260_BASIC] = "basic",
4166 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb, 4114 [ALC260_HP] = "hp",
4167 .config = ALC260_BASIC }, /* Sony VAIO */ 4115 [ALC260_HP_3013] = "hp-3013",
4168 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81cc, 4116 [ALC260_FUJITSU_S702X] = "fujitsu",
4169 .config = ALC260_BASIC }, /* Sony VAIO VGN-S3HP */ 4117 [ALC260_ACER] = "acer",
4170 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81cd,
4171 .config = ALC260_BASIC }, /* Sony VAIO */
4172 { .pci_subvendor = 0x152d, .pci_subdevice = 0x0729,
4173 .config = ALC260_BASIC }, /* CTL Travel Master U553W */
4174 { .modelname = "hp", .config = ALC260_HP },
4175 { .modelname = "hp-3013", .config = ALC260_HP_3013 },
4176 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP_3013 },
4177 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP },
4178 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP_3013 },
4179 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 },
4180 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, .config = ALC260_HP },
4181 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3015, .config = ALC260_HP },
4182 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3016, .config = ALC260_HP },
4183 { .modelname = "fujitsu", .config = ALC260_FUJITSU_S702X },
4184 { .pci_subvendor = 0x10cf, .pci_subdevice = 0x1326, .config = ALC260_FUJITSU_S702X },
4185 { .modelname = "acer", .config = ALC260_ACER },
4186 { .pci_subvendor = 0x1025, .pci_subdevice = 0x008f, .config = ALC260_ACER },
4187#ifdef CONFIG_SND_DEBUG 4118#ifdef CONFIG_SND_DEBUG
4188 { .modelname = "test", .config = ALC260_TEST }, 4119 [ALC260_TEST] = "test",
4189#endif 4120#endif
4190 { .modelname = "auto", .config = ALC260_AUTO }, 4121 [ALC260_AUTO] = "auto",
4122};
4123
4124static struct snd_pci_quirk alc260_cfg_tbl[] = {
4125 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
4126 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
4127 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP),
4128 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013),
4129 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013),
4130 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP),
4131 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP),
4132 SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP),
4133 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC),
4134 SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC),
4135 SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC),
4136 SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X),
4137 SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
4191 {} 4138 {}
4192}; 4139};
4193 4140
@@ -4286,8 +4233,10 @@ static int patch_alc260(struct hda_codec *codec)
4286 4233
4287 codec->spec = spec; 4234 codec->spec = spec;
4288 4235
4289 board_config = snd_hda_check_board_config(codec, alc260_cfg_tbl); 4236 board_config = snd_hda_check_board_config(codec, ALC260_MODEL_LAST,
4290 if (board_config < 0 || board_config >= ALC260_MODEL_LAST) { 4237 alc260_models,
4238 alc260_cfg_tbl);
4239 if (board_config < 0) {
4291 snd_printd(KERN_INFO "hda_codec: Unknown model for ALC260, " 4240 snd_printd(KERN_INFO "hda_codec: Unknown model for ALC260, "
4292 "trying auto-probe from BIOS...\n"); 4241 "trying auto-probe from BIOS...\n");
4293 board_config = ALC260_AUTO; 4242 board_config = ALC260_AUTO;
@@ -4668,19 +4617,18 @@ static struct snd_kcontrol_new alc882_capture_mixer[] = {
4668/* 4617/*
4669 * configuration and preset 4618 * configuration and preset
4670 */ 4619 */
4671static struct hda_board_config alc882_cfg_tbl[] = { 4620static const char *alc882_models[ALC882_MODEL_LAST] = {
4672 { .modelname = "3stack-dig", .config = ALC882_3ST_DIG }, 4621 [ALC882_3ST_DIG] = "3stack-dig",
4673 { .modelname = "6stack-dig", .config = ALC882_6ST_DIG }, 4622 [ALC882_6ST_DIG] = "6stack-dig",
4674 { .pci_subvendor = 0x1462, .pci_subdevice = 0x6668, 4623 [ALC882_ARIMA] = "arima",
4675 .config = ALC882_6ST_DIG }, /* MSI */ 4624 [ALC882_AUTO] = "auto",
4676 { .pci_subvendor = 0x105b, .pci_subdevice = 0x6668, 4625};
4677 .config = ALC882_6ST_DIG }, /* Foxconn */ 4626
4678 { .pci_subvendor = 0x1019, .pci_subdevice = 0x6668, 4627static struct snd_pci_quirk alc882_cfg_tbl[] = {
4679 .config = ALC882_6ST_DIG }, /* ECS to Intel*/ 4628 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
4680 { .modelname = "arima", .config = ALC882_ARIMA }, 4629 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
4681 { .pci_subvendor = 0x161f, .pci_subdevice = 0x2054, 4630 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
4682 .config = ALC882_ARIMA }, /* Arima W820Di1 */ 4631 SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA),
4683 { .modelname = "auto", .config = ALC882_AUTO },
4684 {} 4632 {}
4685}; 4633};
4686 4634
@@ -4817,7 +4765,9 @@ static int patch_alc882(struct hda_codec *codec)
4817 4765
4818 codec->spec = spec; 4766 codec->spec = spec;
4819 4767
4820 board_config = snd_hda_check_board_config(codec, alc882_cfg_tbl); 4768 board_config = snd_hda_check_board_config(codec, ALC882_MODEL_LAST,
4769 alc882_models,
4770 alc882_cfg_tbl);
4821 4771
4822 if (board_config < 0 || board_config >= ALC882_MODEL_LAST) { 4772 if (board_config < 0 || board_config >= ALC882_MODEL_LAST) {
4823 printk(KERN_INFO "hda_codec: Unknown model for ALC882, " 4773 printk(KERN_INFO "hda_codec: Unknown model for ALC882, "
@@ -5427,65 +5377,41 @@ static struct snd_kcontrol_new alc883_capture_mixer[] = {
5427/* 5377/*
5428 * configuration and preset 5378 * configuration and preset
5429 */ 5379 */
5430static struct hda_board_config alc883_cfg_tbl[] = { 5380static const char *alc883_models[ALC883_MODEL_LAST] = {
5431 { .modelname = "3stack-dig", .config = ALC883_3ST_2ch_DIG }, 5381 [ALC883_3ST_2ch_DIG] = "3stack-dig",
5432 { .modelname = "3stack-6ch-dig", .config = ALC883_3ST_6ch_DIG }, 5382 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
5433 { .pci_subvendor = 0x1019, .pci_subdevice = 0x6668, 5383 [ALC883_3ST_6ch] = "3stack-6ch",
5434 .config = ALC883_3ST_6ch_DIG }, /* ECS to Intel*/ 5384 [ALC883_6ST_DIG] = "6stack-dig",
5435 { .modelname = "3stack-6ch", .config = ALC883_3ST_6ch }, 5385 [ALC883_TARGA_DIG] = "targa-dig",
5436 { .pci_subvendor = 0x108e, .pci_subdevice = 0x534d, 5386 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
5437 .config = ALC883_3ST_6ch }, 5387 [ALC888_DEMO_BOARD] = "6stack-dig-demo",
5438 { .pci_subvendor = 0x8086, .pci_subdevice = 0xd601, 5388 [ALC883_ACER] = "acer",
5439 .config = ALC883_3ST_6ch }, /* D102GGC */ 5389 [ALC883_MEDION] = "medion",
5440 { .modelname = "6stack-dig", .config = ALC883_6ST_DIG }, 5390 [ALC883_LAPTOP_EAPD] = "laptop-eapd",
5441 { .pci_subvendor = 0x1462, .pci_subdevice = 0x6668, 5391 [ALC883_AUTO] = "auto",
5442 .config = ALC883_6ST_DIG }, /* MSI */ 5392};
5443 { .pci_subvendor = 0x1462, .pci_subdevice = 0x7280, 5393
5444 .config = ALC883_6ST_DIG }, /* MSI K9A Platinum (MS-7280) */ 5394static struct snd_pci_quirk alc883_cfg_tbl[] = {
5445 { .pci_subvendor = 0x105b, .pci_subdevice = 0x6668, 5395 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG),
5446 .config = ALC883_6ST_DIG }, /* Foxconn */ 5396 SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
5447 { .pci_subvendor = 0x1462, .pci_subdevice = 0x7187, 5397 SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD),
5448 .config = ALC883_6ST_DIG }, /* MSI */ 5398 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG),
5449 { .modelname = "targa-dig", .config = ALC883_TARGA_DIG }, 5399 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
5450 { .pci_subvendor = 0x1462, .pci_subdevice = 0x4314, 5400 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
5451 .config = ALC883_TARGA_DIG }, /* MSI */ 5401 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
5452 { .pci_subvendor = 0x1462, .pci_subdevice = 0x3fcc, 5402 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
5453 .config = ALC883_TARGA_DIG }, /* MSI */ 5403 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
5454 { .pci_subvendor = 0x1462, .pci_subdevice = 0x3fc1, 5404 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
5455 .config = ALC883_TARGA_DIG }, /* MSI */ 5405 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
5456 { .pci_subvendor = 0x1462, .pci_subdevice = 0x3fc3, 5406 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
5457 .config = ALC883_TARGA_DIG }, /* MSI */ 5407 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
5458 { .pci_subvendor = 0x1462, .pci_subdevice = 0x4314, 5408 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
5459 .config = ALC883_TARGA_DIG }, /* MSI */ 5409 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
5460 { .pci_subvendor = 0x1462, .pci_subdevice = 0x4319, 5410 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
5461 .config = ALC883_TARGA_DIG }, /* MSI */ 5411 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER),
5462 { .pci_subvendor = 0x1462, .pci_subdevice = 0x3ef9, 5412 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
5463 .config = ALC883_TARGA_DIG }, /* MSI */ 5413 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
5464 { .pci_subvendor = 0x1462, .pci_subdevice = 0x4324, 5414 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
5465 .config = ALC883_TARGA_DIG }, /* MSI */
5466 { .modelname = "targa-2ch-dig", .config = ALC883_TARGA_2ch_DIG },
5467 { .pci_subvendor = 0x1462, .pci_subdevice = 0x0579,
5468 .config = ALC883_TARGA_2ch_DIG }, /* MSI */
5469 { .pci_subvendor = 0x1462, .pci_subdevice = 0xa422,
5470 .config = ALC883_TARGA_2ch_DIG }, /* MSI */
5471 { .pci_subvendor = 0x1462, .pci_subdevice = 0x3b7f,
5472 .config = ALC883_TARGA_2ch_DIG }, /* MSI */
5473 { .modelname = "6stack-dig-demo", .config = ALC888_DEMO_BOARD },
5474 { .modelname = "acer", .config = ALC883_ACER },
5475 { .pci_subvendor = 0x1025, .pci_subdevice = 0/*0x0102*/,
5476 .config = ALC883_ACER },
5477 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0102,
5478 .config = ALC883_ACER },
5479 { .pci_subvendor = 0x1025, .pci_subdevice = 0x009f,
5480 .config = ALC883_ACER },
5481 { .pci_subvendor = 0x161f, .pci_subdevice = 0x2054,
5482 .modelname = "medion", .config = ALC883_MEDION },
5483 { .modelname = "laptop-eapd", .config = ALC883_LAPTOP_EAPD },
5484 { .pci_subvendor = 0x1071, .pci_subdevice = 0x8258,
5485 .config = ALC883_LAPTOP_EAPD }, /* Evesham Voyager C530RD */
5486 { .pci_subvendor = 0x1558, .pci_subdevice = 0,
5487 .config = ALC883_LAPTOP_EAPD }, /* Clevo */
5488 { .modelname = "auto", .config = ALC883_AUTO },
5489 {} 5415 {}
5490}; 5416};
5491 5417
@@ -5734,8 +5660,10 @@ static int patch_alc883(struct hda_codec *codec)
5734 5660
5735 codec->spec = spec; 5661 codec->spec = spec;
5736 5662
5737 board_config = snd_hda_check_board_config(codec, alc883_cfg_tbl); 5663 board_config = snd_hda_check_board_config(codec, ALC883_MODEL_LAST,
5738 if (board_config < 0 || board_config >= ALC883_MODEL_LAST) { 5664 alc883_models,
5665 alc883_cfg_tbl);
5666 if (board_config < 0) {
5739 printk(KERN_INFO "hda_codec: Unknown model for ALC883, " 5667 printk(KERN_INFO "hda_codec: Unknown model for ALC883, "
5740 "trying auto-probe from BIOS...\n"); 5668 "trying auto-probe from BIOS...\n");
5741 board_config = ALC883_AUTO; 5669 board_config = ALC883_AUTO;
@@ -6438,35 +6366,27 @@ static void alc262_auto_init(struct hda_codec *codec)
6438/* 6366/*
6439 * configuration and preset 6367 * configuration and preset
6440 */ 6368 */
6441static struct hda_board_config alc262_cfg_tbl[] = { 6369static const char *alc262_models[ALC262_MODEL_LAST] = {
6442 { .modelname = "basic", .config = ALC262_BASIC }, 6370 [ALC262_BASIC] = "basic",
6443 { .modelname = "hippo", 6371 [ALC262_HIPPO] = "hippo",
6444 .pci_subvendor =0x1002, .pci_subdevice = 0x437b, 6372 [ALC262_HIPPO_1] = "hippo_1",
6445 .config = ALC262_HIPPO}, 6373 [ALC262_FUJITSU] = "fujitsu",
6446 { .modelname = "hippo", 6374 [ALC262_HP_BPC] = "hp-bpc",
6447 .pci_subvendor = 0x104d, .pci_subdevice = 0x8203, 6375 [ALC262_BENQ_ED8] = "benq",
6448 .config = ALC262_HIPPO }, /* Sony UX-90s */ 6376 [ALC262_AUTO] = "auto",
6449 { .modelname = "hippo_1", 6377};
6450 .pci_subvendor =0x17ff, .pci_subdevice = 0x058f, 6378
6451 .config = ALC262_HIPPO_1}, 6379static struct snd_pci_quirk alc262_cfg_tbl[] = {
6452 { .modelname = "fujitsu", .config = ALC262_FUJITSU }, 6380 SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO),
6453 { .pci_subvendor = 0x10cf, .pci_subdevice = 0x1397, 6381 SND_PCI_QUIRK(0x103c, 0x12fe, "HP xw9400", ALC262_HP_BPC),
6454 .config = ALC262_FUJITSU }, 6382 SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC),
6455 { .modelname = "hp-bpc", .config = ALC262_HP_BPC }, 6383 SND_PCI_QUIRK(0x103c, 0x2801, "HP q954", ALC262_HP_BPC),
6456 { .pci_subvendor = 0x103c, .pci_subdevice = 0x280c, 6384 SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC),
6457 .config = ALC262_HP_BPC }, /* xw4400 */ 6385 SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC),
6458 { .pci_subvendor = 0x103c, .pci_subdevice = 0x2801, 6386 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
6459 .config = ALC262_HP_BPC }, /* q965 */ 6387 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
6460 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, 6388 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1),
6461 .config = ALC262_HP_BPC }, /* xw6400 */ 6389 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
6462 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3015,
6463 .config = ALC262_HP_BPC }, /* xw8400 */
6464 { .pci_subvendor = 0x103c, .pci_subdevice = 0x12fe,
6465 .config = ALC262_HP_BPC }, /* xw9400 */
6466 { .modelname = "benq", .config = ALC262_BENQ_ED8 },
6467 { .pci_subvendor = 0x17ff, .pci_subdevice = 0x0560,
6468 .config = ALC262_BENQ_ED8 },
6469 { .modelname = "auto", .config = ALC262_AUTO },
6470 {} 6390 {}
6471}; 6391};
6472 6392
@@ -6561,9 +6481,11 @@ static int patch_alc262(struct hda_codec *codec)
6561 } 6481 }
6562#endif 6482#endif
6563 6483
6564 board_config = snd_hda_check_board_config(codec, alc262_cfg_tbl); 6484 board_config = snd_hda_check_board_config(codec, ALC262_MODEL_LAST,
6485 alc262_models,
6486 alc262_cfg_tbl);
6565 6487
6566 if (board_config < 0 || board_config >= ALC262_MODEL_LAST) { 6488 if (board_config < 0) {
6567 printk(KERN_INFO "hda_codec: Unknown model for ALC262, " 6489 printk(KERN_INFO "hda_codec: Unknown model for ALC262, "
6568 "trying auto-probe from BIOS...\n"); 6490 "trying auto-probe from BIOS...\n");
6569 board_config = ALC262_AUTO; 6491 board_config = ALC262_AUTO;
@@ -7527,30 +7449,26 @@ static void alc861_auto_init(struct hda_codec *codec)
7527/* 7449/*
7528 * configuration and preset 7450 * configuration and preset
7529 */ 7451 */
7530static struct hda_board_config alc861_cfg_tbl[] = { 7452static const char *alc861_models[ALC861_MODEL_LAST] = {
7531 { .modelname = "3stack", .config = ALC861_3ST }, 7453 [ALC861_3ST] = "3stack",
7532 { .pci_subvendor = 0x8086, .pci_subdevice = 0xd600, 7454 [ALC660_3ST] = "3stack-660",
7533 .config = ALC861_3ST }, 7455 [ALC861_3ST_DIG] = "3stack-dig",
7534 { .modelname = "3stack-660", .config = ALC660_3ST }, 7456 [ALC861_6ST_DIG] = "6stack-dig",
7535 { .pci_subvendor = 0x1043, .pci_subdevice = 0x81e7, 7457 [ALC861_UNIWILL_M31] = "uniwill-m31",
7536 .config = ALC660_3ST }, 7458 [ALC861_TOSHIBA] = "toshiba",
7537 { .modelname = "3stack-dig", .config = ALC861_3ST_DIG }, 7459 [ALC861_ASUS] = "asus",
7538 { .modelname = "6stack-dig", .config = ALC861_6ST_DIG }, 7460 [ALC861_ASUS_LAPTOP] = "asus-laptop",
7539 { .modelname = "uniwill-m31", .config = ALC861_UNIWILL_M31}, 7461 [ALC861_AUTO] = "auto",
7540 { .pci_subvendor = 0x1584, .pci_subdevice = 0x9072, 7462};
7541 .config = ALC861_UNIWILL_M31 }, 7463
7542 { .modelname = "toshiba", .config = ALC861_TOSHIBA }, 7464static struct snd_pci_quirk alc861_cfg_tbl[] = {
7543 { .pci_subvendor = 0x1179, .pci_subdevice = 0xff10, 7465 SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP),
7544 .config = ALC861_TOSHIBA }, 7466 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP),
7545 { .modelname = "asus", .config = ALC861_ASUS}, 7467 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS),
7546 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1393, 7468 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660_3ST),
7547 .config = ALC861_ASUS }, 7469 SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA),
7548 { .modelname = "asus-laptop", .config = ALC861_ASUS_LAPTOP }, 7470 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31),
7549 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1335, 7471 SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST),
7550 .config = ALC861_ASUS_LAPTOP }, /* ASUS F2/F3 */
7551 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1338,
7552 .config = ALC861_ASUS_LAPTOP }, /* ASUS F2/F3 */
7553 { .modelname = "auto", .config = ALC861_AUTO },
7554 {} 7472 {}
7555}; 7473};
7556 7474
@@ -7673,9 +7591,11 @@ static int patch_alc861(struct hda_codec *codec)
7673 7591
7674 codec->spec = spec; 7592 codec->spec = spec;
7675 7593
7676 board_config = snd_hda_check_board_config(codec, alc861_cfg_tbl); 7594 board_config = snd_hda_check_board_config(codec, ALC861_MODEL_LAST,
7595 alc861_models,
7596 alc861_cfg_tbl);
7677 7597
7678 if (board_config < 0 || board_config >= ALC861_MODEL_LAST) { 7598 if (board_config < 0) {
7679 printk(KERN_INFO "hda_codec: Unknown model for ALC861, " 7599 printk(KERN_INFO "hda_codec: Unknown model for ALC861, "
7680 "trying auto-probe from BIOS...\n"); 7600 "trying auto-probe from BIOS...\n");
7681 board_config = ALC861_AUTO; 7601 board_config = ALC861_AUTO;
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index c8696ddc03a..cbaa00aa5b9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -37,14 +37,30 @@
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 40enum {
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 45enum {
46#define STAC_D965_5ST 5 46 STAC_9205_REF,
47#define STAC_927X_MODELS 6 /* number of 927x models */ 47 STAC_9205_MODELS
48};
49
50enum {
51 STAC_D945_REF,
52 STAC_D945GTP3,
53 STAC_D945GTP5,
54 STAC_MACMINI,
55 STAC_922X_MODELS
56};
57
58enum {
59 STAC_D965_REF,
60 STAC_D965_3ST,
61 STAC_D965_5ST,
62 STAC_927X_MODELS
63};
48 64
49struct sigmatel_spec { 65struct sigmatel_spec {
50 struct snd_kcontrol_new *mixers[4]; 66 struct snd_kcontrol_new *mixers[4];
@@ -373,22 +389,25 @@ static unsigned int ref9200_pin_configs[8] = {
373 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, 389 0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
374}; 390};
375 391
376static unsigned int *stac9200_brd_tbl[] = { 392static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
377 ref9200_pin_configs, 393 [STAC_REF] = ref9200_pin_configs,
378}; 394};
379 395
380static struct hda_board_config stac9200_cfg_tbl[] = { 396static const char *stac9200_models[STAC_9200_MODELS] = {
381 { .modelname = "ref", 397 [STAC_REF] = "ref",
382 .pci_subvendor = PCI_VENDOR_ID_INTEL, 398};
383 .pci_subdevice = 0x2668, /* DFI LanParty */ 399
384 .config = STAC_REF }, 400static struct snd_pci_quirk stac9200_cfg_tbl[] = {
401 /* SigmaTel reference board */
402 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
403 "DFI LanParty", STAC_REF),
385 /* Dell laptops have BIOS problem */ 404 /* Dell laptops have BIOS problem */
386 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01b5, 405 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5,
387 .config = STAC_REF }, /* Dell Inspiron 630m */ 406 "Dell Inspiron 630m", STAC_REF),
388 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01c2, 407 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2,
389 .config = STAC_REF }, /* Dell Latitude D620 */ 408 "Dell Latitude D620", STAC_REF),
390 { .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01cb, 409 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb,
391 .config = STAC_REF }, /* Dell Latitude 120L */ 410 "Dell Latitude 120L", STAC_REF),
392 {} /* terminator */ 411 {} /* terminator */
393}; 412};
394 413
@@ -411,100 +430,80 @@ static unsigned int d945gtp5_pin_configs[10] = {
411}; 430};
412 431
413static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { 432static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
414 [STAC_REF] = ref922x_pin_configs, 433 [STAC_D945_REF] = ref922x_pin_configs,
415 [STAC_D945GTP3] = d945gtp3_pin_configs, 434 [STAC_D945GTP3] = d945gtp3_pin_configs,
416 [STAC_D945GTP5] = d945gtp5_pin_configs, 435 [STAC_D945GTP5] = d945gtp5_pin_configs,
417 [STAC_MACMINI] = d945gtp5_pin_configs, 436 [STAC_MACMINI] = d945gtp5_pin_configs,
418}; 437};
419 438
420static struct hda_board_config stac922x_cfg_tbl[] = { 439static const char *stac922x_models[STAC_922X_MODELS] = {
421 { .modelname = "5stack", .config = STAC_D945GTP5 }, 440 [STAC_D945_REF] = "ref",
422 { .modelname = "3stack", .config = STAC_D945GTP3 }, 441 [STAC_D945GTP5] = "5stack",
423 { .modelname = "ref", 442 [STAC_D945GTP3] = "3stack",
424 .pci_subvendor = PCI_VENDOR_ID_INTEL, 443 [STAC_MACMINI] = "macmini",
425 .pci_subdevice = 0x2668, /* DFI LanParty */ 444};
426 .config = STAC_REF }, /* SigmaTel reference board */ 445
427 /* Intel 945G based systems */ 446static struct snd_pci_quirk stac922x_cfg_tbl[] = {
428 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 447 /* SigmaTel reference board */
429 .pci_subdevice = 0x0101, 448 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
430 .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ 449 "DFI LanParty", STAC_D945_REF),
431 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 450 /* Intel 945G based systems */
432 .pci_subdevice = 0x0202, 451 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101,
433 .config = STAC_D945GTP3 }, /* Intel D945GNT - 3 Stack */ 452 "Intel D945G", STAC_D945GTP3),
434 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 453 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202,
435 .pci_subdevice = 0x0606, 454 "Intel D945G", STAC_D945GTP3),
436 .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ 455 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606,
437 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 456 "Intel D945G", STAC_D945GTP3),
438 .pci_subdevice = 0x0601, 457 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601,
439 .config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ 458 "Intel D945G", STAC_D945GTP3),
440 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 459 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111,
441 .pci_subdevice = 0x0111, 460 "Intel D945G", STAC_D945GTP3),
442 .config = STAC_D945GTP3 }, /* Intel D945GZP - 3 Stack */ 461 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115,
443 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 462 "Intel D945G", STAC_D945GTP3),
444 .pci_subdevice = 0x1115, 463 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116,
445 .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ 464 "Intel D945G", STAC_D945GTP3),
446 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 465 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117,
447 .pci_subdevice = 0x1116, 466 "Intel D945G", STAC_D945GTP3),
448 .config = STAC_D945GTP3 }, /* Intel D945GBO - 3 Stack */ 467 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118,
449 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 468 "Intel D945G", STAC_D945GTP3),
450 .pci_subdevice = 0x1117, 469 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119,
451 .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ 470 "Intel D945G", STAC_D945GTP3),
452 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 471 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826,
453 .pci_subdevice = 0x1118, 472 "Intel D945G", STAC_D945GTP3),
454 .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ 473 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049,
455 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 474 "Intel D945G", STAC_D945GTP3),
456 .pci_subdevice = 0x1119, 475 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055,
457 .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ 476 "Intel D945G", STAC_D945GTP3),
458 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 477 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048,
459 .pci_subdevice = 0x8826, 478 "Intel D945G", STAC_D945GTP3),
460 .config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ 479 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110,
461 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 480 "Intel D945G", STAC_D945GTP3),
462 .pci_subdevice = 0x5049, 481 /* Intel D945G 5-stack systems */
463 .config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ 482 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404,
464 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 483 "Intel D945G", STAC_D945GTP5),
465 .pci_subdevice = 0x5055, 484 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303,
466 .config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ 485 "Intel D945G", STAC_D945GTP5),
467 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 486 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013,
468 .pci_subdevice = 0x5048, 487 "Intel D945G", STAC_D945GTP5),
469 .config = STAC_D945GTP3 }, /* Intel D945GPB - 3 Stack */ 488 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417,
470 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 489 "Intel D945G", STAC_D945GTP5),
471 .pci_subdevice = 0x0110, 490 /* Intel 945P based systems */
472 .config = STAC_D945GTP3 }, /* Intel D945GLR - 3 Stack */ 491 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b,
473 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 492 "Intel D945P", STAC_D945GTP3),
474 .pci_subdevice = 0x0404, 493 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112,
475 .config = STAC_D945GTP5 }, /* Intel D945GTP - 5 Stack */ 494 "Intel D945P", STAC_D945GTP3),
476 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 495 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d,
477 .pci_subdevice = 0x0303, 496 "Intel D945P", STAC_D945GTP3),
478 .config = STAC_D945GTP5 }, /* Intel D945GNT - 5 Stack */ 497 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909,
479 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 498 "Intel D945P", STAC_D945GTP3),
480 .pci_subdevice = 0x0013, 499 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505,
481 .config = STAC_D945GTP5 }, /* Intel D955XBK - 5 Stack */ 500 "Intel D945P", STAC_D945GTP3),
482 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 501 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
483 .pci_subdevice = 0x0417, 502 "Intel D945P", STAC_D945GTP5),
484 .config = STAC_D945GTP5 }, /* Intel D975XBK - 5 Stack */ 503 /* other systems */
485 /* Intel 945P based systems */ 504 /* Apple Mac Mini (early 2006) */
486 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 505 SND_PCI_QUIRK(0x8384, 0x7680,
487 .pci_subdevice = 0x0b0b, 506 "Mac Mini", STAC_MACMINI),
488 .config = STAC_D945GTP3 }, /* Intel D945PSN - 3 Stack */
489 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
490 .pci_subdevice = 0x0112,
491 .config = STAC_D945GTP3 }, /* Intel D945PLN - 3 Stack */
492 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
493 .pci_subdevice = 0x0d0d,
494 .config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */
495 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
496 .pci_subdevice = 0x0909,
497 .config = STAC_D945GTP3 }, /* Intel D945PAW - 3 Stack */
498 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
499 .pci_subdevice = 0x0505,
500 .config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */
501 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
502 .pci_subdevice = 0x0707,
503 .config = STAC_D945GTP5 }, /* Intel D945PSV - 5 Stack */
504 /* other systems */
505 { .pci_subvendor = 0x8384,
506 .pci_subdevice = 0x7680,
507 .config = STAC_MACMINI }, /* Apple Mac Mini (early 2006) */
508 {} /* terminator */ 507 {} /* terminator */
509}; 508};
510 509
@@ -530,102 +529,51 @@ static unsigned int d965_5st_pin_configs[14] = {
530}; 529};
531 530
532static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { 531static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
533 [STAC_REF] = ref927x_pin_configs, 532 [STAC_D965_REF] = ref927x_pin_configs,
534 [STAC_D965_3ST] = d965_3st_pin_configs, 533 [STAC_D965_3ST] = d965_3st_pin_configs,
535 [STAC_D965_5ST] = d965_5st_pin_configs, 534 [STAC_D965_5ST] = d965_5st_pin_configs,
536}; 535};
537 536
538static struct hda_board_config stac927x_cfg_tbl[] = { 537static const char *stac927x_models[STAC_927X_MODELS] = {
539 { .modelname = "5stack", .config = STAC_D965_5ST }, 538 [STAC_D965_REF] = "ref",
540 { .modelname = "3stack", .config = STAC_D965_3ST }, 539 [STAC_D965_3ST] = "3stack",
541 { .modelname = "ref", 540 [STAC_D965_5ST] = "5stack",
542 .pci_subvendor = PCI_VENDOR_ID_INTEL, 541};
543 .pci_subdevice = 0x2668, /* DFI LanParty */ 542
544 .config = STAC_REF }, /* SigmaTel reference board */ 543static struct snd_pci_quirk stac927x_cfg_tbl[] = {
544 /* SigmaTel reference board */
545 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
546 "DFI LanParty", STAC_D965_REF),
545 /* Intel 946 based systems */ 547 /* Intel 946 based systems */
546 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 548 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST),
547 .pci_subdevice = 0x3d01, 549 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST),
548 .config = STAC_D965_3ST }, /* D946 configuration */
549 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
550 .pci_subdevice = 0xa301,
551 .config = STAC_D965_3ST }, /* Intel D946GZT - 3 stack */
552 /* 965 based 3 stack systems */ 550 /* 965 based 3 stack systems */
553 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 551 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2116, "Intel D965", STAC_D965_3ST),
554 .pci_subdevice = 0x2116, 552 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2115, "Intel D965", STAC_D965_3ST),
555 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ 553 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2114, "Intel D965", STAC_D965_3ST),
556 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 554 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2113, "Intel D965", STAC_D965_3ST),
557 .pci_subdevice = 0x2115, 555 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2112, "Intel D965", STAC_D965_3ST),
558 .config = STAC_D965_3ST }, /* Intel DQ965WC - 3 Stack */ 556 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2111, "Intel D965", STAC_D965_3ST),
559 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 557 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2110, "Intel D965", STAC_D965_3ST),
560 .pci_subdevice = 0x2114, 558 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2009, "Intel D965", STAC_D965_3ST),
561 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ 559 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2008, "Intel D965", STAC_D965_3ST),
562 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 560 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2007, "Intel D965", STAC_D965_3ST),
563 .pci_subdevice = 0x2113, 561 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2006, "Intel D965", STAC_D965_3ST),
564 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */ 562 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2005, "Intel D965", STAC_D965_3ST),
565 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 563 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2004, "Intel D965", STAC_D965_3ST),
566 .pci_subdevice = 0x2112, 564 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST),
567 .config = STAC_D965_3ST }, /* Intel DG965MS - 3 Stack */ 565 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST),
568 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 566 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST),
569 .pci_subdevice = 0x2111,
570 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
571 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
572 .pci_subdevice = 0x2110,
573 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
574 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
575 .pci_subdevice = 0x2009,
576 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
577 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
578 .pci_subdevice = 0x2008,
579 .config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */
580 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
581 .pci_subdevice = 0x2007,
582 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
583 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
584 .pci_subdevice = 0x2006,
585 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
586 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
587 .pci_subdevice = 0x2005,
588 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
589 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
590 .pci_subdevice = 0x2004,
591 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
592 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
593 .pci_subdevice = 0x2003,
594 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
595 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
596 .pci_subdevice = 0x2002,
597 .config = STAC_D965_3ST }, /* Intel D965 3Stack config */
598 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
599 .pci_subdevice = 0x2001,
600 .config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */
601 /* 965 based 5 stack systems */ 567 /* 965 based 5 stack systems */
602 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 568 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST),
603 .pci_subdevice = 0x2301, 569 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST),
604 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ 570 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST),
605 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 571 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2304, "Intel D965", STAC_D965_5ST),
606 .pci_subdevice = 0x2302, 572 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2305, "Intel D965", STAC_D965_5ST),
607 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ 573 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2501, "Intel D965", STAC_D965_5ST),
608 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 574 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2502, "Intel D965", STAC_D965_5ST),
609 .pci_subdevice = 0x2303, 575 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2503, "Intel D965", STAC_D965_5ST),
610 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ 576 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2504, "Intel D965", STAC_D965_5ST),
611 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
612 .pci_subdevice = 0x2304,
613 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
614 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
615 .pci_subdevice = 0x2305,
616 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
617 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
618 .pci_subdevice = 0x2501,
619 .config = STAC_D965_5ST }, /* Intel DG965MQ - 5 Stack */
620 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
621 .pci_subdevice = 0x2502,
622 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
623 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
624 .pci_subdevice = 0x2503,
625 .config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
626 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
627 .pci_subdevice = 0x2504,
628 .config = STAC_D965_5ST }, /* Intel DQ965GF - 5 Stack */
629 {} /* terminator */ 577 {} /* terminator */
630}; 578};
631 579
@@ -635,15 +583,18 @@ static unsigned int ref9205_pin_configs[12] = {
635 0x90a000f0, 0x90a000f0, 0x01441030, 0x01c41030 583 0x90a000f0, 0x90a000f0, 0x01441030, 0x01c41030
636}; 584};
637 585
638static unsigned int *stac9205_brd_tbl[] = { 586static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
639 ref9205_pin_configs, 587 ref9205_pin_configs,
640}; 588};
641 589
642static struct hda_board_config stac9205_cfg_tbl[] = { 590static const char *stac9205_models[STAC_9205_MODELS] = {
643 { .modelname = "ref", 591 [STAC_9205_REF] = "ref",
644 .pci_subvendor = PCI_VENDOR_ID_INTEL, 592};
645 .pci_subdevice = 0x2668, /* DFI LanParty */ 593
646 .config = STAC_REF }, /* SigmaTel reference board */ 594static struct snd_pci_quirk stac9205_cfg_tbl[] = {
595 /* SigmaTel reference board */
596 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
597 "DFI LanParty", STAC_9205_REF),
647 {} /* terminator */ 598 {} /* terminator */
648}; 599};
649 600
@@ -1710,7 +1661,9 @@ static int patch_stac9200(struct hda_codec *codec)
1710 codec->spec = spec; 1661 codec->spec = spec;
1711 spec->num_pins = 8; 1662 spec->num_pins = 8;
1712 spec->pin_nids = stac9200_pin_nids; 1663 spec->pin_nids = stac9200_pin_nids;
1713 spec->board_config = snd_hda_check_board_config(codec, stac9200_cfg_tbl); 1664 spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
1665 stac9200_models,
1666 stac9200_cfg_tbl);
1714 if (spec->board_config < 0) { 1667 if (spec->board_config < 0) {
1715 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n"); 1668 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n");
1716 err = stac92xx_save_bios_config_regs(codec); 1669 err = stac92xx_save_bios_config_regs(codec);
@@ -1758,7 +1711,9 @@ static int patch_stac922x(struct hda_codec *codec)
1758 codec->spec = spec; 1711 codec->spec = spec;
1759 spec->num_pins = 10; 1712 spec->num_pins = 10;
1760 spec->pin_nids = stac922x_pin_nids; 1713 spec->pin_nids = stac922x_pin_nids;
1761 spec->board_config = snd_hda_check_board_config(codec, stac922x_cfg_tbl); 1714 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
1715 stac922x_models,
1716 stac922x_cfg_tbl);
1762 if (spec->board_config < 0) { 1717 if (spec->board_config < 0) {
1763 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " 1718 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
1764 "using BIOS defaults\n"); 1719 "using BIOS defaults\n");
@@ -1809,7 +1764,9 @@ static int patch_stac927x(struct hda_codec *codec)
1809 codec->spec = spec; 1764 codec->spec = spec;
1810 spec->num_pins = 14; 1765 spec->num_pins = 14;
1811 spec->pin_nids = stac927x_pin_nids; 1766 spec->pin_nids = stac927x_pin_nids;
1812 spec->board_config = snd_hda_check_board_config(codec, stac927x_cfg_tbl); 1767 spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS,
1768 stac927x_models,
1769 stac927x_cfg_tbl);
1813 if (spec->board_config < 0) { 1770 if (spec->board_config < 0) {
1814 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); 1771 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n");
1815 err = stac92xx_save_bios_config_regs(codec); 1772 err = stac92xx_save_bios_config_regs(codec);
@@ -1874,7 +1831,9 @@ static int patch_stac9205(struct hda_codec *codec)
1874 codec->spec = spec; 1831 codec->spec = spec;
1875 spec->num_pins = 14; 1832 spec->num_pins = 14;
1876 spec->pin_nids = stac9205_pin_nids; 1833 spec->pin_nids = stac9205_pin_nids;
1877 spec->board_config = snd_hda_check_board_config(codec, stac9205_cfg_tbl); 1834 spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS,
1835 stac9205_models,
1836 stac9205_cfg_tbl);
1878 if (spec->board_config < 0) { 1837 if (spec->board_config < 0) {
1879 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); 1838 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n");
1880 err = stac92xx_save_bios_config_regs(codec); 1839 err = stac92xx_save_bios_config_regs(codec);
@@ -2083,18 +2042,19 @@ enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */
2083 /* Unknown. id=0x83847661 and subsys=0x104D1200. */ 2042 /* Unknown. id=0x83847661 and subsys=0x104D1200. */
2084 STAC9872K_VAIO, 2043 STAC9872K_VAIO,
2085 /* AR Series. id=0x83847664 and subsys=104D1300 */ 2044 /* AR Series. id=0x83847664 and subsys=104D1300 */
2086 CXD9872AKD_VAIO 2045 CXD9872AKD_VAIO,
2087 }; 2046 STAC_9872_MODELS,
2088 2047};
2089static struct hda_board_config stac9872_cfg_tbl[] = { 2048
2090 { .modelname = "vaio", .config = CXD9872RD_VAIO }, 2049static const char *stac9872_models[STAC_9872_MODELS] = {
2091 { .modelname = "vaio-ar", .config = CXD9872AKD_VAIO }, 2050 [CXD9872RD_VAIO] = "vaio",
2092 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81e6, 2051 [CXD9872AKD_VAIO] = "vaio-ar",
2093 .config = CXD9872RD_VAIO }, 2052};
2094 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef, 2053
2095 .config = CXD9872RD_VAIO }, 2054static struct snd_pci_quirk stac9872_cfg_tbl[] = {
2096 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81fd, 2055 SND_PCI_QUIRK(0x104d, 0x81e6, "Sony VAIO F/S", CXD9872RD_VAIO),
2097 .config = CXD9872AKD_VAIO }, 2056 SND_PCI_QUIRK(0x104d, 0x81ef, "Sony VAIO F/S", CXD9872RD_VAIO),
2057 SND_PCI_QUIRK(0x104d, 0x81fd, "Sony VAIO AR", CXD9872AKD_VAIO),
2098 {} 2058 {}
2099}; 2059};
2100 2060
@@ -2103,7 +2063,9 @@ static int patch_stac9872(struct hda_codec *codec)
2103 struct sigmatel_spec *spec; 2063 struct sigmatel_spec *spec;
2104 int board_config; 2064 int board_config;
2105 2065
2106 board_config = snd_hda_check_board_config(codec, stac9872_cfg_tbl); 2066 board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
2067 stac9872_models,
2068 stac9872_cfg_tbl);
2107 if (board_config < 0) 2069 if (board_config < 0)
2108 /* unknown config, let generic-parser do its job... */ 2070 /* unknown config, let generic-parser do its job... */
2109 return snd_hda_parse_generic_codec(codec); 2071 return snd_hda_parse_generic_codec(codec);