Changeset 679 for GPL/trunk/alsa-kernel/isa/wavefront/wavefront.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/wavefront/wavefront.c
r598 r679 1 // SPDX-License-Identifier: GPL-2.0-or-later 1 2 /* 2 3 * ALSA card-level driver for Turtle Beach Wavefront cards … … 4 5 * 5 6 * Copyright (c) 1997-1999 by Paul Barton-Davis <pbd@op.net> 6 *7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License as published by9 * the Free Software Foundation; either version 2 of the License, or10 * (at your option) any later version.11 *12 * This program is distributed in the hope that it will be useful,13 * but WITHOUT ANY WARRANTY; without even the implied warranty of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 * GNU General Public License for more details.16 *17 * You should have received a copy of the GNU General Public License18 * along with this program; if not, write to the Free Software19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 7 */ 21 8 … … 25 12 #include <linux/isa.h> 26 13 #include <linux/pnp.h> 27 #include <linux/module param.h>14 #include <linux/module.h> 28 15 #include <sound/core.h> 29 16 #include <sound/initval.h> … … 39 26 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 40 27 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 41 static intenable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */28 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 42 29 #ifdef CONFIG_PNP 43 static intisapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};30 static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 44 31 #endif 45 32 static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ … … 52 39 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ 53 40 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ 54 static intuse_cs4232_midi[SNDRV_CARDS];41 static bool use_cs4232_midi[SNDRV_CARDS]; 55 42 56 43 module_param_array(index, int, NULL, 0444); … … 64 51 MODULE_PARM_DESC(isapnp, "ISA PnP detection for WaveFront soundcards."); 65 52 #endif 66 module_param_ array(cs4232_pcm_port, long, NULL, 0444);53 module_param_hw_array(cs4232_pcm_port, long, ioport, NULL, 0444); 67 54 MODULE_PARM_DESC(cs4232_pcm_port, "Port # for CS4232 PCM interface."); 68 module_param_ array(cs4232_pcm_irq, int, NULL, 0444);55 module_param_hw_array(cs4232_pcm_irq, int, irq, NULL, 0444); 69 56 MODULE_PARM_DESC(cs4232_pcm_irq, "IRQ # for CS4232 PCM interface."); 70 module_param_ array(dma1, int, NULL, 0444);57 module_param_hw_array(dma1, int, dma, NULL, 0444); 71 58 MODULE_PARM_DESC(dma1, "DMA1 # for CS4232 PCM interface."); 72 module_param_ array(dma2, int, NULL, 0444);59 module_param_hw_array(dma2, int, dma, NULL, 0444); 73 60 MODULE_PARM_DESC(dma2, "DMA2 # for CS4232 PCM interface."); 74 module_param_ array(cs4232_mpu_port, long, NULL, 0444);61 module_param_hw_array(cs4232_mpu_port, long, ioport, NULL, 0444); 75 62 MODULE_PARM_DESC(cs4232_mpu_port, "port # for CS4232 MPU-401 interface."); 76 module_param_ array(cs4232_mpu_irq, int, NULL, 0444);63 module_param_hw_array(cs4232_mpu_irq, int, irq, NULL, 0444); 77 64 MODULE_PARM_DESC(cs4232_mpu_irq, "IRQ # for CS4232 MPU-401 interface."); 78 module_param_ array(ics2115_irq, int, NULL, 0444);65 module_param_hw_array(ics2115_irq, int, irq, NULL, 0444); 79 66 MODULE_PARM_DESC(ics2115_irq, "IRQ # for ICS2115."); 80 module_param_ array(ics2115_port, long, NULL, 0444);67 module_param_hw_array(ics2115_port, long, ioport, NULL, 0444); 81 68 MODULE_PARM_DESC(ics2115_port, "Port # for ICS2115."); 82 module_param_ array(fm_port, long, NULL, 0444);69 module_param_hw_array(fm_port, long, ioport, NULL, 0444); 83 70 MODULE_PARM_DESC(fm_port, "FM port #."); 84 71 module_param_array(use_cs4232_midi, bool, NULL, 0444); … … 89 76 static int pnp_registered; 90 77 91 static struct pnp_card_device_id snd_wavefront_pnpids[] = {78 static const struct pnp_card_device_id snd_wavefront_pnpids[] = { 92 79 /* Tropez */ 93 80 { .id = "CSC7532", .devs = { { "CSC0000" }, { "CSC0010" }, { "PnPb006" }, { "CSC0004" } } }, … … 99 86 MODULE_DEVICE_TABLE(pnp_card, snd_wavefront_pnpids); 100 87 101 static int __devinit88 static int 102 89 snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *card, 103 90 const struct pnp_card_device_id *id) … … 232 219 } 233 220 234 static struct snd_hwdep * __devinit 235 snd_wavefront_new_synth (struct snd_card *card, 236 int hw_dev, 237 snd_wavefront_card_t *acard) 221 static struct snd_hwdep *snd_wavefront_new_synth(struct snd_card *card, 222 int hw_dev, 223 snd_wavefront_card_t *acard) 238 224 { 239 225 struct snd_hwdep *wavefront_synth; … … 258 244 } 259 245 260 static struct snd_hwdep * __devinit 261 snd_wavefront_new_fx (struct snd_card *card, 262 int hw_dev, 263 snd_wavefront_card_t *acard, 264 unsigned long port) 246 static struct snd_hwdep *snd_wavefront_new_fx(struct snd_card *card, 247 int hw_dev, 248 snd_wavefront_card_t *acard, 249 unsigned long port) 265 250 266 251 { … … 285 270 static snd_wavefront_mpu_id external_id = external_mpu; 286 271 287 static struct snd_rawmidi *__devinit 288 snd_wavefront_new_midi (struct snd_card *card, 289 int midi_dev, 290 snd_wavefront_card_t *acard, 291 unsigned long port, 292 snd_wavefront_mpu_id mpu) 272 static struct snd_rawmidi *snd_wavefront_new_midi(struct snd_card *card, 273 int midi_dev, 274 snd_wavefront_card_t *acard, 275 unsigned long port, 276 snd_wavefront_mpu_id mpu) 293 277 294 278 { … … 338 322 } 339 323 340 static int snd_wavefront_card_new(int dev, struct snd_card **cardp) 324 static int snd_wavefront_card_new(struct device *pdev, int dev, 325 struct snd_card **cardp) 341 326 { 342 327 struct snd_card *card; … … 344 329 int err; 345 330 346 err = snd_card_ create(index[dev], id[dev], THIS_MODULE,347 331 err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, 332 sizeof(snd_wavefront_card_t), &card); 348 333 if (err < 0) 349 334 return err; … … 362 347 } 363 348 364 static int __devinit349 static int 365 350 snd_wavefront_probe (struct snd_card *card, int dev) 366 351 { … … 383 368 } 384 369 385 err = snd_wss_pcm(chip, 0 , NULL);370 err = snd_wss_pcm(chip, 0); 386 371 if (err < 0) 387 372 return err; 388 373 389 err = snd_wss_timer(chip, 0 , NULL);374 err = snd_wss_timer(chip, 0); 390 375 if (err < 0) 391 376 return err; … … 419 404 } 420 405 if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt, 421 IRQF_DISABLED, "ICS2115", acard)) {406 0, "ICS2115", acard)) { 422 407 snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]); 423 408 return -EBUSY; … … 425 410 426 411 acard->wavefront.irq = ics2115_irq[dev]; 412 card->sync_irq = acard->wavefront.irq; 427 413 acard->wavefront.base = ics2115_port[dev]; 428 414 … … 450 436 err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232, 451 437 cs4232_mpu_port[dev], 0, 452 cs4232_mpu_irq[dev], IRQF_DISABLED, 453 NULL); 438 cs4232_mpu_irq[dev], NULL); 454 439 if (err < 0) { 455 440 snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n"); … … 543 528 } 544 529 545 static int __devinitsnd_wavefront_isa_match(struct device *pdev,546 530 static int snd_wavefront_isa_match(struct device *pdev, 531 unsigned int dev) 547 532 { 548 533 if (!enable[dev]) … … 563 548 } 564 549 565 static int __devinitsnd_wavefront_isa_probe(struct device *pdev,566 550 static int snd_wavefront_isa_probe(struct device *pdev, 551 unsigned int dev) 567 552 { 568 553 struct snd_card *card; 569 554 int err; 570 555 571 err = snd_wavefront_card_new( dev, &card);556 err = snd_wavefront_card_new(pdev, dev, &card); 572 557 if (err < 0) 573 558 return err; 574 snd_card_set_dev(card, pdev);575 559 if ((err = snd_wavefront_probe(card, dev)) < 0) { 576 560 snd_card_free(card); … … 582 566 } 583 567 584 static int __devexitsnd_wavefront_isa_remove(struct device *devptr,585 568 static int snd_wavefront_isa_remove(struct device *devptr, 569 unsigned int dev) 586 570 { 587 571 snd_card_free(dev_get_drvdata(devptr)); 588 dev_set_drvdata(devptr, NULL);589 572 return 0; 590 573 } … … 595 578 .match = snd_wavefront_isa_match, 596 579 .probe = snd_wavefront_isa_probe, 597 .remove = __devexit_p(snd_wavefront_isa_remove),580 .remove = snd_wavefront_isa_remove, 598 581 /* FIXME: suspend, resume */ 599 582 .driver = { … … 604 587 605 588 #ifdef CONFIG_PNP 606 static int __devinitsnd_wavefront_pnp_detect(struct pnp_card_link *pcard,607 589 static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard, 590 const struct pnp_card_device_id *pid) 608 591 { 609 592 static int dev; … … 618 601 return -ENODEV; 619 602 620 res = snd_wavefront_card_new( dev, &card);603 res = snd_wavefront_card_new(&pcard->card->dev, dev, &card); 621 604 if (res < 0) 622 605 return res; … … 629 612 } 630 613 } 631 snd_card_set_dev(card, &pcard->card->dev);632 614 633 615 if ((res = snd_wavefront_probe(card, dev)) < 0) … … 639 621 } 640 622 641 static void __devexit snd_wavefront_pnp_remove(struct pnp_card_link *pcard)623 static void snd_wavefront_pnp_remove(struct pnp_card_link *pcard) 642 624 { 643 625 snd_card_free(pnp_get_card_drvdata(pcard)); … … 650 632 .id_table = snd_wavefront_pnpids, 651 633 .probe = snd_wavefront_pnp_detect, 652 .remove = __devexit_p(snd_wavefront_pnp_remove),634 .remove = snd_wavefront_pnp_remove, 653 635 /* FIXME: suspend,resume */ 654 636 };
Note:
See TracChangeset
for help on using the changeset viewer.