diff options
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r-- | sound/pci/atiixp.c | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 241eacf1e652..f5dad9248e39 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -39,26 +39,27 @@ MODULE_DESCRIPTION("ATI IXP AC97 controller"); | |||
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400}}"); | 40 | MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400}}"); |
41 | 41 | ||
42 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 42 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
43 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 43 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
44 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 44 | static int ac97_clock = 48000; |
45 | static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000}; | 45 | static char *ac97_quirk; |
46 | static char *ac97_quirk[SNDRV_CARDS]; | 46 | static int spdif_aclink = 1; |
47 | static int spdif_aclink[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 47 | |
48 | 48 | module_param(index, int, 0444); | |
49 | module_param_array(index, int, NULL, 0444); | ||
50 | MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); | 49 | MODULE_PARM_DESC(index, "Index value for ATI IXP controller."); |
51 | module_param_array(id, charp, NULL, 0444); | 50 | module_param(id, charp, 0444); |
52 | MODULE_PARM_DESC(id, "ID string for ATI IXP controller."); | 51 | MODULE_PARM_DESC(id, "ID string for ATI IXP controller."); |
53 | module_param_array(enable, bool, NULL, 0444); | 52 | module_param(ac97_clock, int, 0444); |
54 | MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller."); | ||
55 | module_param_array(ac97_clock, int, NULL, 0444); | ||
56 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); | 53 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); |
57 | module_param_array(ac97_quirk, charp, NULL, 0444); | 54 | module_param(ac97_quirk, charp, 0444); |
58 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); | 55 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); |
59 | module_param_array(spdif_aclink, bool, NULL, 0444); | 56 | module_param(spdif_aclink, bool, 0444); |
60 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); | 57 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); |
61 | 58 | ||
59 | /* just for backward compatibility */ | ||
60 | static int enable; | ||
61 | module_param(enable, bool, 0444); | ||
62 | |||
62 | 63 | ||
63 | /* | 64 | /* |
64 | */ | 65 | */ |
@@ -329,8 +330,7 @@ static int snd_atiixp_update_bits(atiixp_t *chip, unsigned int reg, | |||
329 | 330 | ||
330 | /* delay for one tick */ | 331 | /* delay for one tick */ |
331 | #define do_delay() do { \ | 332 | #define do_delay() do { \ |
332 | set_current_state(TASK_UNINTERRUPTIBLE); \ | 333 | schedule_timeout_uninterruptible(1); \ |
333 | schedule_timeout(1); \ | ||
334 | } while (0) | 334 | } while (0) |
335 | 335 | ||
336 | 336 | ||
@@ -1372,7 +1372,6 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock, const char | |||
1372 | if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) | 1372 | if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &pbus)) < 0) |
1373 | return err; | 1373 | return err; |
1374 | pbus->clock = clock; | 1374 | pbus->clock = clock; |
1375 | pbus->shared_type = AC97_SHARED_TYPE_ATIIXP; /* shared with modem driver */ | ||
1376 | chip->ac97_bus = pbus; | 1375 | chip->ac97_bus = pbus; |
1377 | 1376 | ||
1378 | codec_count = 0; | 1377 | codec_count = 0; |
@@ -1579,26 +1578,18 @@ static int __devinit snd_atiixp_create(snd_card_t *card, | |||
1579 | static int __devinit snd_atiixp_probe(struct pci_dev *pci, | 1578 | static int __devinit snd_atiixp_probe(struct pci_dev *pci, |
1580 | const struct pci_device_id *pci_id) | 1579 | const struct pci_device_id *pci_id) |
1581 | { | 1580 | { |
1582 | static int dev; | ||
1583 | snd_card_t *card; | 1581 | snd_card_t *card; |
1584 | atiixp_t *chip; | 1582 | atiixp_t *chip; |
1585 | unsigned char revision; | 1583 | unsigned char revision; |
1586 | int err; | 1584 | int err; |
1587 | 1585 | ||
1588 | if (dev >= SNDRV_CARDS) | 1586 | card = snd_card_new(index, id, THIS_MODULE, 0); |
1589 | return -ENODEV; | ||
1590 | if (!enable[dev]) { | ||
1591 | dev++; | ||
1592 | return -ENOENT; | ||
1593 | } | ||
1594 | |||
1595 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | ||
1596 | if (card == NULL) | 1587 | if (card == NULL) |
1597 | return -ENOMEM; | 1588 | return -ENOMEM; |
1598 | 1589 | ||
1599 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | 1590 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); |
1600 | 1591 | ||
1601 | strcpy(card->driver, spdif_aclink[dev] ? "ATIIXP" : "ATIIXP-SPDMA"); | 1592 | strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA"); |
1602 | strcpy(card->shortname, "ATI IXP"); | 1593 | strcpy(card->shortname, "ATI IXP"); |
1603 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) | 1594 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) |
1604 | goto __error; | 1595 | goto __error; |
@@ -1606,9 +1597,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1606 | if ((err = snd_atiixp_aclink_reset(chip)) < 0) | 1597 | if ((err = snd_atiixp_aclink_reset(chip)) < 0) |
1607 | goto __error; | 1598 | goto __error; |
1608 | 1599 | ||
1609 | chip->spdif_over_aclink = spdif_aclink[dev]; | 1600 | chip->spdif_over_aclink = spdif_aclink; |
1610 | 1601 | ||
1611 | if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev], ac97_quirk[dev])) < 0) | 1602 | if ((err = snd_atiixp_mixer_new(chip, ac97_clock, ac97_quirk)) < 0) |
1612 | goto __error; | 1603 | goto __error; |
1613 | 1604 | ||
1614 | if ((err = snd_atiixp_pcm_new(chip)) < 0) | 1605 | if ((err = snd_atiixp_pcm_new(chip)) < 0) |
@@ -1629,7 +1620,6 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1629 | goto __error; | 1620 | goto __error; |
1630 | 1621 | ||
1631 | pci_set_drvdata(pci, card); | 1622 | pci_set_drvdata(pci, card); |
1632 | dev++; | ||
1633 | return 0; | 1623 | return 0; |
1634 | 1624 | ||
1635 | __error: | 1625 | __error: |