Changeset 679 for GPL/trunk/alsa-kernel/pci/trident/trident.c
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk ¶
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
TabularUnified GPL/trunk/alsa-kernel/pci/trident/trident.c ¶
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Driver for Trident 4DWave DX/NX & SiS SI7018 Audio PCI soundcard … … 4 5 * Driver was originated by Trident <audio@tridentmicro.com> 5 6 * Fri Feb 19 15:55:28 MST 1999 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 7 */ 23 8 … … 25 10 #include <linux/pci.h> 26 11 #include <linux/time.h> 27 #include <linux/module param.h>12 #include <linux/module.h> 28 13 #include <sound/core.h> 29 #include <sound/trident.h>14 #include "trident.h" 30 15 #include <sound/initval.h> 16 17 #ifdef TARGET_OS2 18 #define KBUILD_MODNAME "trident" 19 #endif 31 20 32 21 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>"); … … 48 37 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 49 38 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 50 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */39 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 51 40 #ifndef TARGET_OS2 52 41 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; … … 68 57 MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); 69 58 70 static DEFINE_PCI_DEVICE_TABLE(snd_trident_ids)= {59 static const struct pci_device_id snd_trident_ids[] = { 71 60 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), 72 61 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, … … 79 68 MODULE_DEVICE_TABLE(pci, snd_trident_ids); 80 69 81 static int __devinitsnd_trident_probe(struct pci_dev *pci,82 70 static int snd_trident_probe(struct pci_dev *pci, 71 const struct pci_device_id *pci_id) 83 72 { 84 73 static int dev; … … 95 84 } 96 85 97 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 86 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 87 0, &card); 98 88 if (err < 0) 99 89 return err; … … 128 118 strcpy(card->shortname, "Trident "); 129 119 } 130 strcat(card->shortname, card->driver);120 strcat(card->shortname, str); 131 121 sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", 132 122 card->shortname, trident->port, trident->irq); 133 123 134 if ((err = snd_trident_pcm(trident, pcm_dev++ , NULL)) < 0) {124 if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { 135 125 snd_card_free(card); 136 126 return err; … … 139 129 case TRIDENT_DEVICE_ID_DX: 140 130 case TRIDENT_DEVICE_ID_NX: 141 if ((err = snd_trident_foldback_pcm(trident, pcm_dev++ , NULL)) < 0) {131 if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { 142 132 snd_card_free(card); 143 133 return err; … … 146 136 } 147 137 if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { 148 if ((err = snd_trident_spdif_pcm(trident, pcm_dev++ , NULL)) < 0) {138 if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { 149 139 snd_card_free(card); 150 140 return err; … … 154 144 (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, 155 145 trident->midi_port, 156 MPU401_INFO_INTEGRATED, 157 trident->irq, 0, &trident->rmidi)) < 0) { 146 MPU401_INFO_INTEGRATED | 147 MPU401_INFO_IRQ_HOOK, 148 -1, &trident->rmidi)) < 0) { 158 149 snd_card_free(card); 159 150 return err; … … 171 162 } 172 163 173 static void __devexitsnd_trident_remove(struct pci_dev *pci)164 static void snd_trident_remove(struct pci_dev *pci) 174 165 { 175 166 snd_card_free(pci_get_drvdata(pci)); 176 pci_set_drvdata(pci, NULL);177 167 } 178 168 179 static struct pci_driver driver = {180 .name = "Trident4DWaveAudio",169 static struct pci_driver trident_driver = { 170 .name = KBUILD_MODNAME, 181 171 .id_table = snd_trident_ids, 182 172 .probe = snd_trident_probe, 183 .remove = __devexit_p(snd_trident_remove), 184 #ifdef CONFIG_PM 185 .suspend = snd_trident_suspend, 186 .resume = snd_trident_resume, 173 .remove = snd_trident_remove, 174 #ifdef CONFIG_PM_SLEEP 175 .driver = { 176 .pm = &snd_trident_pm, 177 }, 187 178 #endif 188 179 }; 189 180 190 static int __init alsa_card_trident_init(void) 191 { 192 return pci_register_driver(&driver); 193 } 194 195 static void __exit alsa_card_trident_exit(void) 196 { 197 pci_unregister_driver(&driver); 198 } 199 200 module_init(alsa_card_trident_init) 201 module_exit(alsa_card_trident_exit) 181 module_pci_driver(trident_driver);
Note:
See TracChangeset
for help on using the changeset viewer.