Changeset 679 for GPL/trunk/alsa-kernel/isa/gus/gusmax.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/gusmax.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * Driver for Gravis UltraSound MAX soundcard 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> … … 41 26 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 42 27 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 43 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */28 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 44 29 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ 45 30 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */ … … 57 42 module_param_array(enable, bool, NULL, 0444); 58 43 MODULE_PARM_DESC(enable, "Enable GUS MAX soundcard."); 59 module_param_ array(port, long, NULL, 0444);44 module_param_hw_array(port, long, ioport, NULL, 0444); 60 45 MODULE_PARM_DESC(port, "Port # for GUS MAX driver."); 61 module_param_ array(irq, int, NULL, 0444);46 module_param_hw_array(irq, int, irq, NULL, 0444); 62 47 MODULE_PARM_DESC(irq, "IRQ # for GUS MAX driver."); 63 module_param_ array(dma1, int, NULL, 0444);48 module_param_hw_array(dma1, int, dma, NULL, 0444); 64 49 MODULE_PARM_DESC(dma1, "DMA1 # for GUS MAX driver."); 65 module_param_ array(dma2, int, NULL, 0444);50 module_param_hw_array(dma2, int, dma, NULL, 0444); 66 51 MODULE_PARM_DESC(dma2, "DMA2 # for GUS MAX driver."); 67 52 module_param_array(joystick_dac, int, NULL, 0444); … … 83 68 #define PFX "gusmax: " 84 69 85 static int __devinit snd_gusmax_detect(struct snd_gus_card *gus)70 static int snd_gusmax_detect(struct snd_gus_card *gus) 86 71 { 87 72 unsigned char d; … … 125 110 } 126 111 127 static void __devinitsnd_gusmax_init(int dev, struct snd_card *card,128 struct snd_gus_card *gus)112 static void snd_gusmax_init(int dev, struct snd_card *card, 113 struct snd_gus_card *gus) 129 114 { 130 115 gus->equal_irq = 1; … … 141 126 } 142 127 143 static int __devinitsnd_gusmax_mixer(struct snd_wss *chip)128 static int snd_gusmax_mixer(struct snd_wss *chip) 144 129 { 145 130 struct snd_card *card = chip->card; … … 200 185 } 201 186 202 static int __devinitsnd_gusmax_match(struct device *pdev, unsigned int dev)187 static int snd_gusmax_match(struct device *pdev, unsigned int dev) 203 188 { 204 189 return enable[dev]; 205 190 } 206 191 207 static int __devinitsnd_gusmax_probe(struct device *pdev, unsigned int dev)208 { 209 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};210 static int possible_dmas[] = {5, 6, 7, 1, 3, -1};192 static int snd_gusmax_probe(struct device *pdev, unsigned int dev) 193 { 194 static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; 195 static const int possible_dmas[] = {5, 6, 7, 1, 3, -1}; 211 196 int xirq, xdma1, xdma2, err; 212 197 struct snd_card *card; … … 215 200 struct snd_gusmax *maxcard; 216 201 217 err = snd_card_ create(index[dev], id[dev], THIS_MODULE,218 202 err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, 203 sizeof(struct snd_gusmax), &card); 219 204 if (err < 0) 220 205 return err; … … 257 242 0, &gus); 258 243 } else { 259 static unsigned long possible_ports[] = {244 static const unsigned long possible_ports[] = { 260 245 0x220, 0x230, 0x240, 0x250, 0x260 261 246 }; … … 292 277 } 293 278 294 if (request_irq(xirq, snd_gusmax_interrupt, IRQF_DISABLED, "GUS MAX", (void *)maxcard)) {279 if (request_irq(xirq, snd_gusmax_interrupt, 0, "GUS MAX", (void *)maxcard)) { 295 280 snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq); 296 281 err = -EBUSY; … … 298 283 } 299 284 maxcard->irq = xirq; 300 285 card->sync_irq = maxcard->irq; 286 301 287 err = snd_wss_create(card, 302 288 gus->gf1.port + 0x10c, -1, xirq, … … 310 296 goto _err; 311 297 312 err = snd_wss_pcm(wss, 0 , NULL);298 err = snd_wss_pcm(wss, 0); 313 299 if (err < 0) 314 300 goto _err; … … 318 304 goto _err; 319 305 320 err = snd_wss_timer(wss, 2 , NULL);306 err = snd_wss_timer(wss, 2); 321 307 if (err < 0) 322 308 goto _err; 323 309 324 310 if (pcm_channels[dev] > 0) { 325 if ((err = snd_gf1_pcm_new(gus, 1, 1 , NULL)) < 0)311 if ((err = snd_gf1_pcm_new(gus, 1, 1)) < 0) 326 312 goto _err; 327 313 } … … 330 316 goto _err; 331 317 332 err = snd_gf1_rawmidi_new(gus, 0 , NULL);318 err = snd_gf1_rawmidi_new(gus, 0); 333 319 if (err < 0) 334 320 goto _err; … … 338 324 sprintf(card->longname + strlen(card->longname), "&%i", xdma2); 339 325 340 snd_card_set_dev(card, pdev);341 342 326 err = snd_card_register(card); 343 327 if (err < 0) … … 355 339 } 356 340 357 static int __devexitsnd_gusmax_remove(struct device *devptr, unsigned int dev)341 static int snd_gusmax_remove(struct device *devptr, unsigned int dev) 358 342 { 359 343 snd_card_free(dev_get_drvdata(devptr)); 360 dev_set_drvdata(devptr, NULL);361 344 return 0; 362 345 } … … 367 350 .match = snd_gusmax_match, 368 351 .probe = snd_gusmax_probe, 369 .remove = __devexit_p(snd_gusmax_remove),352 .remove = snd_gusmax_remove, 370 353 /* FIXME: suspend/resume */ 371 354 .driver = { … … 374 357 }; 375 358 376 static int __init alsa_card_gusmax_init(void) 377 { 378 return isa_register_driver(&snd_gusmax_driver, SNDRV_CARDS); 379 } 380 381 static void __exit alsa_card_gusmax_exit(void) 382 { 383 isa_unregister_driver(&snd_gusmax_driver); 384 } 385 386 module_init(alsa_card_gusmax_init) 387 module_exit(alsa_card_gusmax_exit) 359 module_isa_driver(snd_gusmax_driver, SNDRV_CARDS);
Note:
See TracChangeset
for help on using the changeset viewer.