diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-10-20 11:10:49 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 07:19:17 -0500 |
commit | 8a3fb4d0ce5cc37a765d59b65a3b3714e5806dc9 (patch) | |
tree | e6edf683d5e474db4879b1209b0841cda5f67ef5 | |
parent | 698444f31788bd9992f7c31bcc4862d82f985890 (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.txt | 4 | ||||
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 37 | ||||
-rw-r--r-- | sound/pci/nm256/nm256.c | 100 |
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"); | |||
45 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
46 | MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}"); | 46 | MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}"); |
47 | 47 | ||
48 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 48 | static int index = SNDRV_DEFAULT_IDX1; /* Index */ |
49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 49 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
50 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 50 | static int pcm_channels = 32; |
51 | static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; | 51 | static int spdif = 0; |
52 | static int spdif[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; | ||
53 | 52 | ||
54 | module_param_array(index, int, NULL, 0444); | 53 | module_param(index, int, 0444); |
55 | MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); | 54 | MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); |
56 | module_param_array(id, charp, NULL, 0444); | 55 | module_param(id, charp, 0444); |
57 | MODULE_PARM_DESC(id, "ID string for ALI M5451 PCI Audio."); | 56 | MODULE_PARM_DESC(id, "ID string for ALI M5451 PCI Audio."); |
58 | module_param_array(enable, bool, NULL, 0444); | 57 | module_param(pcm_channels, int, 0444); |
59 | MODULE_PARM_DESC(enable, "Enable ALI 5451 PCI Audio."); | ||
60 | module_param_array(pcm_channels, int, NULL, 0444); | ||
61 | MODULE_PARM_DESC(pcm_channels, "PCM Channels"); | 58 | MODULE_PARM_DESC(pcm_channels, "PCM Channels"); |
62 | module_param_array(spdif, bool, NULL, 0444); | 59 | module_param(spdif, bool, 0444); |
63 | MODULE_PARM_DESC(spdif, "Support SPDIF I/O"); | 60 | MODULE_PARM_DESC(spdif, "Support SPDIF I/O"); |
64 | 61 | ||
62 | /* just for backward compatibility */ | ||
63 | static int enable; | ||
64 | module_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, | |||
2353 | static int __devinit snd_ali_probe(struct pci_dev *pci, | 2355 | static 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 | ||
55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 55 | static int index = SNDRV_DEFAULT_IDX1; /* Index */ |
56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 56 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
57 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 57 | static int playback_bufsize = 16; |
58 | static int playback_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 16}; | 58 | static int capture_bufsize = 16; |
59 | static int capture_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 16}; | 59 | static int force_ac97; /* disabled as default */ |
60 | static int force_ac97[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled as default */ | 60 | static int buffer_top; /* not specified */ |
61 | static int buffer_top[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* not specified */ | 61 | static int use_cache; /* disabled */ |
62 | static int use_cache[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */ | 62 | static int vaio_hack; /* disabled */ |
63 | static int vaio_hack[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */ | 63 | static int reset_workaround; |
64 | static int reset_workaround[SNDRV_CARDS]; | 64 | static int reset_workaround_2; |
65 | static int reset_workaround_2[SNDRV_CARDS]; | 65 | |
66 | 66 | module_param(index, int, 0444); | |
67 | module_param_array(index, int, NULL, 0444); | ||
68 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); | 67 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
69 | module_param_array(id, charp, NULL, 0444); | 68 | module_param(id, charp, 0444); |
70 | MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard."); | 69 | MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard."); |
71 | module_param_array(enable, bool, NULL, 0444); | 70 | module_param(playback_bufsize, int, 0444); |
72 | MODULE_PARM_DESC(enable, "Enable this soundcard."); | ||
73 | module_param_array(playback_bufsize, int, NULL, 0444); | ||
74 | MODULE_PARM_DESC(playback_bufsize, "DAC frame size in kB for " CARD_NAME " soundcard."); | 71 | MODULE_PARM_DESC(playback_bufsize, "DAC frame size in kB for " CARD_NAME " soundcard."); |
75 | module_param_array(capture_bufsize, int, NULL, 0444); | 72 | module_param(capture_bufsize, int, 0444); |
76 | MODULE_PARM_DESC(capture_bufsize, "ADC frame size in kB for " CARD_NAME " soundcard."); | 73 | MODULE_PARM_DESC(capture_bufsize, "ADC frame size in kB for " CARD_NAME " soundcard."); |
77 | module_param_array(force_ac97, bool, NULL, 0444); | 74 | module_param(force_ac97, bool, 0444); |
78 | MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard."); | 75 | MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard."); |
79 | module_param_array(buffer_top, int, NULL, 0444); | 76 | module_param(buffer_top, int, 0444); |
80 | MODULE_PARM_DESC(buffer_top, "Set the top address of audio buffer for " CARD_NAME " soundcard."); | 77 | MODULE_PARM_DESC(buffer_top, "Set the top address of audio buffer for " CARD_NAME " soundcard."); |
81 | module_param_array(use_cache, bool, NULL, 0444); | 78 | module_param(use_cache, bool, 0444); |
82 | MODULE_PARM_DESC(use_cache, "Enable the cache for coefficient table access."); | 79 | MODULE_PARM_DESC(use_cache, "Enable the cache for coefficient table access."); |
83 | module_param_array(vaio_hack, bool, NULL, 0444); | 80 | module_param(vaio_hack, bool, 0444); |
84 | MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks."); | 81 | MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks."); |
85 | module_param_array(reset_workaround, bool, NULL, 0444); | 82 | module_param(reset_workaround, bool, 0444); |
86 | MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some laptops."); | 83 | MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some laptops."); |
87 | module_param_array(reset_workaround_2, bool, NULL, 0444); | 84 | module_param(reset_workaround_2, bool, 0444); |
88 | MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops."); | 85 | MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops."); |
89 | 86 | ||
87 | /* just for backward compatibility */ | ||
88 | static int enable; | ||
89 | module_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 = { | |||
1561 | static int __devinit snd_nm256_probe(struct pci_dev *pci, | 1564 | static 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 | ||