#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
-#include <linux/gameport.h>
#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/info.h>
-#include <sound/mpu401.h>
#include <sound/initval.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
"{Intel,82801CA-ICH3},"
"{Intel,82801DB-ICH4},"
"{Intel,ICH5},"
- "{Intel,MX440}}");
-
+ "{Intel,MX440},"
+ "{SiS,7013},"
+ "{NVidia,NForce Modem},"
+ "{NVidia,NForce2 Modem},"
+ "{NVidia,NForce2s Modem},"
+ "{NVidia,NForce3 Modem},"
+ "{AMD,AMD768}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
-static int boot_devs;
-module_param_array(index, int, boot_devs, 0444);
+module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard.");
-module_param_array(id, charp, boot_devs, 0444);
+module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for Intel i8x0 modemcard.");
-module_param_array(enable, bool, boot_devs, 0444);
+module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable Intel i8x0 modemcard.");
-module_param_array(ac97_clock, int, boot_devs, 0444);
+module_param_array(ac97_clock, int, NULL, 0444);
MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
/*
unsigned int mmio;
unsigned long addr;
- unsigned long remap_addr;
+ void __iomem *remap_addr;
unsigned int bm_mmio;
unsigned long bmaddr;
- unsigned long remap_bmaddr;
+ void __iomem *remap_bmaddr;
struct pci_dev *pci;
snd_card_t *card;
ac97_t *ac97;
spinlock_t reg_lock;
- spinlock_t ac97_lock;
struct snd_dma_buffer bdbars;
u32 bdbars_count;
{
intel8x0_t *chip = ac97->private_data;
- spin_lock(&chip->ac97_lock);
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
if (! chip->in_ac97_init)
snd_printk("codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
}
iaputword(chip, reg + ac97->num * 0x80, val);
- spin_unlock(&chip->ac97_lock);
}
static unsigned short snd_intel8x0_codec_read(ac97_t *ac97,
unsigned short res;
unsigned int tmp;
- spin_lock(&chip->ac97_lock);
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
if (! chip->in_ac97_init)
snd_printk("codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
}
- spin_unlock(&chip->ac97_lock);
return res;
}
if (chip->bdbars.area)
snd_dma_free_pages(&chip->bdbars);
if (chip->remap_addr)
- iounmap((void *) chip->remap_addr);
+ iounmap(chip->remap_addr);
if (chip->remap_bmaddr)
- iounmap((void *) chip->remap_bmaddr);
+ iounmap(chip->remap_bmaddr);
if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip);
pci_release_regions(chip->pci);
+ pci_disable_device(chip->pci);
kfree(chip);
return 0;
}
snd_pcm_suspend_all(chip->pcm[i]);
if (chip->ac97)
snd_ac97_suspend(chip->ac97);
- snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ pci_disable_device(chip->pci);
return 0;
}
if (chip->ac97)
snd_ac97_resume(chip->ac97);
- snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
#endif /* CONFIG_PM */
return err;
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
- if (chip == NULL)
+ if (chip == NULL) {
+ pci_disable_device(pci);
return -ENOMEM;
+ }
spin_lock_init(&chip->reg_lock);
- spin_lock_init(&chip->ac97_lock);
chip->device_type = device_type;
chip->card = card;
chip->pci = pci;
if ((err = pci_request_regions(pci, card->shortname)) < 0) {
kfree(chip);
+ pci_disable_device(pci);
return err;
}
if (pci_resource_flags(pci, 2) & IORESOURCE_MEM) { /* ICH4 and Nforce */
chip->mmio = 1;
chip->addr = pci_resource_start(pci, 2);
- chip->remap_addr = (unsigned long) ioremap_nocache(chip->addr,
- pci_resource_len(pci, 2));
- if (chip->remap_addr == 0) {
+ chip->remap_addr = ioremap_nocache(chip->addr,
+ pci_resource_len(pci, 2));
+ if (chip->remap_addr == NULL) {
snd_printk("AC'97 space ioremap problem\n");
snd_intel8x0_free(chip);
return -EIO;
if (pci_resource_flags(pci, 3) & IORESOURCE_MEM) { /* ICH4 */
chip->bm_mmio = 1;
chip->bmaddr = pci_resource_start(pci, 3);
- chip->remap_bmaddr = (unsigned long) ioremap_nocache(chip->bmaddr,
- pci_resource_len(pci, 3));
- if (chip->remap_bmaddr == 0) {
+ chip->remap_bmaddr = ioremap_nocache(chip->bmaddr,
+ pci_resource_len(pci, 3));
+ if (chip->remap_bmaddr == NULL) {
snd_printk("Controller space ioremap problem\n");
snd_intel8x0_free(chip);
return -EIO;
if (card == NULL)
return -ENOMEM;
- switch (pci_id->driver_data) {
- case DEVICE_NFORCE:
- strcpy(card->driver, "NFORCE-MODEM");
- break;
- default:
- strcpy(card->driver, "ICH-MODEM");
- break;
- }
-
+ strcpy(card->driver, "ICH-MODEM");
strcpy(card->shortname, "Intel ICH");
for (name = shortnames; name->id; name++) {
if (pci->device == name->id) {