aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/nm256/nm256.c
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 /sound/pci/nm256/nm256.c
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>
Diffstat (limited to 'sound/pci/nm256/nm256.c')
-rw-r--r--sound/pci/nm256/nm256.c100
1 files changed, 47 insertions, 53 deletions
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