diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-11-24 11:07:44 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:02:04 -0500 |
commit | f5fcc13c2fc62da6f75d80189a51c2492afb39c0 (patch) | |
tree | a08340173113cd5f64653b81b656f58ecb27a091 /sound/pci/hda/patch_conexant.c | |
parent | 0b830bac35dd6e3996bee675c3893857da8a4d0a (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_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 7e7d0c110c4c..dec8f9747fc6 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -802,22 +802,22 @@ static int cxt5045_init(struct hda_codec *codec) | |||
802 | 802 | ||
803 | 803 | ||
804 | enum { | 804 | enum { |
805 | CXT5045_LAPTOP, | 805 | CXT5045_LAPTOP, /* Laptops w/ EAPD support */ |
806 | #ifdef CONFIG_SND_DEBUG | 806 | #ifdef CONFIG_SND_DEBUG |
807 | CXT5045_TEST, | 807 | CXT5045_TEST, |
808 | #endif | 808 | #endif |
809 | CXT5045_MODELS | ||
809 | }; | 810 | }; |
810 | 811 | ||
811 | static struct hda_board_config cxt5045_cfg_tbl[] = { | 812 | static const char *cxt5045_models[CXT5045_MODELS] = { |
812 | /* Laptops w/ EAPD support */ | 813 | [CXT5045_LAPTOP] = "laptop", |
813 | { .modelname = "laptop", .config = CXT5045_LAPTOP }, | ||
814 | /* HP DV6000Z */ | ||
815 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b7, | ||
816 | .config = CXT5045_LAPTOP }, | ||
817 | #ifdef CONFIG_SND_DEBUG | 814 | #ifdef CONFIG_SND_DEBUG |
818 | { .modelname = "test", .config = CXT5045_TEST }, | 815 | [CXT5045_TEST] = "test", |
819 | #endif | 816 | #endif |
820 | 817 | }; | |
818 | |||
819 | static struct snd_pci_quirk cxt5045_cfg_tbl[] = { | ||
820 | SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP), | ||
821 | {} | 821 | {} |
822 | }; | 822 | }; |
823 | 823 | ||
@@ -852,7 +852,9 @@ static int patch_cxt5045(struct hda_codec *codec) | |||
852 | codec->patch_ops = conexant_patch_ops; | 852 | codec->patch_ops = conexant_patch_ops; |
853 | codec->patch_ops.unsol_event = cxt5045_hp_unsol_event; | 853 | codec->patch_ops.unsol_event = cxt5045_hp_unsol_event; |
854 | 854 | ||
855 | board_config = snd_hda_check_board_config(codec, cxt5045_cfg_tbl); | 855 | board_config = snd_hda_check_board_config(codec, CXT5045_MODELS, |
856 | cxt5045_models, | ||
857 | cxt5045_cfg_tbl); | ||
856 | switch (board_config) { | 858 | switch (board_config) { |
857 | case CXT5045_LAPTOP: | 859 | case CXT5045_LAPTOP: |
858 | spec->input_mux = &cxt5045_capture_source; | 860 | spec->input_mux = &cxt5045_capture_source; |
@@ -1214,36 +1216,29 @@ static int cxt5047_hp_init(struct hda_codec *codec) | |||
1214 | 1216 | ||
1215 | 1217 | ||
1216 | enum { | 1218 | enum { |
1217 | CXT5047_LAPTOP, | 1219 | CXT5047_LAPTOP, /* Laptops w/o EAPD support */ |
1220 | CXT5047_LAPTOP_HP, /* Some HP laptops */ | ||
1221 | CXT5047_LAPTOP_EAPD, /* Laptops with EAPD support */ | ||
1218 | #ifdef CONFIG_SND_DEBUG | 1222 | #ifdef CONFIG_SND_DEBUG |
1219 | CXT5047_TEST, | 1223 | CXT5047_TEST, |
1220 | #endif | 1224 | #endif |
1221 | CXT5047_LAPTOP_HP, | 1225 | CXT5047_MODELS |
1222 | CXT5047_LAPTOP_EAPD | ||
1223 | }; | 1226 | }; |
1224 | 1227 | ||
1225 | static struct hda_board_config cxt5047_cfg_tbl[] = { | 1228 | static const char *cxt5047_models[CXT5047_MODELS] = { |
1226 | /* Laptops w/o EAPD support */ | 1229 | [CXT5047_LAPTOP] = "laptop", |
1227 | { .modelname = "laptop", .config = CXT5047_LAPTOP }, | 1230 | [CXT5047_LAPTOP_HP] = "laptop-hp", |
1228 | /*HP DV1000 */ | 1231 | [CXT5047_LAPTOP_EAPD] = "laptop-eapd", |
1229 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a0, | ||
1230 | .config = CXT5047_LAPTOP }, | ||
1231 | /*HP DV2000T/DV3000T */ | ||
1232 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b2, | ||
1233 | .config = CXT5047_LAPTOP }, | ||
1234 | /* Not all HP's are created equal */ | ||
1235 | { .modelname = "laptop-hp", .config = CXT5047_LAPTOP_HP }, | ||
1236 | /*HP DV5200TX/DV8000T / Compaq V5209US/V5204NR */ | ||
1237 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a5, | ||
1238 | .config = CXT5047_LAPTOP_HP }, | ||
1239 | /* Laptops with EAPD support */ | ||
1240 | { .modelname = "laptop-eapd", .config = CXT5047_LAPTOP_EAPD }, | ||
1241 | { .pci_subvendor = 0x1179, .pci_subdevice = 0xff31, | ||
1242 | .config = CXT5047_LAPTOP_EAPD }, /* Toshiba P100 */ | ||
1243 | #ifdef CONFIG_SND_DEBUG | 1232 | #ifdef CONFIG_SND_DEBUG |
1244 | { .modelname = "test", .config = CXT5047_TEST }, | 1233 | [CXT5047_TEST] = "test", |
1245 | #endif | 1234 | #endif |
1246 | 1235 | }; | |
1236 | |||
1237 | static struct snd_pci_quirk cxt5047_cfg_tbl[] = { | ||
1238 | SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP), | ||
1239 | SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP), | ||
1240 | SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP), | ||
1241 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD), | ||
1247 | {} | 1242 | {} |
1248 | }; | 1243 | }; |
1249 | 1244 | ||
@@ -1277,7 +1272,9 @@ static int patch_cxt5047(struct hda_codec *codec) | |||
1277 | codec->patch_ops = conexant_patch_ops; | 1272 | codec->patch_ops = conexant_patch_ops; |
1278 | codec->patch_ops.unsol_event = cxt5047_hp_unsol_event; | 1273 | codec->patch_ops.unsol_event = cxt5047_hp_unsol_event; |
1279 | 1274 | ||
1280 | board_config = snd_hda_check_board_config(codec, cxt5047_cfg_tbl); | 1275 | board_config = snd_hda_check_board_config(codec, CXT5047_MODELS, |
1276 | cxt5047_models, | ||
1277 | cxt5047_cfg_tbl); | ||
1281 | switch (board_config) { | 1278 | switch (board_config) { |
1282 | case CXT5047_LAPTOP: | 1279 | case CXT5047_LAPTOP: |
1283 | break; | 1280 | break; |