aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt14
-rw-r--r--sound/pci/atiixp.c42
-rw-r--r--sound/pci/atiixp_modem.c28
-rw-r--r--sound/pci/hda/hda_intel.c34
-rw-r--r--sound/pci/intel8x0.c58
-rw-r--r--sound/pci/intel8x0m.c28
-rw-r--r--sound/pci/via82xx.c103
-rw-r--r--sound/pci/via82xx_modem.c29
8 files changed, 126 insertions, 210 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 09340cb4e18d..46a125003b0a 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -206,7 +206,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
206 See "AC97 Quirk Option" section below. 206 See "AC97 Quirk Option" section below.
207 spdif_aclink - S/PDIF transfer over AC-link (default = 1) 207 spdif_aclink - S/PDIF transfer over AC-link (default = 1)
208 208
209 This module supports up to 8 cards and autoprobe. 209 This module supports one card and autoprobe.
210 210
211 ATI IXP has two different methods to control SPDIF output. One is 211 ATI IXP has two different methods to control SPDIF output. One is
212 over AC-link and another is over the "direct" SPDIF output. The 212 over AC-link and another is over the "direct" SPDIF output. The
@@ -218,7 +218,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
218 218
219 Module for ATI IXP 150/200/250 AC97 modem controllers. 219 Module for ATI IXP 150/200/250 AC97 modem controllers.
220 220
221 Module supports up to 8 cards. 221 This module supports one card and autoprobe.
222 222
223 Note: The default index value of this module is -2, i.e. the first 223 Note: The default index value of this module is -2, i.e. the first
224 slot is excluded. 224 slot is excluded.
@@ -637,7 +637,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
637 model - force the model name 637 model - force the model name
638 position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size) 638 position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)
639 639
640 Module supports up to 8 cards. 640 This module supports one card and autoprobe.
641 641
642 Each codec may have a model table for different configurations. 642 Each codec may have a model table for different configurations.
643 If your machine isn't listed there, the default (usually minimal) 643 If your machine isn't listed there, the default (usually minimal)
@@ -815,7 +815,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
815 semaphores (e.g. on some ASUS laptops) 815 semaphores (e.g. on some ASUS laptops)
816 (default off) 816 (default off)
817 817
818 Module supports autoprobe and multiple bus-master chips (max 8). 818 This module supports one chip and autoprobe.
819 819
820 Note: the latest driver supports auto-detection of chip clock. 820 Note: the latest driver supports auto-detection of chip clock.
821 if you still encounter too fast playback, specify the clock 821 if you still encounter too fast playback, specify the clock
@@ -834,7 +834,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
834 834
835 ac97_clock - AC'97 codec clock base (0 = auto-detect) 835 ac97_clock - AC'97 codec clock base (0 = auto-detect)
836 836
837 This module supports up to 8 cards and autoprobe. 837 This module supports one card and autoprobe.
838 838
839 Note: The default index value of this module is -2, i.e. the first 839 Note: The default index value of this module is -2, i.e. the first
840 slot is excluded. 840 slot is excluded.
@@ -1314,7 +1314,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1314 ac97_quirk - AC'97 workaround for strange hardware 1314 ac97_quirk - AC'97 workaround for strange hardware
1315 See "AC97 Quirk Option" section below. 1315 See "AC97 Quirk Option" section below.
1316 1316
1317 Module supports autoprobe and multiple bus-master chips (max 8). 1317 This module supports one chip and autoprobe.
1318 1318
1319 Note: on some SMP motherboards like MSI 694D the interrupts might 1319 Note: on some SMP motherboards like MSI 694D the interrupts might
1320 not be generated properly. In such a case, please try to 1320 not be generated properly. In such a case, please try to
@@ -1356,7 +1356,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1356 1356
1357 ac97_clock - AC'97 codec clock base (default 48000Hz) 1357 ac97_clock - AC'97 codec clock base (default 48000Hz)
1358 1358
1359 Module supports up to 8 cards. 1359 This module supports one card and autoprobe.
1360 1360
1361 Note: The default index value of this module is -2, i.e. the first 1361 Note: The default index value of this module is -2, i.e. the first
1362 slot is excluded. 1362 slot is excluded.
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index cb1741102bbc..332a71de9673 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -39,24 +39,21 @@ MODULE_DESCRIPTION("ATI IXP AC97 controller");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400}}"); 40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400}}");
41 41
42static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 42static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 43static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
44static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 44static int ac97_clock = 48000;
45static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000}; 45static char *ac97_quirk;
46static char *ac97_quirk[SNDRV_CARDS]; 46static int spdif_aclink = 1;
47static int spdif_aclink[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 47
48 48module_param(index, int, 0444);
49module_param_array(index, int, NULL, 0444);
50MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); 49MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
51module_param_array(id, charp, NULL, 0444); 50module_param(id, charp, 0444);
52MODULE_PARM_DESC(id, "ID string for ATI IXP controller."); 51MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
53module_param_array(enable, bool, NULL, 0444); 52module_param(ac97_clock, int, 0444);
54MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
55module_param_array(ac97_clock, int, NULL, 0444);
56MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 53MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
57module_param_array(ac97_quirk, charp, NULL, 0444); 54module_param(ac97_quirk, charp, 0444);
58MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 55MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
59module_param_array(spdif_aclink, bool, NULL, 0444); 56module_param(spdif_aclink, bool, 0444);
60MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); 57MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");
61 58
62 59
@@ -1578,26 +1575,18 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
1578static int __devinit snd_atiixp_probe(struct pci_dev *pci, 1575static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1579 const struct pci_device_id *pci_id) 1576 const struct pci_device_id *pci_id)
1580{ 1577{
1581 static int dev;
1582 snd_card_t *card; 1578 snd_card_t *card;
1583 atiixp_t *chip; 1579 atiixp_t *chip;
1584 unsigned char revision; 1580 unsigned char revision;
1585 int err; 1581 int err;
1586 1582
1587 if (dev >= SNDRV_CARDS) 1583 card = snd_card_new(index, id, THIS_MODULE, 0);
1588 return -ENODEV;
1589 if (!enable[dev]) {
1590 dev++;
1591 return -ENOENT;
1592 }
1593
1594 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1595 if (card == NULL) 1584 if (card == NULL)
1596 return -ENOMEM; 1585 return -ENOMEM;
1597 1586
1598 pci_read_config_byte(pci, PCI_REVISION_ID, &revision); 1587 pci_read_config_byte(pci, PCI_REVISION_ID, &revision);
1599 1588
1600 strcpy(card->driver, spdif_aclink[dev] ? "ATIIXP" : "ATIIXP-SPDMA"); 1589 strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
1601 strcpy(card->shortname, "ATI IXP"); 1590 strcpy(card->shortname, "ATI IXP");
1602 if ((err = snd_atiixp_create(card, pci, &chip)) < 0) 1591 if ((err = snd_atiixp_create(card, pci, &chip)) < 0)
1603 goto __error; 1592 goto __error;
@@ -1605,9 +1594,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1605 if ((err = snd_atiixp_aclink_reset(chip)) < 0) 1594 if ((err = snd_atiixp_aclink_reset(chip)) < 0)
1606 goto __error; 1595 goto __error;
1607 1596
1608 chip->spdif_over_aclink = spdif_aclink[dev]; 1597 chip->spdif_over_aclink = spdif_aclink;
1609 1598
1610 if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev], ac97_quirk[dev])) < 0) 1599 if ((err = snd_atiixp_mixer_new(chip, ac97_clock, ac97_quirk)) < 0)
1611 goto __error; 1600 goto __error;
1612 1601
1613 if ((err = snd_atiixp_pcm_new(chip)) < 0) 1602 if ((err = snd_atiixp_pcm_new(chip)) < 0)
@@ -1628,7 +1617,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1628 goto __error; 1617 goto __error;
1629 1618
1630 pci_set_drvdata(pci, card); 1619 pci_set_drvdata(pci, card);
1631 dev++;
1632 return 0; 1620 return 0;
1633 1621
1634 __error: 1622 __error:
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index a88a6f372050..a4778d373cdf 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -39,18 +39,15 @@ MODULE_DESCRIPTION("ATI IXP MC97 controller");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}"); 40MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}");
41 41
42static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ 42static int index = -2; /* Exclude the first card */
43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 43static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
44static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 44static int ac97_clock = 48000;
45static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
46 45
47module_param_array(index, int, NULL, 0444); 46module_param(index, int, 0444);
48MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); 47MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
49module_param_array(id, charp, NULL, 0444); 48module_param(id, charp, 0444);
50MODULE_PARM_DESC(id, "ID string for ATI IXP controller."); 49MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
51module_param_array(enable, bool, NULL, 0444); 50module_param(ac97_clock, int, 0444);
52MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
53module_param_array(ac97_clock, int, NULL, 0444);
54MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 51MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
55 52
56 53
@@ -1256,20 +1253,12 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
1256static int __devinit snd_atiixp_probe(struct pci_dev *pci, 1253static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1257 const struct pci_device_id *pci_id) 1254 const struct pci_device_id *pci_id)
1258{ 1255{
1259 static int dev;
1260 snd_card_t *card; 1256 snd_card_t *card;
1261 atiixp_t *chip; 1257 atiixp_t *chip;
1262 unsigned char revision; 1258 unsigned char revision;
1263 int err; 1259 int err;
1264 1260
1265 if (dev >= SNDRV_CARDS) 1261 card = snd_card_new(index, id, THIS_MODULE, 0);
1266 return -ENODEV;
1267 if (!enable[dev]) {
1268 dev++;
1269 return -ENOENT;
1270 }
1271
1272 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1273 if (card == NULL) 1262 if (card == NULL)
1274 return -ENOMEM; 1263 return -ENOMEM;
1275 1264
@@ -1283,7 +1272,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1283 if ((err = snd_atiixp_aclink_reset(chip)) < 0) 1272 if ((err = snd_atiixp_aclink_reset(chip)) < 0)
1284 goto __error; 1273 goto __error;
1285 1274
1286 if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev])) < 0) 1275 if ((err = snd_atiixp_mixer_new(chip, ac97_clock)) < 0)
1287 goto __error; 1276 goto __error;
1288 1277
1289 if ((err = snd_atiixp_pcm_new(chip)) < 0) 1278 if ((err = snd_atiixp_pcm_new(chip)) < 0)
@@ -1302,7 +1291,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
1302 goto __error; 1291 goto __error;
1303 1292
1304 pci_set_drvdata(pci, card); 1293 pci_set_drvdata(pci, card);
1305 dev++;
1306 return 0; 1294 return 0;
1307 1295
1308 __error: 1296 __error:
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index faf9dd00ba6c..d9e88dfe8171 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -47,21 +47,18 @@
47#include "hda_codec.h" 47#include "hda_codec.h"
48 48
49 49
50static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 50static int index = SNDRV_DEFAULT_IDX1;
51static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 51static char *id = SNDRV_DEFAULT_STR1;
52static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 52static char *model;
53static char *model[SNDRV_CARDS]; 53static int position_fix;
54static int position_fix[SNDRV_CARDS];
55 54
56module_param_array(index, int, NULL, 0444); 55module_param(index, int, 0444);
57MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); 56MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
58module_param_array(id, charp, NULL, 0444); 57module_param(id, charp, 0444);
59MODULE_PARM_DESC(id, "ID string for Intel HD audio interface."); 58MODULE_PARM_DESC(id, "ID string for Intel HD audio interface.");
60module_param_array(enable, bool, NULL, 0444); 59module_param(model, charp, 0444);
61MODULE_PARM_DESC(enable, "Enable Intel HD audio interface.");
62module_param_array(model, charp, NULL, 0444);
63MODULE_PARM_DESC(model, "Use the given board model."); 60MODULE_PARM_DESC(model, "Use the given board model.");
64module_param_array(position_fix, int, NULL, 0444); 61module_param(position_fix, int, 0444);
65MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)."); 62MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size).");
66 63
67MODULE_LICENSE("GPL"); 64MODULE_LICENSE("GPL");
@@ -1544,32 +1541,24 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci,
1544 1541
1545static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 1542static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
1546{ 1543{
1547 static int dev;
1548 snd_card_t *card; 1544 snd_card_t *card;
1549 azx_t *chip; 1545 azx_t *chip;
1550 int err = 0; 1546 int err = 0;
1551 1547
1552 if (dev >= SNDRV_CARDS) 1548 card = snd_card_new(index, id, THIS_MODULE, 0);
1553 return -ENODEV;
1554 if (! enable[dev]) {
1555 dev++;
1556 return -ENOENT;
1557 }
1558
1559 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1560 if (NULL == card) { 1549 if (NULL == card) {
1561 snd_printk(KERN_ERR SFX "Error creating card!\n"); 1550 snd_printk(KERN_ERR SFX "Error creating card!\n");
1562 return -ENOMEM; 1551 return -ENOMEM;
1563 } 1552 }
1564 1553
1565 if ((err = azx_create(card, pci, position_fix[dev], pci_id->driver_data, 1554 if ((err = azx_create(card, pci, position_fix, pci_id->driver_data,
1566 &chip)) < 0) { 1555 &chip)) < 0) {
1567 snd_card_free(card); 1556 snd_card_free(card);
1568 return err; 1557 return err;
1569 } 1558 }
1570 1559
1571 /* create codec instances */ 1560 /* create codec instances */
1572 if ((err = azx_codec_create(chip, model[dev])) < 0) { 1561 if ((err = azx_codec_create(chip, model)) < 0) {
1573 snd_card_free(card); 1562 snd_card_free(card);
1574 return err; 1563 return err;
1575 } 1564 }
@@ -1595,7 +1584,6 @@ static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id *
1595 } 1584 }
1596 1585
1597 pci_set_drvdata(pci, card); 1586 pci_set_drvdata(pci, card);
1598 dev++;
1599 1587
1600 return err; 1588 return err;
1601} 1589}
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 0d11cf7d569a..bd9563c8b11e 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -64,34 +64,27 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
64 "{AMD,AMD8111}," 64 "{AMD,AMD8111},"
65 "{ALI,M5455}}"); 65 "{ALI,M5455}}");
66 66
67static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 67static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
68static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 68static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
69static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 69static int ac97_clock = 0;
70static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 70static char *ac97_quirk;
71static char *ac97_quirk[SNDRV_CARDS]; 71static int buggy_semaphore;
72static int buggy_semaphore[SNDRV_CARDS]; 72static int buggy_irq;
73static int buggy_irq[SNDRV_CARDS]; 73static int xbox;
74static int xbox[SNDRV_CARDS]; 74
75 75module_param(index, int, 0444);
76#ifdef SUPPORT_MIDI
77static int mpu_port[SNDRV_CARDS]; /* disabled */
78#endif
79
80module_param_array(index, int, NULL, 0444);
81MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard."); 76MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard.");
82module_param_array(id, charp, NULL, 0444); 77module_param(id, charp, 0444);
83MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard."); 78MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard.");
84module_param_array(enable, bool, NULL, 0444); 79module_param(ac97_clock, int, 0444);
85MODULE_PARM_DESC(enable, "Enable Intel i8x0 soundcard.");
86module_param_array(ac97_clock, int, NULL, 0444);
87MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); 80MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
88module_param_array(ac97_quirk, charp, NULL, 0444); 81module_param(ac97_quirk, charp, 0444);
89MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 82MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
90module_param_array(buggy_semaphore, bool, NULL, 0444); 83module_param(buggy_semaphore, bool, 0444);
91MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores."); 84MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores.");
92module_param_array(buggy_irq, bool, NULL, 0444); 85module_param(buggy_irq, bool, 0444);
93MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); 86MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards.");
94module_param_array(xbox, bool, NULL, 0444); 87module_param(xbox, bool, 0444);
95MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection."); 88MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection.");
96 89
97/* 90/*
@@ -2781,20 +2774,12 @@ static struct shortname_table {
2781static int __devinit snd_intel8x0_probe(struct pci_dev *pci, 2774static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2782 const struct pci_device_id *pci_id) 2775 const struct pci_device_id *pci_id)
2783{ 2776{
2784 static int dev;
2785 snd_card_t *card; 2777 snd_card_t *card;
2786 intel8x0_t *chip; 2778 intel8x0_t *chip;
2787 int err; 2779 int err;
2788 struct shortname_table *name; 2780 struct shortname_table *name;
2789 2781
2790 if (dev >= SNDRV_CARDS) 2782 card = snd_card_new(index, id, THIS_MODULE, 0);
2791 return -ENODEV;
2792 if (!enable[dev]) {
2793 dev++;
2794 return -ENOENT;
2795 }
2796
2797 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
2798 if (card == NULL) 2783 if (card == NULL)
2799 return -ENOMEM; 2784 return -ENOMEM;
2800 2785
@@ -2819,16 +2804,16 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2819 } 2804 }
2820 2805
2821 if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data, 2806 if ((err = snd_intel8x0_create(card, pci, pci_id->driver_data,
2822 buggy_semaphore[dev], &chip)) < 0) { 2807 buggy_semaphore, &chip)) < 0) {
2823 snd_card_free(card); 2808 snd_card_free(card);
2824 return err; 2809 return err;
2825 } 2810 }
2826 if (buggy_irq[dev]) 2811 if (buggy_irq)
2827 chip->buggy_irq = 1; 2812 chip->buggy_irq = 1;
2828 if (xbox[dev]) 2813 if (xbox)
2829 chip->xbox = 1; 2814 chip->xbox = 1;
2830 2815
2831 if ((err = snd_intel8x0_mixer(chip, ac97_clock[dev], ac97_quirk[dev])) < 0) { 2816 if ((err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk)) < 0) {
2832 snd_card_free(card); 2817 snd_card_free(card);
2833 return err; 2818 return err;
2834 } 2819 }
@@ -2843,7 +2828,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2843 "%s with %s at %#lx, irq %i", card->shortname, 2828 "%s with %s at %#lx, irq %i", card->shortname,
2844 snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq); 2829 snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq);
2845 2830
2846 if (! ac97_clock[dev]) 2831 if (! ac97_clock)
2847 intel8x0_measure_ac97_clock(chip); 2832 intel8x0_measure_ac97_clock(chip);
2848 2833
2849 if ((err = snd_card_register(card)) < 0) { 2834 if ((err = snd_card_register(card)) < 0) {
@@ -2851,7 +2836,6 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
2851 return err; 2836 return err;
2852 } 2837 }
2853 pci_set_drvdata(pci, card); 2838 pci_set_drvdata(pci, card);
2854 dev++;
2855 return 0; 2839 return 0;
2856} 2840}
2857 2841
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 15364d27804d..be604bb8445d 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -56,18 +56,15 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
56 "{NVidia,NForce3 Modem}," 56 "{NVidia,NForce3 Modem},"
57 "{AMD,AMD768}}"); 57 "{AMD,AMD768}}");
58 58
59static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ 59static int index = -2; /* Exclude the first card */
60static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 60static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
61static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 61static int ac97_clock = 0;
62static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
63 62
64module_param_array(index, int, NULL, 0444); 63module_param(index, int, 0444);
65MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard."); 64MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard.");
66module_param_array(id, charp, NULL, 0444); 65module_param(id, charp, 0444);
67MODULE_PARM_DESC(id, "ID string for Intel i8x0 modemcard."); 66MODULE_PARM_DESC(id, "ID string for Intel i8x0 modemcard.");
68module_param_array(enable, bool, NULL, 0444); 67module_param(ac97_clock, int, 0444);
69MODULE_PARM_DESC(enable, "Enable Intel i8x0 modemcard.");
70module_param_array(ac97_clock, int, NULL, 0444);
71MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); 68MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
72 69
73/* 70/*
@@ -1263,20 +1260,12 @@ static struct shortname_table {
1263static int __devinit snd_intel8x0m_probe(struct pci_dev *pci, 1260static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
1264 const struct pci_device_id *pci_id) 1261 const struct pci_device_id *pci_id)
1265{ 1262{
1266 static int dev;
1267 snd_card_t *card; 1263 snd_card_t *card;
1268 intel8x0_t *chip; 1264 intel8x0_t *chip;
1269 int err; 1265 int err;
1270 struct shortname_table *name; 1266 struct shortname_table *name;
1271 1267
1272 if (dev >= SNDRV_CARDS) 1268 card = snd_card_new(index, id, THIS_MODULE, 0);
1273 return -ENODEV;
1274 if (!enable[dev]) {
1275 dev++;
1276 return -ENOENT;
1277 }
1278
1279 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1280 if (card == NULL) 1269 if (card == NULL)
1281 return -ENOMEM; 1270 return -ENOMEM;
1282 1271
@@ -1295,7 +1284,7 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
1295 return err; 1284 return err;
1296 } 1285 }
1297 1286
1298 if ((err = snd_intel8x0_mixer(chip, ac97_clock[dev])) < 0) { 1287 if ((err = snd_intel8x0_mixer(chip, ac97_clock)) < 0) {
1299 snd_card_free(card); 1288 snd_card_free(card);
1300 return err; 1289 return err;
1301 } 1290 }
@@ -1314,7 +1303,6 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
1314 return err; 1303 return err;
1315 } 1304 }
1316 pci_set_drvdata(pci, card); 1305 pci_set_drvdata(pci, card);
1317 dev++;
1318 return 0; 1306 return 0;
1319} 1307}
1320 1308
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index ecc4836ba8de..4545208ee460 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -73,34 +73,31 @@ MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
73#define SUPPORT_JOYSTICK 1 73#define SUPPORT_JOYSTICK 1
74#endif 74#endif
75 75
76static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 76static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
77static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 77static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
78static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 78static long mpu_port;
79static long mpu_port[SNDRV_CARDS];
80#ifdef SUPPORT_JOYSTICK 79#ifdef SUPPORT_JOYSTICK
81static int joystick[SNDRV_CARDS]; 80static int joystick;
82#endif 81#endif
83static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000}; 82static int ac97_clock = 48000;
84static char *ac97_quirk[SNDRV_CARDS]; 83static char *ac97_quirk;
85static int dxs_support[SNDRV_CARDS]; 84static int dxs_support;
86 85
87module_param_array(index, int, NULL, 0444); 86module_param(index, int, 0444);
88MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); 87MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge.");
89module_param_array(id, charp, NULL, 0444); 88module_param(id, charp, 0444);
90MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge."); 89MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge.");
91module_param_array(enable, bool, NULL, 0444); 90module_param(mpu_port, long, 0444);
92MODULE_PARM_DESC(enable, "Enable audio part of VIA 82xx bridge.");
93module_param_array(mpu_port, long, NULL, 0444);
94MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)"); 91MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
95#ifdef SUPPORT_JOYSTICK 92#ifdef SUPPORT_JOYSTICK
96module_param_array(joystick, bool, NULL, 0444); 93module_param(joystick, bool, 0444);
97MODULE_PARM_DESC(joystick, "Enable joystick. (VT82C686x only)"); 94MODULE_PARM_DESC(joystick, "Enable joystick. (VT82C686x only)");
98#endif 95#endif
99module_param_array(ac97_clock, int, NULL, 0444); 96module_param(ac97_clock, int, 0444);
100MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 97MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
101module_param_array(ac97_quirk, charp, NULL, 0444); 98module_param(ac97_quirk, charp, 0444);
102MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 99MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
103module_param_array(dxs_support, int, NULL, 0444); 100module_param(dxs_support, int, 0444);
104MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); 101MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)");
105 102
106 103
@@ -1637,12 +1634,12 @@ static int __devinit snd_via82xx_mixer_new(via82xx_t *chip, const char *quirk_ov
1637 1634
1638#ifdef SUPPORT_JOYSTICK 1635#ifdef SUPPORT_JOYSTICK
1639#define JOYSTICK_ADDR 0x200 1636#define JOYSTICK_ADDR 0x200
1640static int __devinit snd_via686_create_gameport(via82xx_t *chip, int dev, unsigned char *legacy) 1637static int __devinit snd_via686_create_gameport(via82xx_t *chip, unsigned char *legacy)
1641{ 1638{
1642 struct gameport *gp; 1639 struct gameport *gp;
1643 struct resource *r; 1640 struct resource *r;
1644 1641
1645 if (!joystick[dev]) 1642 if (!joystick)
1646 return -ENODEV; 1643 return -ENODEV;
1647 1644
1648 r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport"); 1645 r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport");
@@ -1686,7 +1683,7 @@ static void snd_via686_free_gameport(via82xx_t *chip)
1686 } 1683 }
1687} 1684}
1688#else 1685#else
1689static inline int snd_via686_create_gameport(via82xx_t *chip, int dev, unsigned char *legacy) 1686static inline int snd_via686_create_gameport(via82xx_t *chip, unsigned char *legacy)
1690{ 1687{
1691 return -ENOSYS; 1688 return -ENOSYS;
1692} 1689}
@@ -1698,7 +1695,7 @@ static inline void snd_via686_free_gameport(via82xx_t *chip) { }
1698 * 1695 *
1699 */ 1696 */
1700 1697
1701static int __devinit snd_via8233_init_misc(via82xx_t *chip, int dev) 1698static int __devinit snd_via8233_init_misc(via82xx_t *chip)
1702{ 1699{
1703 int i, err, caps; 1700 int i, err, caps;
1704 unsigned char val; 1701 unsigned char val;
@@ -1739,7 +1736,7 @@ static int __devinit snd_via8233_init_misc(via82xx_t *chip, int dev)
1739 return 0; 1736 return 0;
1740} 1737}
1741 1738
1742static int __devinit snd_via686_init_misc(via82xx_t *chip, int dev) 1739static int __devinit snd_via686_init_misc(via82xx_t *chip)
1743{ 1740{
1744 unsigned char legacy, legacy_cfg; 1741 unsigned char legacy, legacy_cfg;
1745 int rev_h = 0; 1742 int rev_h = 0;
@@ -1750,32 +1747,33 @@ static int __devinit snd_via686_init_misc(via82xx_t *chip, int dev)
1750 legacy &= ~VIA_FUNC_ENABLE_GAME; /* disable joystick */ 1747 legacy &= ~VIA_FUNC_ENABLE_GAME; /* disable joystick */
1751 if (chip->revision >= VIA_REV_686_H) { 1748 if (chip->revision >= VIA_REV_686_H) {
1752 rev_h = 1; 1749 rev_h = 1;
1753 if (mpu_port[dev] >= 0x200) { /* force MIDI */ 1750 if (mpu_port >= 0x200) { /* force MIDI */
1754 mpu_port[dev] &= 0xfffc; 1751 mpu_port &= 0xfffc;
1755 pci_write_config_dword(chip->pci, 0x18, mpu_port[dev] | 0x01); 1752 pci_write_config_dword(chip->pci, 0x18, mpu_port | 0x01);
1756#ifdef CONFIG_PM 1753#ifdef CONFIG_PM
1757 chip->mpu_port_saved = mpu_port[dev]; 1754 chip->mpu_port_saved = mpu_port;
1758#endif 1755#endif
1759 } else { 1756 } else {
1760 mpu_port[dev] = pci_resource_start(chip->pci, 2); 1757 mpu_port = pci_resource_start(chip->pci, 2);
1761 } 1758 }
1762 } else { 1759 } else {
1763 switch (mpu_port[dev]) { /* force MIDI */ 1760 switch (mpu_port) { /* force MIDI */
1764 case 0x300: 1761 case 0x300:
1765 case 0x310: 1762 case 0x310:
1766 case 0x320: 1763 case 0x320:
1767 case 0x330: 1764 case 0x330:
1768 legacy_cfg &= ~(3 << 2); 1765 legacy_cfg &= ~(3 << 2);
1769 legacy_cfg |= (mpu_port[dev] & 0x0030) >> 2; 1766 legacy_cfg |= (mpu_port & 0x0030) >> 2;
1770 break; 1767 break;
1771 default: /* no, use BIOS settings */ 1768 default: /* no, use BIOS settings */
1772 if (legacy & VIA_FUNC_ENABLE_MIDI) 1769 if (legacy & VIA_FUNC_ENABLE_MIDI)
1773 mpu_port[dev] = 0x300 + ((legacy_cfg & 0x000c) << 2); 1770 mpu_port = 0x300 + ((legacy_cfg & 0x000c) << 2);
1774 break; 1771 break;
1775 } 1772 }
1776 } 1773 }
1777 if (mpu_port[dev] >= 0x200 && 1774 if (mpu_port >= 0x200 &&
1778 (chip->mpu_res = request_region(mpu_port[dev], 2, "VIA82xx MPU401")) != NULL) { 1775 (chip->mpu_res = request_region(mpu_port, 2, "VIA82xx MPU401"))
1776 != NULL) {
1779 if (rev_h) 1777 if (rev_h)
1780 legacy |= VIA_FUNC_MIDI_PNP; /* enable PCI I/O 2 */ 1778 legacy |= VIA_FUNC_MIDI_PNP; /* enable PCI I/O 2 */
1781 legacy |= VIA_FUNC_ENABLE_MIDI; 1779 legacy |= VIA_FUNC_ENABLE_MIDI;
@@ -1783,16 +1781,17 @@ static int __devinit snd_via686_init_misc(via82xx_t *chip, int dev)
1783 if (rev_h) 1781 if (rev_h)
1784 legacy &= ~VIA_FUNC_MIDI_PNP; /* disable PCI I/O 2 */ 1782 legacy &= ~VIA_FUNC_MIDI_PNP; /* disable PCI I/O 2 */
1785 legacy &= ~VIA_FUNC_ENABLE_MIDI; 1783 legacy &= ~VIA_FUNC_ENABLE_MIDI;
1786 mpu_port[dev] = 0; 1784 mpu_port = 0;
1787 } 1785 }
1788 1786
1789 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy); 1787 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy);
1790 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg); 1788 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg);
1791 if (chip->mpu_res) { 1789 if (chip->mpu_res) {
1792 if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A, 1790 if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A,
1793 mpu_port[dev], 1, 1791 mpu_port, 1,
1794 chip->irq, 0, &chip->rmidi) < 0) { 1792 chip->irq, 0, &chip->rmidi) < 0) {
1795 printk(KERN_WARNING "unable to initialize MPU-401 at 0x%lx, skipping\n", mpu_port[dev]); 1793 printk(KERN_WARNING "unable to initialize MPU-401"
1794 " at 0x%lx, skipping\n", mpu_port);
1796 legacy &= ~VIA_FUNC_ENABLE_MIDI; 1795 legacy &= ~VIA_FUNC_ENABLE_MIDI;
1797 } else { 1796 } else {
1798 legacy &= ~VIA_FUNC_MIDI_IRQMASK; /* enable MIDI interrupt */ 1797 legacy &= ~VIA_FUNC_MIDI_IRQMASK; /* enable MIDI interrupt */
@@ -1800,7 +1799,7 @@ static int __devinit snd_via686_init_misc(via82xx_t *chip, int dev)
1800 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy); 1799 pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy);
1801 } 1800 }
1802 1801
1803 snd_via686_create_gameport(chip, dev, &legacy); 1802 snd_via686_create_gameport(chip, &legacy);
1804 1803
1805#ifdef CONFIG_PM 1804#ifdef CONFIG_PM
1806 chip->legacy_saved = legacy; 1805 chip->legacy_saved = legacy;
@@ -2221,7 +2220,6 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
2221static int __devinit snd_via82xx_probe(struct pci_dev *pci, 2220static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2222 const struct pci_device_id *pci_id) 2221 const struct pci_device_id *pci_id)
2223{ 2222{
2224 static int dev;
2225 snd_card_t *card; 2223 snd_card_t *card;
2226 via82xx_t *chip; 2224 via82xx_t *chip;
2227 unsigned char revision; 2225 unsigned char revision;
@@ -2229,14 +2227,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2229 unsigned int i; 2227 unsigned int i;
2230 int err; 2228 int err;
2231 2229
2232 if (dev >= SNDRV_CARDS) 2230 card = snd_card_new(index, id, THIS_MODULE, 0);
2233 return -ENODEV;
2234 if (!enable[dev]) {
2235 dev++;
2236 return -ENOENT;
2237 }
2238
2239 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
2240 if (card == NULL) 2231 if (card == NULL)
2241 return -ENOMEM; 2232 return -ENOMEM;
2242 2233
@@ -2259,12 +2250,12 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2259 } 2250 }
2260 } 2251 }
2261 if (chip_type != TYPE_VIA8233A) { 2252 if (chip_type != TYPE_VIA8233A) {
2262 if (dxs_support[dev] == VIA_DXS_AUTO) 2253 if (dxs_support == VIA_DXS_AUTO)
2263 dxs_support[dev] = check_dxs_list(pci); 2254 dxs_support = check_dxs_list(pci);
2264 /* force to use VIA8233 or 8233A model according to 2255 /* force to use VIA8233 or 8233A model according to
2265 * dxs_support module option 2256 * dxs_support module option
2266 */ 2257 */
2267 if (dxs_support[dev] == VIA_DXS_DISABLE) 2258 if (dxs_support == VIA_DXS_DISABLE)
2268 chip_type = TYPE_VIA8233A; 2259 chip_type = TYPE_VIA8233A;
2269 else 2260 else
2270 chip_type = TYPE_VIA8233; 2261 chip_type = TYPE_VIA8233;
@@ -2282,14 +2273,15 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2282 goto __error; 2273 goto __error;
2283 } 2274 }
2284 2275
2285 if ((err = snd_via82xx_create(card, pci, chip_type, revision, ac97_clock[dev], &chip)) < 0) 2276 if ((err = snd_via82xx_create(card, pci, chip_type, revision,
2277 ac97_clock, &chip)) < 0)
2286 goto __error; 2278 goto __error;
2287 if ((err = snd_via82xx_mixer_new(chip, ac97_quirk[dev])) < 0) 2279 if ((err = snd_via82xx_mixer_new(chip, ac97_quirk)) < 0)
2288 goto __error; 2280 goto __error;
2289 2281
2290 if (chip_type == TYPE_VIA686) { 2282 if (chip_type == TYPE_VIA686) {
2291 if ((err = snd_via686_pcm_new(chip)) < 0 || 2283 if ((err = snd_via686_pcm_new(chip)) < 0 ||
2292 (err = snd_via686_init_misc(chip, dev)) < 0) 2284 (err = snd_via686_init_misc(chip)) < 0)
2293 goto __error; 2285 goto __error;
2294 } else { 2286 } else {
2295 if (chip_type == TYPE_VIA8233A) { 2287 if (chip_type == TYPE_VIA8233A) {
@@ -2299,16 +2291,16 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2299 } else { 2291 } else {
2300 if ((err = snd_via8233_pcm_new(chip)) < 0) 2292 if ((err = snd_via8233_pcm_new(chip)) < 0)
2301 goto __error; 2293 goto __error;
2302 if (dxs_support[dev] == VIA_DXS_48K) 2294 if (dxs_support == VIA_DXS_48K)
2303 chip->dxs_fixed = 1; 2295 chip->dxs_fixed = 1;
2304 else if (dxs_support[dev] == VIA_DXS_NO_VRA) 2296 else if (dxs_support == VIA_DXS_NO_VRA)
2305 chip->no_vra = 1; 2297 chip->no_vra = 1;
2306 else if (dxs_support[dev] == VIA_DXS_SRC) { 2298 else if (dxs_support == VIA_DXS_SRC) {
2307 chip->no_vra = 1; 2299 chip->no_vra = 1;
2308 chip->dxs_src = 1; 2300 chip->dxs_src = 1;
2309 } 2301 }
2310 } 2302 }
2311 if ((err = snd_via8233_init_misc(chip, dev)) < 0) 2303 if ((err = snd_via8233_init_misc(chip)) < 0)
2312 goto __error; 2304 goto __error;
2313 } 2305 }
2314 2306
@@ -2329,7 +2321,6 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2329 return err; 2321 return err;
2330 } 2322 }
2331 pci_set_drvdata(pci, card); 2323 pci_set_drvdata(pci, card);
2332 dev++;
2333 return 0; 2324 return 0;
2334 2325
2335 __error: 2326 __error:
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index c3ab8fbf582c..a7a60d837c85 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -55,18 +55,15 @@ MODULE_DESCRIPTION("VIA VT82xx modem");
55MODULE_LICENSE("GPL"); 55MODULE_LICENSE("GPL");
56MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C modem,pci}}"); 56MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C modem,pci}}");
57 57
58static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ 58static int index = -2; /* Exclude the first card */
59static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 59static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
60static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 60static int ac97_clock = 48000;
61static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
62 61
63module_param_array(index, int, NULL, 0444); 62module_param(index, int, 0444);
64MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); 63MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge.");
65module_param_array(id, charp, NULL, 0444); 64module_param(id, charp, 0444);
66MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge."); 65MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge.");
67module_param_array(enable, bool, NULL, 0444); 66module_param(ac97_clock, int, 0444);
68MODULE_PARM_DESC(enable, "Enable modem part of VIA 82xx bridge.");
69module_param_array(ac97_clock, int, NULL, 0444);
70MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); 67MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
71 68
72 69
@@ -1135,7 +1132,6 @@ static int __devinit snd_via82xx_create(snd_card_t * card,
1135static int __devinit snd_via82xx_probe(struct pci_dev *pci, 1132static int __devinit snd_via82xx_probe(struct pci_dev *pci,
1136 const struct pci_device_id *pci_id) 1133 const struct pci_device_id *pci_id)
1137{ 1134{
1138 static int dev;
1139 snd_card_t *card; 1135 snd_card_t *card;
1140 via82xx_t *chip; 1136 via82xx_t *chip;
1141 unsigned char revision; 1137 unsigned char revision;
@@ -1143,14 +1139,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
1143 unsigned int i; 1139 unsigned int i;
1144 int err; 1140 int err;
1145 1141
1146 if (dev >= SNDRV_CARDS) 1142 card = snd_card_new(index, id, THIS_MODULE, 0);
1147 return -ENODEV;
1148 if (!enable[dev]) {
1149 dev++;
1150 return -ENOENT;
1151 }
1152
1153 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
1154 if (card == NULL) 1143 if (card == NULL)
1155 return -ENOMEM; 1144 return -ENOMEM;
1156 1145
@@ -1167,7 +1156,8 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
1167 goto __error; 1156 goto __error;
1168 } 1157 }
1169 1158
1170 if ((err = snd_via82xx_create(card, pci, chip_type, revision, ac97_clock[dev], &chip)) < 0) 1159 if ((err = snd_via82xx_create(card, pci, chip_type, revision,
1160 ac97_clock, &chip)) < 0)
1171 goto __error; 1161 goto __error;
1172 if ((err = snd_via82xx_mixer_new(chip)) < 0) 1162 if ((err = snd_via82xx_mixer_new(chip)) < 0)
1173 goto __error; 1163 goto __error;
@@ -1191,7 +1181,6 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
1191 return err; 1181 return err;
1192 } 1182 }
1193 pci_set_drvdata(pci, card); 1183 pci_set_drvdata(pci, card);
1194 dev++;
1195 return 0; 1184 return 0;
1196 1185
1197 __error: 1186 __error: