Commit f5fcc13c authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 0b830bac
...@@ -277,11 +277,11 @@ Helper Functions ...@@ -277,11 +277,11 @@ Helper Functions
snd_hda_get_codec_name() stores the codec name on the given string. snd_hda_get_codec_name() stores the codec name on the given string.
snd_hda_check_board_config() can be used to obtain the configuration snd_hda_check_board_config() can be used to obtain the configuration
information matching with the device. Define the table with struct information matching with the device. Define the model string table
hda_board_config entries (zero-terminated), and pass it to the and the table with struct snd_pci_quirk entries (zero-terminated),
function. The function checks the modelname given as a module and pass it to the function. The function checks the modelname given
parameter, and PCI subsystem IDs. If the matching entry is found, it as a module parameter, and PCI subsystem IDs. If the matching entry
returns the config field value. is found, it returns the config field value.
snd_hda_add_new_ctls() can be used to create and add control entries. snd_hda_add_new_ctls() can be used to create and add control entries.
Pass the zero-terminated array of struct snd_kcontrol_new. The same array Pass the zero-terminated array of struct snd_kcontrol_new. The same array
......
...@@ -1714,6 +1714,8 @@ EXPORT_SYMBOL(snd_hda_build_pcms); ...@@ -1714,6 +1714,8 @@ EXPORT_SYMBOL(snd_hda_build_pcms);
/** /**
* snd_hda_check_board_config - compare the current codec with the config table * snd_hda_check_board_config - compare the current codec with the config table
* @codec: the HDA codec * @codec: the HDA codec
* @num_configs: number of config enums
* @models: array of model name strings
* @tbl: configuration table, terminated by null entries * @tbl: configuration table, terminated by null entries
* *
* Compares the modelname or PCI subsystem id of the current codec with the * Compares the modelname or PCI subsystem id of the current codec with the
...@@ -1722,33 +1724,44 @@ EXPORT_SYMBOL(snd_hda_build_pcms); ...@@ -1722,33 +1724,44 @@ EXPORT_SYMBOL(snd_hda_build_pcms);
* *
* If no entries are matching, the function returns a negative value. * If no entries are matching, the function returns a negative value.
*/ */
int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_config *tbl) int snd_hda_check_board_config(struct hda_codec *codec,
{ int num_configs, const char **models,
const struct hda_board_config *c; const struct snd_pci_quirk *tbl)
{
if (codec->bus->modelname) { if (codec->bus->modelname && models) {
for (c = tbl; c->modelname || c->pci_subvendor; c++) { int i;
if (c->modelname && for (i = 0; i < num_configs; i++) {
! strcmp(codec->bus->modelname, c->modelname)) { if (models[i] &&
snd_printd(KERN_INFO "hda_codec: model '%s' is selected\n", c->modelname); !strcmp(codec->bus->modelname, models[i])) {
return c->config; snd_printd(KERN_INFO "hda_codec: model '%s' is "
"selected\n", models[i]);
return i;
} }
} }
} }
if (codec->bus->pci) { if (!codec->bus->pci || !tbl)
u16 subsystem_vendor, subsystem_device; return -1;
pci_read_config_word(codec->bus->pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
pci_read_config_word(codec->bus->pci, PCI_SUBSYSTEM_ID, &subsystem_device); tbl = snd_pci_quirk_lookup(codec->bus->pci, tbl);
for (c = tbl; c->modelname || c->pci_subvendor; c++) { if (!tbl)
if (c->pci_subvendor == subsystem_vendor && return -1;
(! c->pci_subdevice /* all match */|| if (tbl->value >= 0 && tbl->value < num_configs) {
(c->pci_subdevice == subsystem_device))) { #ifdef CONFIG_SND_DEBUG_DETECT
snd_printdd(KERN_INFO "hda_codec: PCI %x:%x, codec config %d is selected\n", char tmp[10];
subsystem_vendor, subsystem_device, c->config); const char *model = NULL;
return c->config; if (models)
} model = models[tbl->value];
if (!model) {
sprintf(tmp, "#%d", tbl->value);
model = tmp;
} }
snd_printdd(KERN_INFO "hda_codec: model '%s' is selected "
"for config %x:%x (%s)\n",
model, tbl->subvendor, tbl->subdevice,
(tbl->name ? tbl->name : "Unknown device"));
#endif
return tbl->value;
} }
return -1; return -1;
} }
......
...@@ -173,14 +173,9 @@ static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } ...@@ -173,14 +173,9 @@ static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; }
/* /*
* Misc * Misc
*/ */
struct hda_board_config { int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
const char *modelname; const char **modelnames,
int config; const struct snd_pci_quirk *pci_list);
unsigned short pci_subvendor;
unsigned short pci_subdevice;
};
int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_config *tbl);
int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew);
/* /*
......
...@@ -787,55 +787,43 @@ static struct hda_verb ad1986a_eapd_init_verbs[] = { ...@@ -787,55 +787,43 @@ static struct hda_verb ad1986a_eapd_init_verbs[] = {
}; };
/* models */ /* models */
enum { AD1986A_6STACK, AD1986A_3STACK, AD1986A_LAPTOP, AD1986A_LAPTOP_EAPD }; enum {
AD1986A_6STACK,
static struct hda_board_config ad1986a_cfg_tbl[] = { AD1986A_3STACK,
{ .modelname = "6stack", .config = AD1986A_6STACK }, AD1986A_LAPTOP,
{ .modelname = "3stack", .config = AD1986A_3STACK }, AD1986A_LAPTOP_EAPD,
{ .pci_subvendor = 0x10de, .pci_subdevice = 0xcb84, AD1986A_MODELS
.config = AD1986A_3STACK }, /* ASUS A8N-VM CSM */ };
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x817f,
.config = AD1986A_3STACK }, /* ASUS P5P-L2 */ static const char *ad1986a_models[AD1986A_MODELS] = {
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x81b3, [AD1986A_6STACK] = "6stack",
.config = AD1986A_3STACK }, /* ASUS P5RD2-VM / P5GPL-X SE */ [AD1986A_3STACK] = "3stack",
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x81cb, [AD1986A_LAPTOP] = "laptop",
.config = AD1986A_3STACK }, /* ASUS M2NPV-VM */ [AD1986A_LAPTOP_EAPD] = "laptop-eapd",
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x8234, };
.config = AD1986A_3STACK }, /* ASUS M2N-MX */
{ .pci_subvendor = 0x17aa, .pci_subdevice = 0x1017, static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
.config = AD1986A_3STACK }, /* Lenovo A60 desktop */ SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_LAPTOP_EAPD),
{ .modelname = "laptop", .config = AD1986A_LAPTOP }, SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK),
{ .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e, SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP }, /* FSC V2060 */ SND_PCI_QUIRK(0x1043, 0x1213, "ASUS A6J", AD1986A_LAPTOP_EAPD),
{ .pci_subvendor = 0x17c0, .pci_subdevice = 0x2017, SND_PCI_QUIRK(0x1043, 0x11f7, "ASUS U5A", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP }, /* Samsung M50 */ SND_PCI_QUIRK(0x1043, 0x1263, "ASUS U5F", AD1986A_LAPTOP_EAPD),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x818f, SND_PCI_QUIRK(0x1043, 0x1297, "ASUS Z62F", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP }, /* ASUS P5GV-MX */ SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS V1j", AD1986A_LAPTOP_EAPD),
{ .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD }, SND_PCI_QUIRK(0x1043, 0x1302, "ASUS W3j", AD1986A_LAPTOP_EAPD),
{ .pci_subvendor = 0x144d, .pci_subdevice = 0xc023, SND_PCI_QUIRK(0x1043, 0x817f, "ASUS P5", AD1986A_3STACK),
.config = AD1986A_LAPTOP_EAPD }, /* Samsung X60 Chane */ SND_PCI_QUIRK(0x1043, 0x818f, "ASUS P5", AD1986A_LAPTOP),
{ .pci_subvendor = 0x144d, .pci_subdevice = 0xc024, SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK),
.config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */ SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
{ .pci_subvendor = 0x144d, .pci_subdevice = 0xc026, SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
.config = AD1986A_LAPTOP_EAPD }, /* Samsung X11-T2300 Culesa */ SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1153, SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP_EAPD }, /* ASUS M9 */ SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1213, SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD),
.config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1263,
.config = AD1986A_LAPTOP_EAPD }, /* ASUS U5F */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1297,
.config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x12b3,
.config = AD1986A_LAPTOP_EAPD }, /* ASUS V1j */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1302,
.config = AD1986A_LAPTOP_EAPD }, /* ASUS W3j */
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
.config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */
{ .pci_subvendor = 0x17aa, .pci_subdevice = 0x2066,
.config = AD1986A_LAPTOP_EAPD }, /* Lenovo 3000 N100-07684JU */
{} {}
}; };
...@@ -867,7 +855,9 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -867,7 +855,9 @@ static int patch_ad1986a(struct hda_codec *codec)
codec->patch_ops = ad198x_patch_ops; codec->patch_ops = ad198x_patch_ops;
/* override some parameters */ /* override some parameters */
board_config = snd_hda_check_board_config(codec, ad1986a_cfg_tbl); board_config = snd_hda_check_board_config(codec, AD1986A_MODELS,
ad1986a_models,
ad1986a_cfg_tbl);
switch (board_config) { switch (board_config) {
case AD1986A_3STACK: case AD1986A_3STACK:
spec->num_mixers = 2; spec->num_mixers = 2;
...@@ -1397,20 +1387,27 @@ static struct hda_input_mux ad1981_thinkpad_capture_source = { ...@@ -1397,20 +1387,27 @@ static struct hda_input_mux ad1981_thinkpad_capture_source = {
}; };
/* models */ /* models */
enum { AD1981_BASIC, AD1981_HP, AD1981_THINKPAD }; enum {
AD1981_BASIC,
AD1981_HP,
AD1981_THINKPAD,
AD1981_MODELS
};
static struct hda_board_config ad1981_cfg_tbl[] = { static const char *ad1981_models[AD1981_MODELS] = {
{ .modelname = "hp", .config = AD1981_HP }, [AD1981_HP] = "hp",
[AD1981_THINKPAD] = "thinkpad",
[AD1981_BASIC] = "basic",
};
static struct snd_pci_quirk ad1981_cfg_tbl[] = {
/* All HP models */ /* All HP models */
{ .pci_subvendor = 0x103c, .config = AD1981_HP }, SND_PCI_QUIRK(0x103c, 0, "HP nx", AD1981_HP),
{ .pci_subvendor = 0x30b0, .pci_subdevice = 0x103c, /* HP nx6320 (reversed SSID, H/W bug) */
.config = AD1981_HP }, /* HP nx6320 (reversed SSID, H/W bug) */ SND_PCI_QUIRK(0x30b0, 0x103c, "HP nx6320", AD1981_HP),
{ .modelname = "thinkpad", .config = AD1981_THINKPAD },
/* Lenovo Thinkpad T60/X60/Z6xx */ /* Lenovo Thinkpad T60/X60/Z6xx */
{ .pci_subvendor = 0x17aa, .config = AD1981_THINKPAD }, SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD),
{ .pci_subvendor = 0x1014, .pci_subdevice = 0x0597, SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
.config = AD1981_THINKPAD }, /* Z60m/t */
{ .modelname = "basic", .config = AD1981_BASIC },
{} {}
}; };
...@@ -1443,7 +1440,9 @@ static int patch_ad1981(struct hda_codec *codec) ...@@ -1443,7 +1440,9 @@ static int patch_ad1981(struct hda_codec *codec)
codec->patch_ops = ad198x_patch_ops; codec->patch_ops = ad198x_patch_ops;
/* override some parameters */ /* override some parameters */
board_config = snd_hda_check_board_config(codec, ad1981_cfg_tbl); board_config = snd_hda_check_board_config(codec, AD1981_MODELS,
ad1981_models,
ad1981_cfg_tbl);
switch (board_config) { switch (board_config) {
case AD1981_HP: case AD1981_HP:
spec->mixers[0] = ad1981_hp_mixers; spec->mixers[0] = ad1981_hp_mixers;
...@@ -2571,15 +2570,14 @@ static int ad1988_auto_init(struct hda_codec *codec) ...@@ -2571,15 +2570,14 @@ static int ad1988_auto_init(struct hda_codec *codec)
/* /*
*/ */
static struct hda_board_config ad1988_cfg_tbl[] = { static const char *ad1988_models[AD1988_MODEL_LAST] = {
{ .modelname = "6stack", .config = AD1988_6STACK }, [AD1988_6STACK] = "6stack",
{ .modelname = "6stack-dig", .config = AD1988_6STACK_DIG }, [AD1988_6STACK_DIG] = "6stack-dig",
{ .modelname = "3stack", .config = AD1988_3STACK }, [AD1988_3STACK] = "3stack",
{ .modelname = "3stack-dig", .config = AD1988_3STACK_DIG }, [AD1988_3STACK_DIG] = "3stack-dig",
{ .modelname = "laptop", .config = AD1988_LAPTOP }, [AD1988_LAPTOP] = "laptop",
{ .modelname = "laptop-dig", .config = AD1988_LAPTOP_DIG }, [AD1988_LAPTOP_DIG] = "laptop-dig",
{ .modelname = "auto", .config = AD1988_AUTO }, [AD1988_AUTO] = "auto",
{}
}; };
static int patch_ad1988(struct hda_codec *codec) static int patch_ad1988(struct hda_codec *codec)
...@@ -2597,8 +2595,9 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -2597,8 +2595,9 @@ static int patch_ad1988(struct hda_codec *codec)
if (is_rev2(codec)) if (is_rev2(codec))
snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST,
if (board_config < 0 || board_config >= AD1988_MODEL_LAST) { ad1988_models, NULL);
if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n"); printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n");
board_config = AD1988_AUTO; board_config = AD1988_AUTO;
} }
......
...@@ -40,6 +40,7 @@ enum { ...@@ -40,6 +40,7 @@ enum {
CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */ CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */
CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */ CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */
CMI_AUTO, /* let driver guess it */ CMI_AUTO, /* let driver guess it */
CMI_MODELS
}; };
struct cmi_spec { struct cmi_spec {
...@@ -603,14 +604,17 @@ static void cmi9880_free(struct hda_codec *codec) ...@@ -603,14 +604,17 @@ static void cmi9880_free(struct hda_codec *codec)
/* /*
*/ */
static struct hda_board_config cmi9880_cfg_tbl[] = { static const char *cmi9880_models[CMI_MODELS] = {
{ .modelname = "minimal", .config = CMI_MINIMAL }, [CMI_MINIMAL] = "minimal",
{ .modelname = "min_fp", .config = CMI_MIN_FP }, [CMI_MIN_FP] = "min_fp",
{ .modelname = "full", .config = CMI_FULL }, [CMI_FULL] = "full",
{ .modelname = "full_dig", .config = CMI_FULL_DIG }, [CMI_FULL_DIG] = "full_dig",
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x813d, .config = CMI_FULL_DIG }, /* ASUS P5AD2 */ [CMI_ALLOUT] = "allout",
{ .modelname = "allout", .config = CMI_ALLOUT }, [CMI_AUTO] = "auto",
{ .modelname = "auto", .config = CMI_AUTO }, };
static struct snd_pci_quirk cmi9880_cfg_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG),
{} /* terminator */ {} /* terminator */
}; };
...@@ -633,7 +637,9 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -633,7 +637,9 @@ static int patch_cmi9880(struct hda_codec *codec)
return -ENOMEM; return -ENOMEM;
codec->spec = spec; codec->spec = spec;
spec->board_config = snd_hda_check_board_config(codec, cmi9880_cfg_tbl); spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
cmi9880_models,
cmi9880_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n"); snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n");
spec->board_config = CMI_AUTO; /* try everything */ spec->board_config = CMI_AUTO; /* try everything */
......
...@@ -802,22 +802,22 @@ static int cxt5045_init(struct hda_codec *codec) ...@@ -802,22 +802,22 @@ static int cxt5045_init(struct hda_codec *codec)
enum { enum {
CXT5045_LAPTOP, CXT5045_LAPTOP, /* Laptops w/ EAPD support */
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
CXT5045_TEST, CXT5045_TEST,
#endif #endif
CXT5045_MODELS
}; };
static struct hda_board_config cxt5045_cfg_tbl[] = { static const char *cxt5045_models[CXT5045_MODELS] = {
/* Laptops w/ EAPD support */ [CXT5045_LAPTOP] = "laptop",
{ .modelname = "laptop", .config = CXT5045_LAPTOP },
/* HP DV6000Z */
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x30b7,
.config = CXT5045_LAPTOP },
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
{ .modelname = "test", .config = CXT5045_TEST }, [CXT5045_TEST] = "test",
#endif #endif
};
static struct snd_pci_quirk cxt5045_cfg_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP),
{} {}
}; };
...@@ -852,7 +852,9 @@ static int patch_cxt5045(struct hda_codec *codec) ...@@ -852,7 +852,9 @@ static int patch_cxt5045(struct hda_codec *codec)
codec->patch_ops = conexant_patch_ops; codec->patch_ops = conexant_patch_ops;
codec->patch_ops.unsol_event = cxt5045_hp_unsol_event; codec->patch_ops.unsol_event = cxt5045_hp_unsol_event;
board_config = snd_hda_check_board_config(codec, cxt5045_cfg_tbl); board_config = snd_hda_check_board_config(codec, CXT5045_MODELS,
cxt5045_models,
cxt5045_cfg_tbl);
switch (board_config) { switch (board_config) {
case CXT5045_LAPTOP: case CXT5045_LAPTOP:
spec->input_mux = &cxt5045_capture_source; spec->input_mux = &cxt5045_capture_source;
...@@ -1214,36 +1216,29 @@ static int cxt5047_hp_init(struct hda_codec *codec) ...@@ -1214,36 +1216,29 @@ static int cxt5047_hp_init(struct hda_codec *codec)
enum { enum {
CXT5047_LAPTOP, CXT5047_LAPTOP, /* Laptops w/o EAPD support */
CXT5047_LAPTOP_HP, /* Some HP laptops */
CXT5047_LAPTOP_EAPD, /* Laptops with EAPD support */
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
CXT5047_TEST, CXT5047_TEST,
#endif #endif
CXT5047_LAPTOP_HP, CXT5047_MODELS
CXT5047_LAPTOP_EAPD
}; };
static struct hda_board_config cxt5047_cfg_tbl[] = { static const char *cxt5047_models[CXT5047_MODELS] = {
/* Laptops w/o EAPD support */ [CXT5047_LAPTOP] = "laptop",
{ .modelname = "laptop", .config = CXT5047_LAPTOP }, [CXT5047_LAPTOP_HP] = "laptop-hp",
/*HP DV1000 */ [CXT5047_LAPTOP_EAPD] = "laptop-eapd",
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x30a0,
.config = CXT5047_LAPTOP },
/*HP DV2000T/DV3000T */
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x30b2,
.config = CXT5047_LAPTOP },
/* Not all HP's are created equal */
{ .modelname = "laptop-hp", .config = CXT5047_LAPTOP_HP },
/*HP DV5200TX/DV8000T / Compaq V5209US/V5204NR */
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x30a5,
.config = CXT5047_LAPTOP_HP },
/* Laptops with EAPD support */
{ .modelname = "laptop-eapd", .config = CXT5047_LAPTOP_EAPD },
{ .pci_subvendor = 0x1179, .pci_subdevice = 0xff31,
.config = CXT5047_LAPTOP_EAPD }, /* Toshiba P100 */
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
{ .modelname = "test", .config = CXT5047_TEST }, [CXT5047_TEST] = "test",
#endif #endif
};
static struct snd_pci_quirk cxt5047_cfg_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP),
SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP),
SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP),
SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD),
{} {}
}; };
...@@ -1277,7 +1272,9 @@ static int patch_cxt5047(struct hda_codec *codec) ...@@ -1277,7 +1272,9 @@ static int patch_cxt5047(struct hda_codec *codec)
codec->patch_ops = conexant_patch_ops; codec->patch_ops = conexant_patch_ops;
codec->patch_ops.unsol_event = cxt5047_hp_unsol_event; codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
board_config = snd_hda_check_board_config(codec, cxt5047_cfg_tbl); board_config = snd_hda_check_board_config(codec, CXT5047_MODELS,
cxt5047_models,
cxt5047_cfg_tbl);
switch (board_config) { switch (board_config) {
case CXT5047_LAPTOP: case CXT5047_LAPTOP:
break; break;
......
...@@ -2328,162 +2328,108 @@ static struct hda_verb alc880_test_init_verbs[] = { ...@@ -2328,162 +2328,108 @@ static struct hda_verb alc880_test_init_verbs[] = {
/* /*
*/ */
static struct hda_board_config alc880_cfg_tbl[] = { static const char *alc880_models[ALC880_MODEL_LAST] = {
/* Back 3 jack, front 2 jack */ [ALC880_3ST] = "3stack",
{ .modelname = "3stack", .config = ALC880_3ST }, [ALC880_TCL_S700] = "tcl",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe200, .config = ALC880_3ST }, [ALC880_3ST_DIG] = "3stack-digout",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe201, .config = ALC880_3ST }, [ALC880_CLEVO] = "clevo",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe202, .config = ALC880_3ST }, [ALC880_5ST] = "5stack",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe203, .config = ALC880_3ST }, [ALC880_5ST_DIG] = "5stack-digout",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe204, .config = ALC880_3ST }, [ALC880_W810] = "w810",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe205, .config = ALC880_3ST }, [ALC880_Z71V] = "z71v",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe206, .config = ALC880_3ST }, [ALC880_6ST] = "6stack",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe207, .config = ALC880_3ST }, [ALC880_6ST_DIG] = "6stack-digout",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe208, .config = ALC880_3ST }, [ALC880_ASUS] = "asus",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe209, .config = ALC880_3ST }, [ALC880_ASUS_W1V] = "asus-w1v",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20a, .config = ALC880_3ST }, [ALC880_ASUS_DIG] = "asus-dig",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20b, .config = ALC880_3ST }, [ALC880_ASUS_DIG2] = "asus-dig2",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20c, .config = ALC880_3ST }, [ALC880_UNIWILL_DIG] = "uniwill",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20d, .config = ALC880_3ST }, [ALC880_F1734] = "F1734",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20e, .config = ALC880_3ST }, [ALC880_LG] = "lg",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe20f, .config = ALC880_3ST }, [ALC880_LG_LW] = "lg-lw",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe210, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe211, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe212, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe213, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe214, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe234, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe302, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe303, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe304, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe306, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe307, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe404, .config = ALC880_3ST },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xa101, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x3031, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4036, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4037, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4038, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4040, .config = ALC880_3ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4041, .config = ALC880_3ST },
/* TCL S700 */
{ .modelname = "tcl", .config = ALC880_TCL_S700 },
{ .pci_subvendor = 0x19db, .pci_subdevice = 0x4188, .config = ALC880_TCL_S700 },
/* Back 3 jack, front 2 jack (Internal add Aux-In) */
{ .pci_subvendor = 0x1025, .pci_subdevice = 0xe310, .config = ALC880_3ST },
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81d6, .config = ALC880_3ST },
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81a0, .config = ALC880_3ST },
/* Back 3 jack plus 1 SPDIF out jack, front 2 jack */
{ .modelname = "3stack-digout", .config = ALC880_3ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe308, .config = ALC880_3ST_DIG },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x0070, .config = ALC880_3ST_DIG },
/* Clevo laptops */
{ .modelname = "clevo", .config = ALC880_CLEVO },
{ .pci_subvendor = 0x1558, .pci_subdevice = 0x0520,
.config = ALC880_CLEVO }, /* Clevo m520G NB */
{ .pci_subvendor = 0x1558, .pci_subdevice = 0x0660,
.config = ALC880_CLEVO }, /* Clevo m665n */
/* Back 3 jack plus 1 SPDIF out jack, front 2 jack (Internal add Aux-In)*/
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe305, .config = ALC880_3ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xd402, .config = ALC880_3ST_DIG },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0xe309, .config = ALC880_3ST_DIG },
/* Back 5 jack, front 2 jack */
{ .modelname = "5stack", .config = ALC880_5ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x3033, .config = ALC880_5ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x4039, .config = ALC880_5ST },
{ .pci_subvendor = 0x107b, .pci_subdevice = 0x3032, .config = ALC880_5ST },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x2a09, .config = ALC880_5ST },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x814e, .config = ALC880_5ST },
/* Back 5 jack plus 1 SPDIF out jack, front 2 jack */
{ .modelname = "5stack-digout", .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe224, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe400, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe401, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xe402, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xd400, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xd401, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xa100, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x1565, .pci_subdevice = 0x8202, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0x1019, .pci_subdevice = 0xa880, .config = ALC880_5ST_DIG },
{ .pci_subvendor = 0xa0a0, .pci_subdevice = 0x0560,
.config = ALC880_5ST_DIG }, /* Aopen i915GMm-HFS */
/* { .pci_subvendor = 0x1019, .pci_subdevice = 0xa884, .config = ALC880_5ST_DIG }, */ /* conflict with 6stack */
{ .pci_subvendor = 0x1695, .pci_subdevice = 0x400d, .config = ALC880_5ST_DIG },
/* note subvendor = 0 below */
/* { .pci_subvendor = 0x0000, .pci_subdevice = 0x8086, .config = ALC880_5ST_DIG }, */
{ .modelname = "w810", .config = ALC880_W810 },
{ .pci_subvendor = 0x161f, .pci_subdevice = 0x203d, .config = ALC880_W810 },
{ .modelname = "z71v", .config = ALC880_Z71V },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_Z71V },
{ .modelname = "6stack", .config = ALC880_6ST },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x8196, .config = ALC880_6ST }, /* ASUS P5GD1-HVM */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x81b4, .config = ALC880_6ST },
{ .pci_subvendor = 0x1019, .pci_subdevice = 0xa884, .config = ALC880_6ST }, /* Acer APFV */
{ .modelname = "6stack-digout", .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x2668, .pci_subdevice = 0x8086, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x8086, .pci_subdevice = 0x2668, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x1150, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0xe803, .pci_subdevice = 0x1019, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1039, .pci_subdevice = 0x1234, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x0077, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x0078, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG },
{ .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */
{ .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */
{ .pci_subvendor = 0x1695, .pci_subdevice = 0x4012, .config = ALC880_5ST_DIG }, /* Epox EP-5LDA+ GLi */
{ .pci_subvendor = 0x1458, .pci_subdevice = 0xa102, .config = ALC880_6ST_DIG }, /* Gigabyte K8N51 */
{ .modelname = "asus", .config = ALC880_ASUS },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1973, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x19b3, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1113, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1173, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1993, .config = ALC880_ASUS },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x10c2, .config = ALC880_ASUS_DIG }, /* Asus W6A */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x10c3, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1133, .config = ALC880_ASUS },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1123, .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1143, .config = ALC880_ASUS },
{ .modelname = "asus-w1v", .config = ALC880_ASUS_W1V },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x10b3, .config = ALC880_ASUS_W1V },
{ .modelname = "asus-dig", .config = ALC880_ASUS_DIG },
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x8181, .config = ALC880_ASUS_DIG }, /* ASUS P4GPL-X */
{ .modelname = "asus-dig2", .config = ALC880_ASUS_DIG2 },
{ .pci_subvendor = 0x1558, .pci_subdevice = 0x5401, .config = ALC880_ASUS_DIG2 },
{ .modelname = "uniwill", .config = ALC880_UNIWILL_DIG },
{ .pci_subvendor = 0x1584, .pci_subdevice = 0x9050, .config = ALC880_UNIWILL_DIG },
{ .pci_subvendor = 0x1584, .pci_subdevice = 0x9070, .config = ALC880_UNIWILL },
{ .pci_subvendor = 0x1734, .pci_subdevice = 0x10ac, .config = ALC880_UNIWILL },
{ .pci_subvendor = 0x1584, .pci_subdevice = 0x9077, .config = ALC880_UNIWILL_P53 },
{ .modelname = "F1734", .config = ALC880_F1734 },
{ .pci_subvendor = 0x1734, .pci_subdevice = 0x107c, .config = ALC880_F1734 },
{ .pci_subvendor = 0x1584, .pci_subdevice = 0x9054, .config = ALC880_F1734 },
{ .modelname = "lg", .config = ALC880_LG },
{ .pci_subvendor = 0x1854, .pci_subdevice = 0x003b, .config = ALC880_LG },
{ .pci_subvendor = 0x1854, .pci_subdevice = 0x0068, .config = ALC880_LG },
{ .modelname = "lg-lw", .config = ALC880_LG_LW },
{ .pci_subvendor = 0x1854, .pci_subdevice = 0x0018, .config = ALC880_LG_LW },
{ .pci_subvendor = 0x1854, .pci_subdevice = 0x0077, .config = ALC880_LG_LW },
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
{ .modelname = "test", .config = ALC880_TEST }, [ALC880_TEST] = "test",
#endif #endif
{ .modelname = "auto", .config = ALC880_AUTO }, [ALC880_AUTO] = "auto",
};
static struct snd_pci_quirk alc880_cfg_tbl[] = {
/* Broken BIOS configuration */
SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG),
SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
/* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x814e, "ASUS", ALC880_5ST),
SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
SND_PCI_QUIRK(0x1043, 0, "ASUS", ALC880_ASUS),
SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
SND_PCI_QUIRK(0x1584, 0x9054, "Uniwlll", ALC880_F1734),
SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1734, 0x10ac, "FSC", ALC880_UNIWILL),
SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0, "Intel mobo", ALC880_3ST),
{} {}
}; };
...@@ -3074,8 +3020,10 @@ static int patch_alc880(struct hda_codec *codec) ...@@ -3074,8 +3020,10 @@ static int patch_alc880(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
board_config = snd_hda_check_board_config(codec, alc880_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC880_MODEL_LAST,
if (board_config < 0 || board_config >= ALC880_MODEL_LAST) { alc880_models,
alc880_cfg_tbl);
if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for ALC880, " printk(KERN_INFO "hda_codec: Unknown model for ALC880, "
"trying auto-probe from BIOS...\n"); "trying auto-probe from BIOS...\n");
board_config = ALC880_AUTO; board_config = ALC880_AUTO;
...@@ -4161,33 +4109,32 @@ static void alc260_auto_init(struct hda_codec *codec) ...@@ -4161,33 +4109,32 @@ static void alc260_auto_init(struct hda_codec *codec)
/* /*
* ALC260 configurations * ALC260 configurations
*/ */
static struct hda_board_config alc260_cfg_tbl[] = { static const char *alc260_models[ALC260_MODEL_LAST] = {
{ .modelname = "basic", .config = ALC260_BASIC }, [ALC260_BASIC] = "basic",
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb, [ALC260_HP] = "hp",
.config = ALC260_BASIC }, /* Sony VAIO */ [ALC260_HP_3013] = "hp-3013",
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81cc, [ALC260_FUJITSU_S702X] = "fujitsu",
.config = ALC260_BASIC }, /* Sony VAIO VGN-S3HP */ [ALC260_ACER] = "acer",
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81cd,
.config = ALC260_BASIC }, /* Sony VAIO */
{ .pci_subvendor = 0x152d, .pci_subdevice = 0x0729,
.config = ALC260_BASIC }, /* CTL Travel Master U553W */
{ .modelname = "hp", .config = ALC260_HP },
{ .modelname = "hp-3013", .config = ALC260_HP_3013 },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP_3013 },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP_3013 },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, .config = ALC260_HP },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3015, .config = ALC260_HP },
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3016, .config = ALC260_HP },
{ .modelname = "fujitsu", .config = ALC260_FUJITSU_S702X },
{ .pci_subvendor = 0x10cf, .pci_subdevice = 0x1326, .config = ALC260_FUJITSU_S702X },
{ .modelname = "acer", .config = ALC260_ACER },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x008f, .config = ALC260_ACER },
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
{ .modelname = "test", .config = ALC260_TEST }, [ALC260_TEST] = "test",
#endif #endif
{ .modelname = "auto", .config = ALC260_AUTO }, [ALC260_AUTO] = "auto",
};
static struct snd_pci_quirk alc260_cfg_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP),
SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP),
SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP),
SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP),
SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC),
SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC),
SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC),
SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X),
SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
{} {}
}; };
...@@ -4286,8 +4233,10 @@ static int patch_alc260(struct hda_codec *codec) ...@@ -4286,8 +4233,10 @@ static int patch_alc260(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
board_config = snd_hda_check_board_config(codec, alc260_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC260_MODEL_LAST,
if (board_config < 0 || board_config >= ALC260_MODEL_LAST) { alc260_models,
alc260_cfg_tbl);
if (board_config < 0) {
snd_printd(KERN_INFO "hda_codec: Unknown model for ALC260, " snd_printd(KERN_INFO "hda_codec: Unknown model for ALC260, "
"trying auto-probe from BIOS...\n"); "trying auto-probe from BIOS...\n");
board_config = ALC260_AUTO; board_config = ALC260_AUTO;
...@@ -4668,19 +4617,18 @@ static struct snd_kcontrol_new alc882_capture_mixer[] = { ...@@ -4668,19 +4617,18 @@ static struct snd_kcontrol_new alc882_capture_mixer[] = {
/* /*
* configuration and preset * configuration and preset
*/ */
static struct hda_board_config alc882_cfg_tbl[] = { static const char *alc882_models[ALC882_MODEL_LAST] = {
{ .modelname = "3stack-dig", .config = ALC882_3ST_DIG }, [ALC882_3ST_DIG] = "3stack-dig",
{ .modelname = "6stack-dig", .config = ALC882_6ST_DIG }, [ALC882_6ST_DIG] = "6stack-dig",
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x6668, [ALC882_ARIMA] = "arima",
.config = ALC882_6ST_DIG }, /* MSI */ [ALC882_AUTO] = "auto",
{ .pci_subvendor = 0x105b, .pci_subdevice = 0x6668, };
.config = ALC882_6ST_DIG }, /* Foxconn */
{ .pci_subvendor = 0x1019, .pci_subdevice = 0x6668, static struct snd_pci_quirk alc882_cfg_tbl[] = {
.config = ALC882_6ST_DIG }, /* ECS to Intel*/ SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
{ .modelname = "arima", .config = ALC882_ARIMA }, SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
{ .pci_subvendor = 0x161f, .pci_subdevice = 0x2054, SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
.config = ALC882_ARIMA }, /* Arima W820Di1 */ SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA),
{ .modelname = "auto", .config = ALC882_AUTO },
{} {}
}; };
...@@ -4817,7 +4765,9 @@ static int patch_alc882(struct hda_codec *codec) ...@@ -4817,7 +4765,9 @@ static int patch_alc882(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
board_config = snd_hda_check_board_config(codec, alc882_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC882_MODEL_LAST,
alc882_models,
alc882_cfg_tbl);
if (board_config < 0 || board_config >= ALC882_MODEL_LAST) { if (board_config < 0 || board_config >= ALC882_MODEL_LAST) {
printk(KERN_INFO "hda_codec: Unknown model for ALC882, " printk(KERN_INFO "hda_codec: Unknown model for ALC882, "
...@@ -5427,65 +5377,41 @@ static struct snd_kcontrol_new alc883_capture_mixer[] = { ...@@ -5427,65 +5377,41 @@ static struct snd_kcontrol_new alc883_capture_mixer[] = {
/* /*
* configuration and preset * configuration and preset
*/ */
static struct hda_board_config alc883_cfg_tbl[] = { static const char *alc883_models[ALC883_MODEL_LAST] = {
{ .modelname = "3stack-dig", .config = ALC883_3ST_2ch_DIG }, [ALC883_3ST_2ch_DIG] = "3stack-dig",
{ .modelname = "3stack-6ch-dig", .config = ALC883_3ST_6ch_DIG }, [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
{ .pci_subvendor = 0x1019, .pci_subdevice = 0x6668, [ALC883_3ST_6ch] = "3stack-6ch",
.config = ALC883_3ST_6ch_DIG }, /* ECS to Intel*/ [ALC883_6ST_DIG] = "6stack-dig",
{ .modelname = "3stack-6ch", .config = ALC883_3ST_6ch }, [ALC883_TARGA_DIG] = "targa-dig",
{ .pci_subvendor = 0x108e, .pci_subdevice = 0x534d, [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
.config = ALC883_3ST_6ch }, [ALC888_DEMO_BOARD] = "6stack-dig-demo",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xd601, [ALC883_ACER] = "acer",
.config = ALC883_3ST_6ch }, /* D102GGC */ [ALC883_MEDION] = "medion",
{ .modelname = "6stack-dig", .config = ALC883_6ST_DIG }, [ALC883_LAPTOP_EAPD] = "laptop-eapd",
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x6668, [ALC883_AUTO] = "auto",
.config = ALC883_6ST_DIG }, /* MSI */ };
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x7280,
.config = ALC883_6ST_DIG }, /* MSI K9A Platinum (MS-7280) */ static struct snd_pci_quirk alc883_cfg_tbl[] = {
{ .pci_subvendor = 0x105b, .pci_subdevice = 0x6668, SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG),
.config = ALC883_6ST_DIG }, /* Foxconn */ SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x7187, SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD),
.config = ALC883_6ST_DIG }, /* MSI */ SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG),
{ .modelname = "targa-dig", .config = ALC883_TARGA_DIG }, SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x4314, SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x3fcc, SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x3fc1, SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x3fc3, SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x4314, SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x4319, SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x3ef9, SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
.config = ALC883_TARGA_DIG }, /* MSI */ SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x4324, SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch),
.config = ALC883_TARGA_DIG }, /* MSI */
{ .modelname = "targa-2ch-dig", .config = ALC883_TARGA_2ch_DIG },
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x0579,
.config = ALC883_TARGA_2ch_DIG }, /* MSI */
{ .pci_subvendor = 0x1462, .pci_subdevice = 0xa422,
.config = ALC883_TARGA_2ch_DIG }, /* MSI */
{ .pci_subvendor = 0x1462, .pci_subdevice = 0x3b7f,
.config = ALC883_TARGA_2ch_DIG }, /* MSI */
{ .modelname = "6stack-dig-demo", .config = ALC888_DEMO_BOARD },
{ .modelname = "acer", .config = ALC883_ACER },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0/*0x0102*/,
.config = ALC883_ACER },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x0102,
.config = ALC883_ACER },
{ .pci_subvendor = 0x1025, .pci_subdevice = 0x009f,
.config = ALC883_ACER },
{ .pci_subvendor = 0x161f, .pci_subdevice = 0x2054,
.modelname = "medion", .config = ALC883_MEDION },
{ .modelname = "laptop-eapd", .config = ALC883_LAPTOP_EAPD },
{ .pci_subvendor = 0x1071, .pci_subdevice = 0x8258,
.config = ALC883_LAPTOP_EAPD }, /* Evesham Voyager C530RD */
{ .pci_subvendor = 0x1558, .pci_subdevice = 0,
.config = ALC883_LAPTOP_EAPD }, /* Clevo */
{ .modelname = "auto", .config = ALC883_AUTO },
{} {}
}; };
...@@ -5734,8 +5660,10 @@ static int patch_alc883(struct hda_codec *codec) ...@@ -5734,8 +5660,10 @@ static int patch_alc883(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
board_config = snd_hda_check_board_config(codec, alc883_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC883_MODEL_LAST,
if (board_config < 0 || board_config >= ALC883_MODEL_LAST) { alc883_models,
alc883_cfg_tbl);
if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for ALC883, " printk(KERN_INFO "hda_codec: Unknown model for ALC883, "
"trying auto-probe from BIOS...\n"); "trying auto-probe from BIOS...\n");
board_config = ALC883_AUTO; board_config = ALC883_AUTO;
...@@ -6438,35 +6366,27 @@ static void alc262_auto_init(struct hda_codec *codec) ...@@ -6438,35 +6366,27 @@ static void alc262_auto_init(struct hda_codec *codec)
/* /*
* configuration and preset * configuration and preset
*/ */
static struct hda_board_config alc262_cfg_tbl[] = { static const char *alc262_models[ALC262_MODEL_LAST] = {
{ .modelname = "basic", .config = ALC262_BASIC }, [ALC262_BASIC] = "basic",
{ .modelname = "hippo", [ALC262_HIPPO] = "hippo",
.pci_subvendor =0x1002, .pci_subdevice = 0x437b, [ALC262_HIPPO_1] = "hippo_1",
.config = ALC262_HIPPO}, [ALC262_FUJITSU] = "fujitsu",
{ .modelname = "hippo", [ALC262_HP_BPC] = "hp-bpc",
.pci_subvendor = 0x104d, .pci_subdevice = 0x8203, [ALC262_BENQ_ED8] = "benq",
.config = ALC262_HIPPO }, /* Sony UX-90s */ [ALC262_AUTO] = "auto",
{ .modelname = "hippo_1", };
.pci_subvendor =0x17ff, .pci_subdevice = 0x058f,
.config = ALC262_HIPPO_1}, static struct snd_pci_quirk alc262_cfg_tbl[] = {
{ .modelname = "fujitsu", .config = ALC262_FUJITSU }, SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO),
{ .pci_subvendor = 0x10cf, .pci_subdevice = 0x1397, SND_PCI_QUIRK(0x103c, 0x12fe, "HP xw9400", ALC262_HP_BPC),
.config = ALC262_FUJITSU }, SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC),
{ .modelname = "hp-bpc", .config = ALC262_HP_BPC }, SND_PCI_QUIRK(0x103c, 0x2801, "HP q954", ALC262_HP_BPC),
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x280c, SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC),
.config = ALC262_HP_BPC }, /* xw4400 */ SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC),
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x2801, SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
.config = ALC262_HP_BPC }, /* q965 */ SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1),
.config = ALC262_HP_BPC }, /* xw6400 */ SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x3015,
.config = ALC262_HP_BPC }, /* xw8400 */
{ .pci_subvendor = 0x103c, .pci_subdevice = 0x12fe,
.config = ALC262_HP_BPC }, /* xw9400 */
{ .modelname = "benq", .config = ALC262_BENQ_ED8 },
{ .pci_subvendor = 0x17ff, .pci_subdevice = 0x0560,
.config = ALC262_BENQ_ED8 },
{ .modelname = "auto", .config = ALC262_AUTO },
{} {}
}; };
...@@ -6561,9 +6481,11 @@ static int patch_alc262(struct hda_codec *codec) ...@@ -6561,9 +6481,11 @@ static int patch_alc262(struct hda_codec *codec)
} }
#endif #endif
board_config = snd_hda_check_board_config(codec, alc262_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC262_MODEL_LAST,
alc262_models,
alc262_cfg_tbl);
if (board_config < 0 || board_config >= ALC262_MODEL_LAST) { if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for ALC262, " printk(KERN_INFO "hda_codec: Unknown model for ALC262, "
"trying auto-probe from BIOS...\n"); "trying auto-probe from BIOS...\n");
board_config = ALC262_AUTO; board_config = ALC262_AUTO;
...@@ -7527,30 +7449,26 @@ static void alc861_auto_init(struct hda_codec *codec) ...@@ -7527,30 +7449,26 @@ static void alc861_auto_init(struct hda_codec *codec)
/* /*
* configuration and preset * configuration and preset
*/ */
static struct hda_board_config alc861_cfg_tbl[] = { static const char *alc861_models[ALC861_MODEL_LAST] = {
{ .modelname = "3stack", .config = ALC861_3ST }, [ALC861_3ST] = "3stack",
{ .pci_subvendor = 0x8086, .pci_subdevice = 0xd600, [ALC660_3ST] = "3stack-660",
.config = ALC861_3ST }, [ALC861_3ST_DIG] = "3stack-dig",
{ .modelname = "3stack-660", .config = ALC660_3ST }, [ALC861_6ST_DIG] = "6stack-dig",
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x81e7, [ALC861_UNIWILL_M31] = "uniwill-m31",
.config = ALC660_3ST }, [ALC861_TOSHIBA] = "toshiba",
{ .modelname = "3stack-dig", .config = ALC861_3ST_DIG }, [ALC861_ASUS] = "asus",
{ .modelname = "6stack-dig", .config = ALC861_6ST_DIG }, [ALC861_ASUS_LAPTOP] = "asus-laptop",
{ .modelname = "uniwill-m31", .config = ALC861_UNIWILL_M31}, [ALC861_AUTO] = "auto",
{ .pci_subvendor = 0x1584, .pci_subdevice = 0x9072, };
.config = ALC861_UNIWILL_M31 },
{ .modelname = "toshiba", .config = ALC861_TOSHIBA }, static struct snd_pci_quirk alc861_cfg_tbl[] = {
{ .pci_subvendor = 0x1179, .pci_subdevice = 0xff10, SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP),
.config = ALC861_TOSHIBA }, SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP),
{ .modelname = "asus", .config = ALC861_ASUS}, SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1393, SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660_3ST),
.config = ALC861_ASUS }, SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA),
{ .modelname = "asus-laptop", .config = ALC861_ASUS_LAPTOP }, SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31),
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1335, SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST),
.config = ALC861_ASUS_LAPTOP }, /* ASUS F2/F3 */
{ .pci_subvendor = 0x1043, .pci_subdevice = 0x1338,
.config = ALC861_ASUS_LAPTOP }, /* ASUS F2/F3 */
{ .modelname = "auto", .config = ALC861_AUTO },
{} {}
}; };
...@@ -7673,9 +7591,11 @@ static int patch_alc861(struct hda_codec *codec) ...@@ -7673,9 +7591,11 @@ static int patch_alc861(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
board_config = snd_hda_check_board_config(codec, alc861_cfg_tbl); board_config = snd_hda_check_board_config(codec, ALC861_MODEL_LAST,
alc861_models,
alc861_cfg_tbl);
if (board_config < 0 || board_config >= ALC861_MODEL_LAST) { if (board_config < 0) {
printk(KERN_INFO "hda_codec: Unknown model for ALC861, " printk(KERN_INFO "hda_codec: Unknown model for ALC861, "
"trying auto-probe from BIOS...\n"); "trying auto-probe from BIOS...\n");
board_config = ALC861_AUTO; board_config = ALC861_AUTO;
......
...@@ -37,14 +37,30 @@ ...@@ -37,14 +37,30 @@
#define NUM_CONTROL_ALLOC 32 #define NUM_CONTROL_ALLOC 32
#define STAC_HP_EVENT 0x37 #define STAC_HP_EVENT 0x37
#define STAC_REF 0 enum {
#define STAC_D945GTP3 1 STAC_REF,
#define STAC_D945GTP5 2 STAC_9200_MODELS
#define STAC_MACMINI 3 };
#define STAC_922X_MODELS 4 /* number of 922x models */
#define STAC_D965_3ST 4 enum {
#define STAC_D965_5ST 5 STAC_9205_REF,
#define STAC_927X_MODELS 6 /* number of 927x models */ STAC_9205_MODELS
};
enum {
STAC_D945_REF,
STAC_D945GTP3,
STAC_D945GTP5,
STAC_MACMINI,
STAC_922X_MODELS
};
enum {
STAC_D965_REF,
STAC_D965_3ST,
STAC_D965_5ST,
STAC_927X_MODELS
};
struct sigmatel_spec { struct sigmatel_spec {
struct snd_kcontrol_new *mixers[4]; struct snd_kcontrol_new *mixers[4];
...@@ -373,22 +389,25 @@ static unsigned int ref9200_pin_configs[8] = { ...@@ -373,22 +389,25 @@ static unsigned int ref9200_pin_configs[8] = {
0x02a19020, 0x01a19021, 0x90100140, 0x01813122, 0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
}; };
static unsigned int *stac9200_brd_tbl[] = { static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
ref9200_pin_configs, [STAC_REF] = ref9200_pin_configs,
}; };
static struct hda_board_config stac9200_cfg_tbl[] = { static const char *stac9200_models[STAC_9200_MODELS] = {
{ .modelname = "ref", [STAC_REF] = "ref",
.pci_subvendor = PCI_VENDOR_ID_INTEL, };
.pci_subdevice = 0x2668, /* DFI LanParty */
.config = STAC_REF }, static struct snd_pci_quirk stac9200_cfg_tbl[] = {
/* SigmaTel reference board */
SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
"DFI LanParty", STAC_REF),
/* Dell laptops have BIOS problem */ /* Dell laptops have BIOS problem */
{ .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01b5, SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01b5,
.config = STAC_REF }, /* Dell Inspiron 630m */ "Dell Inspiron 630m", STAC_REF),
{ .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01c2, SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01c2,
.config = STAC_REF }, /* Dell Latitude D620 */ "Dell Latitude D620", STAC_REF),
{ .pci_subvendor = PCI_VENDOR_ID_DELL, .pci_subdevice = 0x01cb, SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb,
.config = STAC_REF }, /* Dell Latitude 120L */ "Dell Latitude 120L", STAC_REF),
{} /* terminator */ {} /* terminator */
}; };
...@@ -411,100 +430,80 @@ static unsigned int d945gtp5_pin_configs[10] = { ...@@ -411,100 +430,80 @@ static unsigned int d945gtp5_pin_configs[10] = {
}; };
static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
[STAC_REF] = ref922x_pin_configs, [STAC_D945_REF] = ref922x_pin_configs,
[STAC_D945GTP3] = d945gtp3_pin_configs, [STAC_D945GTP3] = d945gtp3_pin_configs,
[STAC_D945GTP5] = d945gtp5_pin_configs, [STAC_D945GTP5] = d945gtp5_pin_configs,
[STAC_MACMINI] = d945gtp5_pin_configs, [STAC_MACMINI] = d945gtp5_pin_configs,
}; };
static struct hda_board_config stac922x_cfg_tbl[] = { static const char *stac922x_models[STAC_922X_MODELS] = {
{ .modelname = "5stack", .config = STAC_D945GTP5 }, [STAC_D945_REF] = "ref",
{ .modelname = "3stack", .config = STAC_D945GTP3 }, [STAC_D945GTP5] = "5stack",
{ .modelname = "ref", [STAC_D945GTP3] = "3stack",
.pci_subvendor = PCI_VENDOR_ID_INTEL, [STAC_MACMINI] = "macmini",
.pci_subdevice = 0x2668, /* DFI LanParty */ };
.config = STAC_REF }, /* SigmaTel reference board */
/* Intel 945G based systems */ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, /* SigmaTel reference board */
.pci_subdevice = 0x0101, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
.config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ "DFI LanParty", STAC_D945_REF),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, /* Intel 945G based systems */
.pci_subdevice = 0x0202, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101,
.config = STAC_D945GTP3 }, /* Intel D945GNT - 3 Stack */ "Intel D945G", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0202,
.pci_subdevice = 0x0606, "Intel D945G", STAC_D945GTP3),
.config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0606,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP3),
.pci_subdevice = 0x0601, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0601,
.config = STAC_D945GTP3 }, /* Intel D945GTP - 3 Stack */ "Intel D945G", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0111,
.pci_subdevice = 0x0111, "Intel D945G", STAC_D945GTP3),
.config = STAC_D945GTP3 }, /* Intel D945GZP - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1115,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP3),
.pci_subdevice = 0x1115, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1116,
.config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ "Intel D945G", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1117,
.pci_subdevice = 0x1116, "Intel D945G", STAC_D945GTP3),
.config = STAC_D945GTP3 }, /* Intel D945GBO - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1118,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP3),
.pci_subdevice = 0x1117, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x1119,
.config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ "Intel D945G", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x8826,
.pci_subdevice = 0x1118, "Intel D945G", STAC_D945GTP3),
.config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5049,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP3),
.pci_subdevice = 0x1119, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5055,
.config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ "Intel D945G", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5048,
.pci_subdevice = 0x8826, "Intel D945G", STAC_D945GTP3),
.config = STAC_D945GTP3 }, /* Intel D945GPM - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0110,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP3),
.pci_subdevice = 0x5049, /* Intel D945G 5-stack systems */
.config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0404,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP5),
.pci_subdevice = 0x5055, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0303,
.config = STAC_D945GTP3 }, /* Intel D945GCZ - 3 Stack */ "Intel D945G", STAC_D945GTP5),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0013,
.pci_subdevice = 0x5048, "Intel D945G", STAC_D945GTP5),
.config = STAC_D945GTP3 }, /* Intel D945GPB - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0417,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945G", STAC_D945GTP5),
.pci_subdevice = 0x0110, /* Intel 945P based systems */
.config = STAC_D945GTP3 }, /* Intel D945GLR - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0b0b,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945P", STAC_D945GTP3),
.pci_subdevice = 0x0404, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0112,
.config = STAC_D945GTP5 }, /* Intel D945GTP - 5 Stack */ "Intel D945P", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0d0d,
.pci_subdevice = 0x0303, "Intel D945P", STAC_D945GTP3),
.config = STAC_D945GTP5 }, /* Intel D945GNT - 5 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0909,
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, "Intel D945P", STAC_D945GTP3),
.pci_subdevice = 0x0013, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0505,
.config = STAC_D945GTP5 }, /* Intel D955XBK - 5 Stack */ "Intel D945P", STAC_D945GTP3),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
.pci_subdevice = 0x0417, "Intel D945P", STAC_D945GTP5),
.config = STAC_D945GTP5 }, /* Intel D975XBK - 5 Stack */ /* other systems */
/* Intel 945P based systems */ /* Apple Mac Mini (early 2006) */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(0x8384, 0x7680,
.pci_subdevice = 0x0b0b, "Mac Mini", STAC_MACMINI),
.config = STAC_D945GTP3 }, /* Intel D945PSN - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x0112,
.config = STAC_D945GTP3 }, /* Intel D945PLN - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x0d0d,
.config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x0909,
.config = STAC_D945GTP3 }, /* Intel D945PAW - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x0505,
.config = STAC_D945GTP3 }, /* Intel D945PLM - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x0707,
.config = STAC_D945GTP5 }, /* Intel D945PSV - 5 Stack */
/* other systems */
{ .pci_subvendor = 0x8384,
.pci_subdevice = 0x7680,
.config = STAC_MACMINI }, /* Apple Mac Mini (early 2006) */
{} /* terminator */ {} /* terminator */
}; };
...@@ -530,102 +529,51 @@ static unsigned int d965_5st_pin_configs[14] = { ...@@ -530,102 +529,51 @@ static unsigned int d965_5st_pin_configs[14] = {
}; };
static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
[STAC_REF] = ref927x_pin_configs, [STAC_D965_REF] = ref927x_pin_configs,
[STAC_D965_3ST] = d965_3st_pin_configs, [STAC_D965_3ST] = d965_3st_pin_configs,
[STAC_D965_5ST] = d965_5st_pin_configs, [STAC_D965_5ST] = d965_5st_pin_configs,
}; };
static struct hda_board_config stac927x_cfg_tbl[] = { static const char *stac927x_models[STAC_927X_MODELS] = {
{ .modelname = "5stack", .config = STAC_D965_5ST }, [STAC_D965_REF] = "ref",
{ .modelname = "3stack", .config = STAC_D965_3ST }, [STAC_D965_3ST] = "3stack",
{ .modelname = "ref", [STAC_D965_5ST] = "5stack",
.pci_subvendor = PCI_VENDOR_ID_INTEL, };
.pci_subdevice = 0x2668, /* DFI LanParty */
.config = STAC_REF }, /* SigmaTel reference board */ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
/* SigmaTel reference board */
SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
"DFI LanParty", STAC_D965_REF),
/* Intel 946 based systems */ /* Intel 946 based systems */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST),
.pci_subdevice = 0x3d01, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* D946 configuration */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0xa301,
.config = STAC_D965_3ST }, /* Intel D946GZT - 3 stack */
/* 965 based 3 stack systems */ /* 965 based 3 stack systems */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2116, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2116, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2115, "Intel D965", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2114, "Intel D965", STAC_D965_3ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2113, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2115, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2112, "Intel D965", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* Intel DQ965WC - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2111, "Intel D965", STAC_D965_3ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2110, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2114, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2009, "Intel D965", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2008, "Intel D965", STAC_D965_3ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2007, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2113, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2006, "Intel D965", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2005, "Intel D965", STAC_D965_3ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2004, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2112, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST),
.config = STAC_D965_3ST }, /* Intel DG965MS - 3 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST),
.pci_subdevice = 0x2111,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2110,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2009,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2008,
.config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2007,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2006,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2005,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2004,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2003,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2002,
.config = STAC_D965_3ST }, /* Intel D965 3Stack config */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2001,
.config = STAC_D965_3ST }, /* Intel DQ965GF - 3 Stack */
/* 965 based 5 stack systems */ /* 965 based 5 stack systems */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST),
.pci_subdevice = 0x2301, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST),
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2304, "Intel D965", STAC_D965_5ST),
.pci_subdevice = 0x2302, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2305, "Intel D965", STAC_D965_5ST),
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2501, "Intel D965", STAC_D965_5ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2502, "Intel D965", STAC_D965_5ST),
.pci_subdevice = 0x2303, SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2503, "Intel D965", STAC_D965_5ST),
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2504, "Intel D965", STAC_D965_5ST),
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2304,
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2305,
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2501,
.config = STAC_D965_5ST }, /* Intel DG965MQ - 5 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2502,
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2503,
.config = STAC_D965_5ST }, /* Intel DG965 - 5 Stack */
{ .pci_subvendor = PCI_VENDOR_ID_INTEL,
.pci_subdevice = 0x2504,
.config = STAC_D965_5ST }, /* Intel DQ965GF - 5 Stack */
{} /* terminator */ {} /* terminator */
}; };
...@@ -635,15 +583,18 @@ static unsigned int ref9205_pin_configs[12] = { ...@@ -635,15 +583,18 @@ static unsigned int ref9205_pin_configs[12] = {
0x90a000f0, 0x90a000f0, 0x01441030, 0x01c41030 0x90a000f0, 0x90a000f0, 0x01441030, 0x01c41030
}; };
static unsigned int *stac9205_brd_tbl[] = { static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
ref9205_pin_configs, ref9205_pin_configs,
}; };
static struct hda_board_config stac9205_cfg_tbl[] = { static const char *stac9205_models[STAC_9205_MODELS] = {
{ .modelname = "ref", [STAC_9205_REF] = "ref",
.pci_subvendor = PCI_VENDOR_ID_INTEL, };
.pci_subdevice = 0x2668, /* DFI LanParty */
.config = STAC_REF }, /* SigmaTel reference board */ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
/* SigmaTel reference board */
SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
"DFI LanParty", STAC_9205_REF),
{} /* terminator */ {} /* terminator */
}; };
...@@ -1710,7 +1661,9 @@ static int patch_stac9200(struct hda_codec *codec) ...@@ -1710,7 +1661,9 @@ static int patch_stac9200(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
spec->num_pins = 8; spec->num_pins = 8;
spec->pin_nids = stac9200_pin_nids; spec->pin_nids = stac9200_pin_nids;
spec->board_config = snd_hda_check_board_config(codec, stac9200_cfg_tbl); spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
stac9200_models,
stac9200_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n"); snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9200, using BIOS defaults\n");
err = stac92xx_save_bios_config_regs(codec); err = stac92xx_save_bios_config_regs(codec);
...@@ -1758,7 +1711,9 @@ static int patch_stac922x(struct hda_codec *codec) ...@@ -1758,7 +1711,9 @@ static int patch_stac922x(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
spec->num_pins = 10; spec->num_pins = 10;
spec->pin_nids = stac922x_pin_nids; spec->pin_nids = stac922x_pin_nids;
spec->board_config = snd_hda_check_board_config(codec, stac922x_cfg_tbl); spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
stac922x_models,
stac922x_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
"using BIOS defaults\n"); "using BIOS defaults\n");
...@@ -1809,7 +1764,9 @@ static int patch_stac927x(struct hda_codec *codec) ...@@ -1809,7 +1764,9 @@ static int patch_stac927x(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
spec->num_pins = 14; spec->num_pins = 14;
spec->pin_nids = stac927x_pin_nids; spec->pin_nids = stac927x_pin_nids;
spec->board_config = snd_hda_check_board_config(codec, stac927x_cfg_tbl); spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS,
stac927x_models,
stac927x_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n");
err = stac92xx_save_bios_config_regs(codec); err = stac92xx_save_bios_config_regs(codec);
...@@ -1874,7 +1831,9 @@ static int patch_stac9205(struct hda_codec *codec) ...@@ -1874,7 +1831,9 @@ static int patch_stac9205(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
spec->num_pins = 14; spec->num_pins = 14;
spec->pin_nids = stac9205_pin_nids; spec->pin_nids = stac9205_pin_nids;
spec->board_config = snd_hda_check_board_config(codec, stac9205_cfg_tbl); spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS,
stac9205_models,
stac9205_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n");
err = stac92xx_save_bios_config_regs(codec); err = stac92xx_save_bios_config_regs(codec);
...@@ -2083,18 +2042,19 @@ enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */ ...@@ -2083,18 +2042,19 @@ enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */
/* Unknown. id=0x83847661 and subsys=0x104D1200. */ /* Unknown. id=0x83847661 and subsys=0x104D1200. */
STAC9872K_VAIO, STAC9872K_VAIO,
/* AR Series. id=0x83847664 and subsys=104D1300 */ /* AR Series. id=0x83847664 and subsys=104D1300 */
CXD9872AKD_VAIO CXD9872AKD_VAIO,
}; STAC_9872_MODELS,
};
static struct hda_board_config stac9872_cfg_tbl[] = {
{ .modelname = "vaio", .config = CXD9872RD_VAIO }, static const char *stac9872_models[STAC_9872_MODELS] = {
{ .modelname = "vaio-ar", .config = CXD9872AKD_VAIO }, [CXD9872RD_VAIO] = "vaio",
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81e6, [CXD9872AKD_VAIO] = "vaio-ar",
.config = CXD9872RD_VAIO }, };
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef,
.config = CXD9872RD_VAIO }, static struct snd_pci_quirk stac9872_cfg_tbl[] = {
{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81fd, SND_PCI_QUIRK(0x104d, 0x81e6, "Sony VAIO F/S", CXD9872RD_VAIO),
.config = CXD9872AKD_VAIO }, SND_PCI_QUIRK(0x104d, 0x81ef, "Sony VAIO F/S", CXD9872RD_VAIO),
SND_PCI_QUIRK(0x104d, 0x81fd, "Sony VAIO AR", CXD9872AKD_VAIO),
{} {}
}; };
...@@ -2103,7 +2063,9 @@ static int patch_stac9872(struct hda_codec *codec) ...@@ -2103,7 +2063,9 @@ static int patch_stac9872(struct hda_codec *codec)
struct sigmatel_spec *spec; struct sigmatel_spec *spec;
int board_config; int board_config;
board_config = snd_hda_check_board_config(codec, stac9872_cfg_tbl); board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
stac9872_models,
stac9872_cfg_tbl);
if (board_config < 0) if (board_config < 0)
/* unknown config, let generic-parser do its job... */ /* unknown config, let generic-parser do its job... */
return snd_hda_parse_generic_codec(codec); return snd_hda_parse_generic_codec(codec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment