aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cmedia.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-11-24 11:07:44 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:02:04 -0500
commitf5fcc13c2fc62da6f75d80189a51c2492afb39c0 (patch)
treea08340173113cd5f64653b81b656f58ecb27a091 /sound/pci/hda/patch_cmedia.c
parent0b830bac35dd6e3996bee675c3893857da8a4d0a (diff)
[ALSA] hda-codec - Use snd_pci_quirk_lookup() for board config lookup
Use snd_pci_quirk_lookup() for looking up a board config table. The config table is sorted in numerical order of PCI SSIDs. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_cmedia.c')
-rw-r--r--sound/pci/hda/patch_cmedia.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index d38ce22507ae..5b9d3a31a1ae 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -40,6 +40,7 @@ enum {
40 CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */ 40 CMI_FULL_DIG, /* back 6-jack + front-panel 2-jack + digital I/O */
41 CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */ 41 CMI_ALLOUT, /* back 5-jack + front-panel 2-jack + digital out */
42 CMI_AUTO, /* let driver guess it */ 42 CMI_AUTO, /* let driver guess it */
43 CMI_MODELS
43}; 44};
44 45
45struct cmi_spec { 46struct cmi_spec {
@@ -603,14 +604,17 @@ static void cmi9880_free(struct hda_codec *codec)
603/* 604/*
604 */ 605 */
605 606
606static struct hda_board_config cmi9880_cfg_tbl[] = { 607static const char *cmi9880_models[CMI_MODELS] = {
607 { .modelname = "minimal", .config = CMI_MINIMAL }, 608 [CMI_MINIMAL] = "minimal",
608 { .modelname = "min_fp", .config = CMI_MIN_FP }, 609 [CMI_MIN_FP] = "min_fp",
609 { .modelname = "full", .config = CMI_FULL }, 610 [CMI_FULL] = "full",
610 { .modelname = "full_dig", .config = CMI_FULL_DIG }, 611 [CMI_FULL_DIG] = "full_dig",
611 { .pci_subvendor = 0x1043, .pci_subdevice = 0x813d, .config = CMI_FULL_DIG }, /* ASUS P5AD2 */ 612 [CMI_ALLOUT] = "allout",
612 { .modelname = "allout", .config = CMI_ALLOUT }, 613 [CMI_AUTO] = "auto",
613 { .modelname = "auto", .config = CMI_AUTO }, 614};
615
616static struct snd_pci_quirk cmi9880_cfg_tbl[] = {
617 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG),
614 {} /* terminator */ 618 {} /* terminator */
615}; 619};
616 620
@@ -633,7 +637,9 @@ static int patch_cmi9880(struct hda_codec *codec)
633 return -ENOMEM; 637 return -ENOMEM;
634 638
635 codec->spec = spec; 639 codec->spec = spec;
636 spec->board_config = snd_hda_check_board_config(codec, cmi9880_cfg_tbl); 640 spec->board_config = snd_hda_check_board_config(codec, CMI_MODELS,
641 cmi9880_models,
642 cmi9880_cfg_tbl);
637 if (spec->board_config < 0) { 643 if (spec->board_config < 0) {
638 snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n"); 644 snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n");
639 spec->board_config = CMI_AUTO; /* try everything */ 645 spec->board_config = CMI_AUTO; /* try everything */