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;
......
This diff is collapsed.
This diff is collapsed.
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