aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ali5451/ali5451.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ali5451/ali5451.c')
-rw-r--r--sound/pci/ali5451/ali5451.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 01d971c89e43..1f747c3034fe 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -45,23 +45,25 @@ MODULE_DESCRIPTION("ALI M5451");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}"); 46MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}");
47 47
48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 48static int index = SNDRV_DEFAULT_IDX1; /* Index */
49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 49static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 50static int pcm_channels = 32;
51static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; 51static int spdif = 0;
52static int spdif[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
53 52
54module_param_array(index, int, NULL, 0444); 53module_param(index, int, 0444);
55MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); 54MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio.");
56module_param_array(id, charp, NULL, 0444); 55module_param(id, charp, 0444);
57MODULE_PARM_DESC(id, "ID string for ALI M5451 PCI Audio."); 56MODULE_PARM_DESC(id, "ID string for ALI M5451 PCI Audio.");
58module_param_array(enable, bool, NULL, 0444); 57module_param(pcm_channels, int, 0444);
59MODULE_PARM_DESC(enable, "Enable ALI 5451 PCI Audio.");
60module_param_array(pcm_channels, int, NULL, 0444);
61MODULE_PARM_DESC(pcm_channels, "PCM Channels"); 58MODULE_PARM_DESC(pcm_channels, "PCM Channels");
62module_param_array(spdif, bool, NULL, 0444); 59module_param(spdif, bool, 0444);
63MODULE_PARM_DESC(spdif, "Support SPDIF I/O"); 60MODULE_PARM_DESC(spdif, "Support SPDIF I/O");
64 61
62/* just for backward compatibility */
63static int enable;
64module_param(enable, bool, 0444);
65
66
65/* 67/*
66 * Debug part definitions 68 * Debug part definitions
67 */ 69 */
@@ -2353,25 +2355,17 @@ static int __devinit snd_ali_create(snd_card_t * card,
2353static int __devinit snd_ali_probe(struct pci_dev *pci, 2355static int __devinit snd_ali_probe(struct pci_dev *pci,
2354 const struct pci_device_id *pci_id) 2356 const struct pci_device_id *pci_id)
2355{ 2357{
2356 static int dev;
2357 snd_card_t *card; 2358 snd_card_t *card;
2358 ali_t *codec; 2359 ali_t *codec;
2359 int err; 2360 int err;
2360 2361
2361 snd_ali_printk("probe ...\n"); 2362 snd_ali_printk("probe ...\n");
2362 2363
2363 if (dev >= SNDRV_CARDS) 2364 card = snd_card_new(index, id, THIS_MODULE, 0);
2364 return -ENODEV;
2365 if (!enable[dev]) {
2366 dev++;
2367 return -ENOENT;
2368 }
2369
2370 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
2371 if (card == NULL) 2365 if (card == NULL)
2372 return -ENOMEM; 2366 return -ENOMEM;
2373 2367
2374 if ((err = snd_ali_create(card, pci, pcm_channels[dev], spdif[dev], &codec)) < 0) { 2368 if ((err = snd_ali_create(card, pci, pcm_channels, spdif, &codec)) < 0) {
2375 snd_card_free(card); 2369 snd_card_free(card);
2376 return err; 2370 return err;
2377 } 2371 }
@@ -2402,7 +2396,6 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
2402 return err; 2396 return err;
2403 } 2397 }
2404 pci_set_drvdata(pci, card); 2398 pci_set_drvdata(pci, card);
2405 dev++;
2406 return 0; 2399 return 0;
2407} 2400}
2408 2401