Changeset 679 for GPL/trunk/alsa-kernel/isa/gus/gusextreme.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
-
GPL/trunk/alsa-kernel/isa/gus/gusextreme.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Driver for Gravis UltraSound Extreme soundcards 3 4 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 4 *5 *6 * This program is free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 2 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19 *20 5 */ 21 6 … … 25 10 #include <linux/delay.h> 26 11 #include <linux/time.h> 27 #include <linux/module param.h>12 #include <linux/module.h> 28 13 #include <asm/dma.h> 29 14 #include <sound/core.h> … … 47 32 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 48 33 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 49 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */34 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 50 35 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 51 36 static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */ … … 67 52 module_param_array(enable, bool, NULL, 0444); 68 53 MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard."); 69 module_param_ array(port, long, NULL, 0444);54 module_param_hw_array(port, long, ioport, NULL, 0444); 70 55 MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); 71 module_param_ array(gf1_port, long, NULL, 0444);56 module_param_hw_array(gf1_port, long, ioport, NULL, 0444); 72 57 MODULE_PARM_DESC(gf1_port, "GF1 port # for " CRD_NAME " driver (optional)."); 73 module_param_ array(mpu_port, long, NULL, 0444);58 module_param_hw_array(mpu_port, long, ioport, NULL, 0444); 74 59 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); 75 module_param_ array(irq, int, NULL, 0444);60 module_param_hw_array(irq, int, irq, NULL, 0444); 76 61 MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); 77 module_param_ array(mpu_irq, int, NULL, 0444);62 module_param_hw_array(mpu_irq, int, irq, NULL, 0444); 78 63 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); 79 module_param_ array(gf1_irq, int, NULL, 0444);64 module_param_hw_array(gf1_irq, int, irq, NULL, 0444); 80 65 MODULE_PARM_DESC(gf1_irq, "GF1 IRQ # for " CRD_NAME " driver."); 81 module_param_ array(dma8, int, NULL, 0444);66 module_param_hw_array(dma8, int, dma, NULL, 0444); 82 67 MODULE_PARM_DESC(dma8, "8-bit DMA # for " CRD_NAME " driver."); 83 module_param_ array(dma1, int, NULL, 0444);68 module_param_hw_array(dma1, int, dma, NULL, 0444); 84 69 MODULE_PARM_DESC(dma1, "GF1 DMA # for " CRD_NAME " driver."); 85 70 module_param_array(joystick_dac, int, NULL, 0444); … … 90 75 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver."); 91 76 92 static int __devinitsnd_gusextreme_match(struct device *dev, unsigned int n)77 static int snd_gusextreme_match(struct device *dev, unsigned int n) 93 78 { 94 79 return enable[n]; 95 80 } 96 81 97 static int __devinit snd_gusextreme_es1688_create(struct snd_card *card, 98 struct snd_es1688 *chip, struct device *dev, unsigned int n) 99 { 100 static long possible_ports[] = {0x220, 0x240, 0x260}; 101 static int possible_irqs[] = {5, 9, 10, 7, -1}; 102 static int possible_dmas[] = {1, 3, 0, -1}; 82 static int snd_gusextreme_es1688_create(struct snd_card *card, 83 struct snd_es1688 *chip, 84 struct device *dev, unsigned int n) 85 { 86 static const long possible_ports[] = {0x220, 0x240, 0x260}; 87 static const int possible_irqs[] = {5, 9, 10, 7, -1}; 88 static const int possible_dmas[] = {1, 3, 0, -1}; 103 89 104 90 int i, error; … … 133 119 } 134 120 135 static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card, 136 struct device *dev, unsigned int n, struct snd_gus_card **rgus) 137 { 138 static int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1}; 139 static int possible_dmas[] = {5, 6, 7, 3, 1, -1}; 121 static int snd_gusextreme_gus_card_create(struct snd_card *card, 122 struct device *dev, unsigned int n, 123 struct snd_gus_card **rgus) 124 { 125 static const int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1}; 126 static const int possible_dmas[] = {5, 6, 7, 3, 1, -1}; 140 127 141 128 if (gf1_irq[n] == SNDRV_AUTO_IRQ) { … … 157 144 } 158 145 159 static int __devinitsnd_gusextreme_detect(struct snd_gus_card *gus,160 struct snd_es1688 *es1688)146 static int snd_gusextreme_detect(struct snd_gus_card *gus, 147 struct snd_es1688 *es1688) 161 148 { 162 149 unsigned long flags; … … 207 194 } 208 195 209 static int __devinitsnd_gusextreme_mixer(struct snd_card *card)196 static int snd_gusextreme_mixer(struct snd_card *card) 210 197 { 211 198 struct snd_ctl_elem_id id1, id2; … … 233 220 } 234 221 235 static int __devinitsnd_gusextreme_probe(struct device *dev, unsigned int n)222 static int snd_gusextreme_probe(struct device *dev, unsigned int n) 236 223 { 237 224 struct snd_card *card; … … 241 228 int error; 242 229 243 error = snd_card_ create(index[n], id[n], THIS_MODULE,244 230 error = snd_card_new(dev, index[n], id[n], THIS_MODULE, 231 sizeof(struct snd_es1688), &card); 245 232 if (error < 0) 246 233 return error; … … 283 270 gus->codec_flag = 1; 284 271 285 error = snd_es1688_pcm(card, es1688, 0 , NULL);272 error = snd_es1688_pcm(card, es1688, 0); 286 273 if (error < 0) 287 274 goto out; … … 294 281 295 282 if (pcm_channels[n] > 0) { 296 error = snd_gf1_pcm_new(gus, 1, 1 , NULL);283 error = snd_gf1_pcm_new(gus, 1, 1); 297 284 if (error < 0) 298 285 goto out; … … 318 305 if (es1688->mpu_port >= 0x300) { 319 306 error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688, 320 es1688->mpu_port, 0, 321 mpu_irq[n], IRQF_DISABLED, NULL); 307 es1688->mpu_port, 0, mpu_irq[n], NULL); 322 308 if (error < 0) 323 309 goto out; … … 328 314 gus->gf1.irq, es1688->irq, gus->gf1.dma1, es1688->dma8); 329 315 330 snd_card_set_dev(card, dev);331 332 316 error = snd_card_register(card); 333 317 if (error < 0) … … 341 325 } 342 326 343 static int __devexitsnd_gusextreme_remove(struct device *dev, unsigned int n)327 static int snd_gusextreme_remove(struct device *dev, unsigned int n) 344 328 { 345 329 snd_card_free(dev_get_drvdata(dev)); 346 dev_set_drvdata(dev, NULL);347 330 return 0; 348 331 } … … 351 334 .match = snd_gusextreme_match, 352 335 .probe = snd_gusextreme_probe, 353 .remove = __devexit_p(snd_gusextreme_remove),336 .remove = snd_gusextreme_remove, 354 337 #if 0 /* FIXME */ 355 338 .suspend = snd_gusextreme_suspend, … … 361 344 }; 362 345 363 static int __init alsa_card_gusextreme_init(void) 364 { 365 return isa_register_driver(&snd_gusextreme_driver, SNDRV_CARDS); 366 } 367 368 static void __exit alsa_card_gusextreme_exit(void) 369 { 370 isa_unregister_driver(&snd_gusextreme_driver); 371 } 372 373 module_init(alsa_card_gusextreme_init); 374 module_exit(alsa_card_gusextreme_exit); 346 module_isa_driver(snd_gusextreme_driver, SNDRV_CARDS);
Note:
See TracChangeset
for help on using the changeset viewer.