X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Ftrident%2Ftrident.c;h=9145f7c57fb0389cd81a219135351de779ba2aac;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=f68d3a3728aa4a6bbd8776f4f4aee38e7552230e;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index f68d3a372..9145f7c57 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -51,23 +51,24 @@ 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 pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; static int wavetable_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8192}; -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 Trident 4DWave PCI soundcard."); -module_param_array(id, charp, boot_devs, 0444); +module_param_array(id, charp, NULL, 0444); MODULE_PARM_DESC(id, "ID string for Trident 4DWave PCI soundcard."); -module_param_array(enable, bool, boot_devs, 0444); +module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable Trident 4DWave PCI soundcard."); -module_param_array(pcm_channels, int, boot_devs, 0444); +module_param_array(pcm_channels, int, NULL, 0444); MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM."); -module_param_array(wavetable_size, int, boot_devs, 0444); +module_param_array(wavetable_size, int, NULL, 0444); MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); static struct pci_device_id snd_trident_ids[] = { - { 0x1023, 0x2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Trident 4DWave DX PCI Audio */ - { 0x1023, 0x2001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Trident 4DWave NX PCI Audio */ - { 0x1039, 0x7018, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* SiS SI7018 PCI Audio */ + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), + PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), + 0, 0, 0}, + {PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, 0}, { 0, } }; @@ -77,8 +78,8 @@ static int __devinit snd_trident_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { static int dev; - snd_card_t *card; - trident_t *trident; + struct snd_card *card; + struct snd_trident *trident; const char *str; int err, pcm_dev = 0; @@ -101,6 +102,7 @@ static int __devinit snd_trident_probe(struct pci_dev *pci, snd_card_free(card); return err; } + card->private_data = trident; switch (trident->device) { case TRIDENT_DEVICE_ID_DX: @@ -144,8 +146,10 @@ static int __devinit snd_trident_probe(struct pci_dev *pci, return err; } } - if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, - trident->midi_port, 1, + if (trident->device != TRIDENT_DEVICE_ID_SI7018 && + (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, + trident->midi_port, + MPU401_INFO_INTEGRATED, trident->irq, 0, &trident->rmidi)) < 0) { snd_card_free(card); return err; @@ -158,7 +162,7 @@ static int __devinit snd_trident_probe(struct pci_dev *pci, } #endif - snd_trident_gameport(trident); + snd_trident_create_gameport(trident); if ((err = snd_card_register(card)) < 0) { snd_card_free(card); @@ -180,12 +184,15 @@ static struct pci_driver driver = { .id_table = snd_trident_ids, .probe = snd_trident_probe, .remove = __devexit_p(snd_trident_remove), - SND_PCI_PM_CALLBACKS +#ifdef CONFIG_PM + .suspend = snd_trident_suspend, + .resume = snd_trident_resume, +#endif }; static int __init alsa_card_trident_init(void) { - return pci_module_init(&driver); + return pci_register_driver(&driver); } static void __exit alsa_card_trident_exit(void)