aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-20 11:10:49 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:19:17 -0500
commit8a3fb4d0ce5cc37a765d59b65a3b3714e5806dc9 (patch)
treee6edf683d5e474db4879b1209b0841cda5f67ef5
parent698444f31788bd9992f7c31bcc4862d82f985890 (diff)
[ALSA] Remove multi-card support for ali5451 and nm256
Modules: Documentation,ALI5451 driver,NM256 driver Removed multi-card supports for ali5451 and nm256 drivers. They are supposed to be a single device. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt4
-rw-r--r--sound/pci/ali5451/ali5451.c37
-rw-r--r--sound/pci/nm256/nm256.c100
3 files changed, 64 insertions, 77 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 9342846c7c48..2f27f391c7cc 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -167,7 +167,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
167 spdif - Support SPDIF I/O 167 spdif - Support SPDIF I/O
168 - Default: disabled 168 - Default: disabled
169 169
170 Module supports autoprobe and multiple chips (max 8). 170 This module supports one chip and autoprobe.
171 171
172 The power-management is supported. 172 The power-management is supported.
173 173
@@ -957,7 +957,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
957 reset_workaround2 - enable extended AC97 RESET workaround for some 957 reset_workaround2 - enable extended AC97 RESET workaround for some
958 other laptops 958 other laptops
959 959
960 Module supports autoprobe and multiple chips (max 8). 960 This module supports one chip and autoprobe.
961 961
962 The power-management is supported. 962 The power-management is supported.
963 963
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
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index d0da9a53de03..cccdc576b8a3 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -52,41 +52,44 @@ MODULE_SUPPORTED_DEVICE("{{NeoMagic,NM256AV},"
52 * some compile conditions. 52 * some compile conditions.
53 */ 53 */
54 54
55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 55static int index = SNDRV_DEFAULT_IDX1; /* Index */
56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 56static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
57static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 57static int playback_bufsize = 16;
58static int playback_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 16}; 58static int capture_bufsize = 16;
59static int capture_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 16}; 59static int force_ac97; /* disabled as default */
60static int force_ac97[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled as default */ 60static int buffer_top; /* not specified */
61static int buffer_top[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* not specified */ 61static int use_cache; /* disabled */
62static int use_cache[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */ 62static int vaio_hack; /* disabled */
63static int vaio_hack[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */ 63static int reset_workaround;
64static int reset_workaround[SNDRV_CARDS]; 64static int reset_workaround_2;
65static int reset_workaround_2[SNDRV_CARDS]; 65
66 66module_param(index, int, 0444);
67module_param_array(index, int, NULL, 0444);
68MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); 67MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
69module_param_array(id, charp, NULL, 0444); 68module_param(id, charp, 0444);
70MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard."); 69MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
71module_param_array(enable, bool, NULL, 0444); 70module_param(playback_bufsize, int, 0444);
72MODULE_PARM_DESC(enable, "Enable this soundcard.");
73module_param_array(playback_bufsize, int, NULL, 0444);
74MODULE_PARM_DESC(playback_bufsize, "DAC frame size in kB for " CARD_NAME " soundcard."); 71MODULE_PARM_DESC(playback_bufsize, "DAC frame size in kB for " CARD_NAME " soundcard.");
75module_param_array(capture_bufsize, int, NULL, 0444); 72module_param(capture_bufsize, int, 0444);
76MODULE_PARM_DESC(capture_bufsize, "ADC frame size in kB for " CARD_NAME " soundcard."); 73MODULE_PARM_DESC(capture_bufsize, "ADC frame size in kB for " CARD_NAME " soundcard.");
77module_param_array(force_ac97, bool, NULL, 0444); 74module_param(force_ac97, bool, 0444);
78MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard."); 75MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard.");
79module_param_array(buffer_top, int, NULL, 0444); 76module_param(buffer_top, int, 0444);
80MODULE_PARM_DESC(buffer_top, "Set the top address of audio buffer for " CARD_NAME " soundcard."); 77MODULE_PARM_DESC(buffer_top, "Set the top address of audio buffer for " CARD_NAME " soundcard.");
81module_param_array(use_cache, bool, NULL, 0444); 78module_param(use_cache, bool, 0444);
82MODULE_PARM_DESC(use_cache, "Enable the cache for coefficient table access."); 79MODULE_PARM_DESC(use_cache, "Enable the cache for coefficient table access.");
83module_param_array(vaio_hack, bool, NULL, 0444); 80module_param(vaio_hack, bool, 0444);
84MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks."); 81MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks.");
85module_param_array(reset_workaround, bool, NULL, 0444); 82module_param(reset_workaround, bool, 0444);
86MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some laptops."); 83MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some laptops.");
87module_param_array(reset_workaround_2, bool, NULL, 0444); 84module_param(reset_workaround_2, bool, 0444);
88MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops."); 85MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops.");
89 86
87/* just for backward compatibility */
88static int enable;
89module_param(enable, bool, 0444);
90
91
92
90/* 93/*
91 * hw definitions 94 * hw definitions
92 */ 95 */
@@ -1561,7 +1564,6 @@ static struct nm256_quirk nm256_quirks[] __devinitdata = {
1561static int __devinit snd_nm256_probe(struct pci_dev *pci, 1564static int __devinit snd_nm256_probe(struct pci_dev *pci,
1562 const struct pci_device_id *pci_id) 1565 const struct pci_device_id *pci_id)
1563{ 1566{
1564 static int dev;
1565 snd_card_t *card; 1567 snd_card_t *card;
1566 nm256_t *chip; 1568 nm256_t *chip;
1567 int err; 1569 int err;
@@ -1569,13 +1571,6 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
1569 struct nm256_quirk *q; 1571 struct nm256_quirk *q;
1570 u16 subsystem_vendor, subsystem_device; 1572 u16 subsystem_vendor, subsystem_device;
1571 1573
1572 if (dev >= SNDRV_CARDS)
1573 return -ENODEV;
1574 if (!enable[dev]) {
1575 dev++;
1576 return -ENOENT;
1577 }
1578
1579 pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor); 1574 pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
1580 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device); 1575 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device);
1581 1576
@@ -1586,16 +1581,16 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
1586 printk(KERN_INFO "nm256: The device is blacklisted. Loading stopped\n"); 1581 printk(KERN_INFO "nm256: The device is blacklisted. Loading stopped\n");
1587 return -ENODEV; 1582 return -ENODEV;
1588 case NM_RESET_WORKAROUND_2: 1583 case NM_RESET_WORKAROUND_2:
1589 reset_workaround_2[dev] = 1; 1584 reset_workaround_2 = 1;
1590 /* Fall-through */ 1585 /* Fall-through */
1591 case NM_RESET_WORKAROUND: 1586 case NM_RESET_WORKAROUND:
1592 reset_workaround[dev] = 1; 1587 reset_workaround = 1;
1593 break; 1588 break;
1594 } 1589 }
1595 } 1590 }
1596 } 1591 }
1597 1592
1598 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); 1593 card = snd_card_new(index, id, THIS_MODULE, 0);
1599 if (card == NULL) 1594 if (card == NULL)
1600 return -ENOMEM; 1595 return -ENOMEM;
1601 1596
@@ -1615,36 +1610,36 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
1615 return -EINVAL; 1610 return -EINVAL;
1616 } 1611 }
1617 1612
1618 if (vaio_hack[dev]) 1613 if (vaio_hack)
1619 xbuffer_top = 0x25a800; /* this avoids conflicts with XFree86 server */ 1614 xbuffer_top = 0x25a800; /* this avoids conflicts with XFree86 server */
1620 else 1615 else
1621 xbuffer_top = buffer_top[dev]; 1616 xbuffer_top = buffer_top;
1622 1617
1623 if (playback_bufsize[dev] < 4) 1618 if (playback_bufsize < 4)
1624 playback_bufsize[dev] = 4; 1619 playback_bufsize = 4;
1625 if (playback_bufsize[dev] > 128) 1620 if (playback_bufsize > 128)
1626 playback_bufsize[dev] = 128; 1621 playback_bufsize = 128;
1627 if (capture_bufsize[dev] < 4) 1622 if (capture_bufsize < 4)
1628 capture_bufsize[dev] = 4; 1623 capture_bufsize = 4;
1629 if (capture_bufsize[dev] > 128) 1624 if (capture_bufsize > 128)
1630 capture_bufsize[dev] = 128; 1625 capture_bufsize = 128;
1631 if ((err = snd_nm256_create(card, pci, 1626 if ((err = snd_nm256_create(card, pci,
1632 playback_bufsize[dev] * 1024, /* in bytes */ 1627 playback_bufsize * 1024, /* in bytes */
1633 capture_bufsize[dev] * 1024, /* in bytes */ 1628 capture_bufsize * 1024, /* in bytes */
1634 force_ac97[dev], 1629 force_ac97,
1635 xbuffer_top, 1630 xbuffer_top,
1636 use_cache[dev], 1631 use_cache,
1637 &chip)) < 0) { 1632 &chip)) < 0) {
1638 snd_card_free(card); 1633 snd_card_free(card);
1639 return err; 1634 return err;
1640 } 1635 }
1641 1636
1642 if (reset_workaround[dev]) { 1637 if (reset_workaround) {
1643 snd_printdd(KERN_INFO "nm256: reset_workaround activated\n"); 1638 snd_printdd(KERN_INFO "nm256: reset_workaround activated\n");
1644 chip->reset_workaround = 1; 1639 chip->reset_workaround = 1;
1645 } 1640 }
1646 1641
1647 if (reset_workaround_2[dev]) { 1642 if (reset_workaround_2) {
1648 snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n"); 1643 snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n");
1649 chip->reset_workaround_2 = 1; 1644 chip->reset_workaround_2 = 1;
1650 } 1645 }
@@ -1666,7 +1661,6 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
1666 } 1661 }
1667 1662
1668 pci_set_drvdata(pci, card); 1663 pci_set_drvdata(pci, card);
1669 dev++;
1670 return 0; 1664 return 0;
1671} 1665}
1672 1666