Changeset 426 for GPL/trunk/alsa-kernel/isa
- Timestamp:
- May 9, 2009, 11:45:26 AM (16 years ago)
- Location:
- GPL/trunk/alsa-kernel/isa
- Files:
-
- 19 edited
-
ad1816a/ad1816a.c (modified) (3 diffs)
-
ad1816a/ad1816a_lib.c (modified) (7 diffs)
-
cmi8330.c (modified) (13 diffs)
-
cs423x/cs4236.c (modified) (18 diffs)
-
cs423x/cs4236_lib.c (modified) (8 diffs)
-
es1688/es1688.c (modified) (3 diffs)
-
es1688/es1688_lib.c (modified) (7 diffs)
-
gus/gus_dma.c (modified) (4 diffs)
-
gus/gus_irq.c (modified) (2 diffs)
-
gus/gus_pcm.c (modified) (5 diffs)
-
gus/gus_uart.c (modified) (1 diff)
-
gus/interwave.c (modified) (6 diffs)
-
opl3sa2.c (modified) (7 diffs)
-
opti9xx/opti92x-ad1848.c (modified) (14 diffs)
-
sb/sb16_csp.c (modified) (1 diff)
-
sb/sb_mixer.c (modified) (11 diffs)
-
wavefront/wavefront.c (modified) (1 diff)
-
wavefront/wavefront_fx.c (modified) (5 diffs)
-
wavefront/wavefront_synth.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/isa/ad1816a/ad1816a.c
r410 r426 157 157 struct snd_ad1816a *chip; 158 158 struct snd_opl3 *opl3; 159 struct snd_timer *timer; 159 160 160 161 error = snd_card_create(index[dev], id[dev], THIS_MODULE, … … 192 193 193 194 if ((error = snd_ad1816a_mixer(chip)) < 0) { 195 snd_card_free(card); 196 return error; 197 } 198 199 error = snd_ad1816a_timer(chip, 0, &timer); 200 if (error < 0) { 194 201 snd_card_free(card); 195 202 return error; … … 209 216 printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2); 210 217 } else { 211 if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) { 212 snd_card_free(card); 213 return error; 214 } 215 if ((error = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) { 218 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 219 if (error < 0) { 216 220 snd_card_free(card); 217 221 return error; -
GPL/trunk/alsa-kernel/isa/ad1816a/ad1816a_lib.c
r399 r426 38 38 return 0; 39 39 40 snd_printk( "chip busy.\n");40 snd_printk(KERN_WARNING "chip busy.\n"); 41 41 return -EBUSY; 42 42 } … … 197 197 break; 198 198 default: 199 snd_printk( "invalid trigger mode 0x%x.\n", what);199 snd_printk(KERN_WARNING "invalid trigger mode 0x%x.\n", what); 200 200 error = -EINVAL; 201 201 } … … 378 378 }; 379 379 380 #if 0 /* not used now */381 380 static int snd_ad1816a_timer_close(struct snd_timer *timer) 382 381 { … … 443 442 .stop = snd_ad1816a_timer_stop, 444 443 }; 445 #endif /* not used now */446 447 444 448 445 static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream) … … 569 566 case AD1816A_HW_AD18MAX10: return "AD18max10"; 570 567 default: 571 snd_printk( "Unknown chip version %d:%d.\n",568 snd_printk(KERN_WARNING "Unknown chip version %d:%d.\n", 572 569 chip->version, chip->hardware); 573 570 return "AD1816A - unknown"; … … 688 685 } 689 686 690 #if 0 /* not used now */691 687 int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer) 692 688 { … … 710 706 return 0; 711 707 } 712 #endif /* not used now */713 708 714 709 /* -
GPL/trunk/alsa-kernel/isa/cmi8330.c
r410 r426 32 32 * 33 33 * modprobe -a snd-cmi8330 sbport=0x220 sbirq=5 sbdma8=1 34 * sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 34 * sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 fmport=0x388 35 35 * 36 36 * This card has two mixers and two PCM devices. I've cheesed it such 37 37 * that recording and playback can be done through the same device. 38 * The driver "magically" routes the capturing to the AD1848codec,38 * The driver "magically" routes the capturing to the CMI8330 codec, 39 39 * and playback to the SB16 codec. This allows for full-duplex mode 40 40 * to some extent. … … 52 52 #include <sound/core.h> 53 53 #include <sound/wss.h> 54 #include <sound/opl3.h> 55 #include <sound/mpu401.h> 54 56 #include <sound/sb.h> 55 57 #include <sound/initval.h> … … 80 82 static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 81 83 static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; 84 static long fmport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 85 static long mpuport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 86 static int mpuirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 82 87 83 88 module_param_array(index, int, NULL, 0444); … … 108 113 MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); 109 114 115 module_param_array(fmport, long, NULL, 0444); 116 MODULE_PARM_DESC(fmport, "FM port # for CMI8330 driver."); 117 module_param_array(mpuport, long, NULL, 0444); 118 MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8330 driver."); 119 module_param_array(mpuirq, int, NULL, 0444); 120 MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8330 MPU-401 port."); 110 121 #ifdef CONFIG_PNP 111 122 static int isa_registered; … … 150 161 struct pnp_dev *cap; 151 162 struct pnp_dev *play; 163 struct pnp_dev *mpu; 152 164 #endif 153 165 struct snd_card *card; … … 166 178 167 179 static struct pnp_card_device_id snd_cmi8330_pnpids[] = { 168 { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" } } },180 { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } }, 169 181 { .id = "" } 170 182 }; … … 220 232 WSS_SINGLE("PC Speaker Playback Volume", 0, 221 233 CMI8330_OUTPUTVOL, 3, 3, 0), 222 WSS_SINGLE("FM Playback Switch", 0, 223 CMI8330_RECMUX, 3, 1, 1), 234 WSS_DOUBLE("FM Playback Switch", 0, 235 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1), 236 WSS_DOUBLE("FM Playback Volume", 0, 237 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1), 224 238 WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0, 225 239 CMI8330_RMUX3D, 7, 1, 1), … … 324 338 return -EBUSY; 325 339 340 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL); 341 if (acard->play == NULL) 342 return -EBUSY; 343 326 344 pdev = acard->cap; 327 345 328 346 err = pnp_activate_dev(pdev); 329 347 if (err < 0) { 330 snd_printk(KERN_ERR "CMI8330/C3D (AD1848)PnP configure failure\n");348 snd_printk(KERN_ERR "CMI8330/C3D PnP configure failure\n"); 331 349 return -EBUSY; 332 350 } … … 334 352 wssdma[dev] = pnp_dma(pdev, 0); 335 353 wssirq[dev] = pnp_irq(pdev, 0); 354 fmport[dev] = pnp_port_start(pdev, 1); 336 355 337 356 /* allocate SB16 resources */ … … 348 367 sbirq[dev] = pnp_irq(pdev, 0); 349 368 369 /* allocate MPU-401 resources */ 370 pdev = acard->mpu; 371 372 err = pnp_activate_dev(pdev); 373 if (err < 0) { 374 snd_printk(KERN_ERR 375 "CMI8330/C3D (MPU-401) PnP configure failure\n"); 376 return -EBUSY; 377 } 378 mpuport[dev] = pnp_port_start(pdev, 0); 379 mpuirq[dev] = pnp_irq(pdev, 0); 350 380 return 0; 351 381 } … … 490 520 struct snd_cmi8330 *acard; 491 521 int i, err; 522 struct snd_opl3 *opl3; 492 523 493 524 acard = card->private_data; … … 497 528 WSS_HW_DETECT, 0, &acard->wss); 498 529 if (err < 0) { 499 snd_printk(KERN_ERR PFX "( AD1848) device busy??\n");530 snd_printk(KERN_ERR PFX "(CMI8330) device busy??\n"); 500 531 return err; 501 532 } 502 533 if (acard->wss->hardware != WSS_HW_CMI8330) { 503 snd_printk(KERN_ERR PFX "( AD1848) not found during probe\n");534 snd_printk(KERN_ERR PFX "(CMI8330) not found during probe\n"); 504 535 return -ENODEV; 505 536 } … … 532 563 snd_printk(KERN_ERR PFX "failed to create pcms\n"); 533 564 return err; 565 } 566 if (fmport[dev] != SNDRV_AUTO_PORT) { 567 if (snd_opl3_create(card, 568 fmport[dev], fmport[dev] + 2, 569 OPL3_HW_AUTO, 0, &opl3) < 0) { 570 snd_printk(KERN_ERR PFX 571 "no OPL device at 0x%lx-0x%lx ?\n", 572 fmport[dev], fmport[dev] + 2); 573 } else { 574 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 575 if (err < 0) 576 return err; 577 } 578 } 579 580 if (mpuport[dev] != SNDRV_AUTO_PORT) { 581 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 582 mpuport[dev], 0, mpuirq[dev], 583 IRQF_DISABLED, NULL) < 0) 584 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n", 585 mpuport[dev]); 534 586 } 535 587 -
GPL/trunk/alsa-kernel/isa/cs423x/cs4236.c
r410 r426 34 34 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); 35 35 MODULE_LICENSE("GPL"); 36 #ifdef CS4232 37 MODULE_DESCRIPTION("Cirrus Logic CS4232"); 36 MODULE_DESCRIPTION("Cirrus Logic CS4232-9"); 38 37 MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000}," 39 38 "{Turtle Beach,Tropez Plus}," … … 41 40 "{Hewlett Packard,Omnibook 5500}," 42 41 "{TerraTec,Maestro 32/96}," 43 "{Philips,PCA70PS}}"); 44 #else 45 MODULE_DESCRIPTION("Cirrus Logic CS4235-9"); 46 MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235}," 42 "{Philips,PCA70PS}}," 43 "{{Crystal Semiconductors,CS4235}," 47 44 "{Crystal Semiconductors,CS4236}," 48 45 "{Crystal Semiconductors,CS4237}," … … 71 68 "{Turtle Beach,Malibu}," 72 69 "{Unknown,Digital PC 5000 Onboard}}"); 73 #endif 74 75 #ifdef CS4232 76 #define IDENT "CS4232" 77 #define DEV_NAME "cs4232" 78 #else 79 #define IDENT "CS4236+" 80 #define DEV_NAME "cs4236" 81 #endif 70 71 MODULE_ALIAS("snd_cs4232"); 72 73 #define IDENT "CS4232+" 74 #define DEV_NAME "cs4232+" 82 75 83 76 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ … … 129 122 static int isa_registered; 130 123 static int pnpc_registered; 131 #ifdef CS4232132 124 static int pnp_registered; 133 #endif134 125 #endif /* CONFIG_PNP */ 135 126 … … 146 137 #ifdef CONFIG_PNP 147 138 148 #ifdef CS4232149 139 /* 150 140 * PNP BIOS 151 141 */ 152 static const struct pnp_device_id snd_cs423 2_pnpbiosids[] = {142 static const struct pnp_device_id snd_cs423x_pnpbiosids[] = { 153 143 { .id = "CSC0100" }, 154 144 { .id = "CSC0000" }, … … 158 148 { .id = "" } 159 149 }; 160 MODULE_DEVICE_TABLE(pnp, snd_cs4232_pnpbiosids); 161 #endif /* CS4232 */ 162 163 #ifdef CS4232 150 MODULE_DEVICE_TABLE(pnp, snd_cs423x_pnpbiosids); 151 164 152 #define CS423X_ISAPNP_DRIVER "cs4232_isapnp" 165 153 static struct pnp_card_device_id snd_cs423x_pnpids[] = { … … 180 168 /* Netfinity 3000 on-board soundcard */ 181 169 { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } }, 182 /* --- */183 { .id = "" } /* end */184 };185 #else /* CS4236 */186 #define CS423X_ISAPNP_DRIVER "cs4236_isapnp"187 static struct pnp_card_device_id snd_cs423x_pnpids[] = {188 170 /* Intel Marlin Spike Motherboard - CS4235 */ 189 171 { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, … … 267 249 { .id = "" } /* end */ 268 250 }; 269 #endif270 251 271 252 MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids); … … 324 305 } 325 306 326 #ifdef CS4232 327 static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard,328 struct pnp_dev * pdev)307 static int __devinit snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard, 308 struct pnp_dev *pdev, 309 struct pnp_dev *cdev) 329 310 { 330 311 acard->wss = pdev; 331 312 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) 332 313 return -EBUSY; 333 cport[dev] = -1; 334 return 0; 335 } 336 #endif 314 if (cdev) 315 cport[dev] = pnp_port_start(cdev, 0); 316 else 317 cport[dev] = -1; 318 return 0; 319 } 337 320 338 321 static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, … … 412 395 } 413 396 414 #ifdef CS4232415 397 err = snd_wss_create(card, port[dev], cport[dev], 416 398 irq[dev], 417 399 dma1[dev], dma2[dev], 418 WSS_HW_DETECT , 0, &chip);400 WSS_HW_DETECT3, 0, &chip); 419 401 if (err < 0) 420 402 return err; 421 acard->chip = chip;422 423 err = snd_wss_pcm(chip, 0, &pcm);424 if (err < 0)425 return err;426 427 err = snd_wss_mixer(chip);428 if (err < 0)429 return err;430 431 #else /* CS4236 */ 432 err = snd_cs4236_create(card,433 port[dev], cport[dev],434 irq[dev], dma1[dev], dma2[dev], 435 WSS_HW_DETECT, 0, &chip);436 if (err < 0)437 return err;438 acard->chip = chip;439 440 err = snd_cs4236_pcm(chip, 0, &pcm);441 if (err < 0)442 return err;443 444 err = snd_cs4236_mixer(chip);445 if (err < 0)446 return err;447 #endif 403 if (chip->hardware & WSS_HW_CS4236B_MASK) { 404 snd_wss_free(chip); 405 err = snd_cs4236_create(card, 406 port[dev], cport[dev], 407 irq[dev], dma1[dev], dma2[dev], 408 WSS_HW_DETECT, 0, &chip); 409 if (err < 0) 410 return err; 411 acard->chip = chip; 412 413 err = snd_cs4236_pcm(chip, 0, &pcm); 414 if (err < 0) 415 return err; 416 417 err = snd_cs4236_mixer(chip); 418 if (err < 0) 419 return err; 420 } else { 421 acard->chip = chip; 422 err = snd_wss_pcm(chip, 0, &pcm); 423 if (err < 0) 424 return err; 425 426 err = snd_wss_mixer(chip); 427 if (err < 0) 428 return err; 429 } 448 430 strcpy(card->driver, pcm->name); 449 431 strcpy(card->shortname, pcm->name); … … 580 562 581 563 #ifdef CONFIG_PNP 582 #ifdef CS4232 583 static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, 564 static int __devinit snd_cs423x_pnpbios_detect(struct pnp_dev *pdev, 584 565 const struct pnp_device_id *id) 585 566 { … … 587 568 int err; 588 569 struct snd_card *card; 570 struct pnp_dev *cdev; 571 char cid[PNP_ID_LEN]; 589 572 590 573 if (pnp_device_is_isapnp(pdev)) … … 597 580 return -ENODEV; 598 581 582 /* prepare second id */ 583 strcpy(cid, pdev->id[0].id); 584 cid[5] = '1'; 585 cdev = NULL; 586 list_for_each_entry(cdev, &(pdev->protocol->devices), protocol_list) { 587 if (!strcmp(cdev->id[0].id, cid)) 588 break; 589 } 599 590 err = snd_cs423x_card_new(dev, &card); 600 591 if (err < 0) 601 592 return err; 602 if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { 593 err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev); 594 if (err < 0) { 603 595 printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); 604 596 snd_card_free(card); … … 615 607 } 616 608 617 static void __devexit snd_cs423 2_pnp_remove(struct pnp_dev *pdev)609 static void __devexit snd_cs423x_pnp_remove(struct pnp_dev *pdev) 618 610 { 619 611 snd_card_free(pnp_get_drvdata(pdev)); … … 622 614 623 615 #ifdef CONFIG_PM 624 static int snd_cs423 2_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)616 static int snd_cs423x_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) 625 617 { 626 618 return snd_cs423x_suspend(pnp_get_drvdata(pdev)); 627 619 } 628 620 629 static int snd_cs423 2_pnp_resume(struct pnp_dev *pdev)621 static int snd_cs423x_pnp_resume(struct pnp_dev *pdev) 630 622 { 631 623 return snd_cs423x_resume(pnp_get_drvdata(pdev)); … … 633 625 #endif 634 626 635 static struct pnp_driver cs423 2_pnp_driver = {636 .name = "cs423 2-pnpbios",637 .id_table = snd_cs423 2_pnpbiosids,638 .probe = snd_cs423 2_pnpbios_detect,639 .remove = __devexit_p(snd_cs423 2_pnp_remove),627 static struct pnp_driver cs423x_pnp_driver = { 628 .name = "cs423x-pnpbios", 629 .id_table = snd_cs423x_pnpbiosids, 630 .probe = snd_cs423x_pnpbios_detect, 631 .remove = __devexit_p(snd_cs423x_pnp_remove), 640 632 #ifdef CONFIG_PM 641 .suspend = snd_cs423 2_pnp_suspend,642 .resume = snd_cs423 2_pnp_resume,633 .suspend = snd_cs423x_pnp_suspend, 634 .resume = snd_cs423x_pnp_resume, 643 635 #endif 644 636 }; 645 #endif /* CS4232 */646 637 647 638 static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, … … 717 708 if (!err) 718 709 isa_registered = 1; 719 #ifdef CS4232 720 err = pnp_register_driver(&cs4232_pnp_driver); 710 err = pnp_register_driver(&cs423x_pnp_driver); 721 711 if (!err) 722 712 pnp_registered = 1; 723 #endif724 713 err = pnp_register_card_driver(&cs423x_pnpc_driver); 725 714 if (!err) 726 715 pnpc_registered = 1; 727 #ifdef CS4232728 716 if (pnp_registered) 729 717 err = 0; 730 #endif731 718 if (isa_registered) 732 719 err = 0; … … 740 727 if (pnpc_registered) 741 728 pnp_unregister_card_driver(&cs423x_pnpc_driver); 742 #ifdef CS4232743 729 if (pnp_registered) 744 pnp_unregister_driver(&cs4232_pnp_driver); 745 #endif 730 pnp_unregister_driver(&cs423x_pnp_driver); 746 731 if (isa_registered) 747 732 #endif -
GPL/trunk/alsa-kernel/isa/cs423x/cs4236_lib.c
r399 r426 88 88 #include <sound/wss.h> 89 89 #include <sound/asoundef.h> 90 91 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");92 MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips");93 MODULE_LICENSE("GPL");94 90 95 91 /* … … 287 283 hardware = WSS_HW_DETECT3; 288 284 if (cport < 0x100) { 289 snd_printk("please, specify control port for CS4236+ chips\n"); 285 snd_printk(KERN_ERR "please, specify control port " 286 "for CS4236+ chips\n"); 290 287 return -ENODEV; 291 288 } … … 296 293 297 294 if (!(chip->hardware & WSS_HW_CS4236B_MASK)) { 298 snd_printk("CS4236+: MODE3 and extended registers not available, hardware=0x%x\n",chip->hardware); 295 snd_printk(KERN_ERR "CS4236+: MODE3 and extended registers " 296 "not available, hardware=0x%x\n", chip->hardware); 299 297 snd_device_free(card, chip); 300 298 return -ENODEV; … … 304 302 int idx; 305 303 for (idx = 0; idx < 8; idx++) 306 snd_printk("CD%i = 0x%x\n", idx, inb(chip->cport + idx)); 304 snd_printk(KERN_DEBUG "CD%i = 0x%x\n", 305 idx, inb(chip->cport + idx)); 307 306 for (idx = 0; idx < 9; idx++) 308 snd_printk("C%i = 0x%x\n", idx, snd_cs4236_ctrl_in(chip, idx)); 307 snd_printk(KERN_DEBUG "C%i = 0x%x\n", 308 idx, snd_cs4236_ctrl_in(chip, idx)); 309 309 } 310 310 #endif … … 313 313 snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2); 314 314 if (ver1 != ver2) { 315 snd_printk("CS4236+ chip detected, but control port 0x%lx is not valid\n", cport); 315 snd_printk(KERN_ERR "CS4236+ chip detected, but " 316 "control port 0x%lx is not valid\n", cport); 316 317 snd_device_free(card, chip); 317 318 return -ENODEV; … … 884 885 ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0; 885 886 #if 0 886 printk("get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 887 printk(KERN_DEBUG "get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, " 888 "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 887 889 snd_wss_in(chip, CS4231_ALT_FEATURE_1), 888 890 snd_cs4236_ctrl_in(chip, 3), … … 921 923 922 924 #if 0 923 printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 925 printk(KERN_DEBUG "set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, " 926 "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 924 927 snd_wss_in(chip, CS4231_ALT_FEATURE_1), 925 928 snd_cs4236_ctrl_in(chip, 3), … … 1016 1019 return 0; 1017 1020 } 1018 1019 EXPORT_SYMBOL(snd_cs4236_create);1020 EXPORT_SYMBOL(snd_cs4236_pcm);1021 EXPORT_SYMBOL(snd_cs4236_mixer);1022 1023 /*1024 * INIT part1025 */1026 1027 static int __init alsa_cs4236_init(void)1028 {1029 return 0;1030 }1031 1032 static void __exit alsa_cs4236_exit(void)1033 {1034 }1035 1036 module_init(alsa_cs4236_init)1037 module_exit(alsa_cs4236_exit) -
GPL/trunk/alsa-kernel/isa/es1688/es1688.c
r410 r426 50 50 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 51 51 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 52 static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */ 52 53 static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 53 54 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ … … 66 67 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); 67 68 module_param_array(irq, int, NULL, 0444); 69 module_param_array(fm_port, long, NULL, 0444); 70 MODULE_PARM_DESC(fm_port, "FM port # for ES1688 driver."); 68 71 MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); 69 72 module_param_array(mpu_irq, int, NULL, 0444); … … 144 147 chip->port, chip->irq, chip->dma8); 145 148 146 if (snd_opl3_create(card, chip->port, chip->port + 2, 147 OPL3_HW_OPL3, 0, &opl3) < 0) 148 dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port); 149 else { 150 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 151 if (error < 0) 152 goto out; 149 if (fm_port[n] == SNDRV_AUTO_PORT) 150 fm_port[n] = port[n]; /* share the same port */ 151 152 if (fm_port[n] > 0) { 153 if (snd_opl3_create(card, fm_port[n], fm_port[n] + 2, 154 OPL3_HW_OPL3, 0, &opl3) < 0) 155 dev_warn(dev, 156 "opl3 not detected at 0x%lx\n", fm_port[n]); 157 else { 158 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 159 if (error < 0) 160 goto out; 161 } 153 162 } 154 163 -
GPL/trunk/alsa-kernel/isa/es1688/es1688_lib.c
r399 r426 46 46 } 47 47 #ifdef CONFIG_SND_DEBUG 48 printk( "snd_es1688_dsp_command: timeout (0x%x)\n", val);48 printk(KERN_DEBUG "snd_es1688_dsp_command: timeout (0x%x)\n", val); 49 49 #endif 50 50 return 0; … … 168 168 switch (chip->version & 0xfff0) { 169 169 case 0x4880: 170 snd_printk("[0x%lx] ESS: AudioDrive ES488 detected, but driver is in another place\n", chip->port); 170 snd_printk(KERN_ERR "[0x%lx] ESS: AudioDrive ES488 detected, " 171 "but driver is in another place\n", chip->port); 171 172 return -ENODEV; 172 173 case 0x6880: … … 174 175 break; 175 176 default: 176 snd_printk("[0x%lx] ESS: unknown AudioDrive chip with version 0x%x (Jazz16 soundcard?)\n", chip->port, chip->version); 177 snd_printk(KERN_ERR "[0x%lx] ESS: unknown AudioDrive chip " 178 "with version 0x%x (Jazz16 soundcard?)\n", 179 chip->port, chip->version); 177 180 return -ENODEV; 178 181 } … … 224 227 } 225 228 #if 0 226 snd_printk( "mpu cfg = 0x%x\n", cfg);229 snd_printk(KERN_DEBUG "mpu cfg = 0x%x\n", cfg); 227 230 #endif 228 231 spin_lock_irqsave(&chip->reg_lock, flags); … … 238 241 irq_bits = irqs[chip->irq & 0x0f]; 239 242 if (irq_bits < 0) { 240 snd_printk("[0x%lx] ESS: bad IRQ %d for ES1688 chip!!\n", chip->port, chip->irq); 243 snd_printk(KERN_ERR "[0x%lx] ESS: bad IRQ %d " 244 "for ES1688 chip!!\n", 245 chip->port, chip->irq); 241 246 #if 0 242 247 irq_bits = 0; … … 251 256 dma = chip->dma8; 252 257 if (dma > 3 || dma == 2) { 253 snd_printk("[0x%lx] ESS: bad DMA channel %d for ES1688 chip!!\n", chip->port, dma); 258 snd_printk(KERN_ERR "[0x%lx] ESS: bad DMA channel %d " 259 "for ES1688 chip!!\n", chip->port, dma); 254 260 #if 0 255 261 dma_bits = 0; … … 342 348 } 343 349 #if 0 344 printk("trigger: val = 0x%x, value = 0x%x\n", val, value); 345 printk("trigger: pointer = 0x%x\n", snd_dma_pointer(chip->dma8, chip->dma_size)); 350 printk(KERN_DEBUG "trigger: val = 0x%x, value = 0x%x\n", val, value); 351 printk(KERN_DEBUG "trigger: pointer = 0x%x\n", 352 snd_dma_pointer(chip->dma8, chip->dma_size)); 346 353 #endif 347 354 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value); -
GPL/trunk/alsa-kernel/isa/gus/gus_dma.c
r305 r426 46 46 unsigned int address_high; 47 47 48 // snd_printk("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", addr, (long) buf, count); 48 snd_printdd("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", 49 addr, buf_addr, count); 49 50 50 51 if (gus->gf1.dma1 > 3) { … … 78 79 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE); 79 80 #if 0 80 snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd); 81 snd_printk(KERN_DEBUG "address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", 82 address << 1, count, dma_cmd); 81 83 #endif 82 84 spin_lock_irqsave(&gus->reg_lock, flags); … … 143 145 kfree(block); 144 146 #if 0 145 printk("program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", addr, (long) buffer, count, cmd); 147 snd_printd(KERN_DEBUG "program dma (IRQ) - " 148 "addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", 149 block->addr, block->buf_addr, block->count, block->cmd); 146 150 #endif 147 151 } … … 204 208 *block = *__block; 205 209 block->next = NULL; 206 #if 0 207 printk("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", block->addr, (long) block->buffer, block->count, block->cmd); 208 #endif 209 #if 0 210 printk("gus->gf1.dma_data_pcm_last = 0x%lx\n", (long)gus->gf1.dma_data_pcm_last); 211 printk("gus->gf1.dma_data_pcm = 0x%lx\n", (long)gus->gf1.dma_data_pcm); 212 #endif 210 211 snd_printdd("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", 212 block->addr, (long) block->buffer, block->count, 213 block->cmd); 214 215 snd_printdd("gus->gf1.dma_data_pcm_last = 0x%lx\n", 216 (long)gus->gf1.dma_data_pcm_last); 217 snd_printdd("gus->gf1.dma_data_pcm = 0x%lx\n", 218 (long)gus->gf1.dma_data_pcm); 219 213 220 spin_lock_irqsave(&gus->dma_lock, flags); 214 221 if (synth) { -
GPL/trunk/alsa-kernel/isa/gus/gus_irq.c
r305 r426 42 42 return IRQ_RETVAL(handled); 43 43 handled = 1; 44 / / snd_printk("IRQ: status = 0x%x\n", status);44 /* snd_printk(KERN_DEBUG "IRQ: status = 0x%x\n", status); */ 45 45 if (status & 0x02) { 46 46 STAT_ADD(gus->gf1.interrupt_stat_midi_in); … … 66 66 already |= _current_; /* mark request */ 67 67 #if 0 68 printk("voice = %i, voice_status = 0x%x, voice_verify = %i\n", voice, voice_status, inb(GUSP(gus, GF1PAGE))); 68 printk(KERN_DEBUG "voice = %i, voice_status = 0x%x, " 69 "voice_verify = %i\n", 70 voice, voice_status, inb(GUSP(gus, GF1PAGE))); 69 71 #endif 70 72 pvoice = &gus->gf1.voices[voice]; -
GPL/trunk/alsa-kernel/isa/gus/gus_pcm.c
r399 r426 83 83 count += offset & 31; 84 84 offset &= ~31; 85 // snd_printk("block change - offset = 0x%x, count = 0x%x\n", offset, count); 85 /* 86 snd_printk(KERN_DEBUG "block change - offset = 0x%x, count = 0x%x\n", 87 offset, count); 88 */ 86 89 memset(&block, 0, sizeof(block)); 87 90 block.cmd = SNDRV_GF1_DMA_IRQ; … … 136 139 end = curr + (pcmp->block_size / runtime->channels); 137 140 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1; 138 // snd_printk("init: curr=0x%x, begin=0x%x, end=0x%x, ctrl=0x%x, ramp=0x%x, rate=0x%x\n", curr, begin, end, voice_ctrl, ramp_ctrl, rate); 141 /* 142 snd_printk(KERN_DEBUG "init: curr=0x%x, begin=0x%x, end=0x%x, " 143 "ctrl=0x%x, ramp=0x%x, rate=0x%x\n", 144 curr, begin, end, voice_ctrl, ramp_ctrl, rate); 145 */ 139 146 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8; 140 147 vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; … … 206 213 #if 0 207 214 snd_gf1_select_voice(gus, pvoice->number); 208 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 215 printk(KERN_DEBUG "position = 0x%x\n", 216 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 209 217 snd_gf1_select_voice(gus, pcmp->pvoices[1]->number); 210 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 218 printk(KERN_DEBUG "position = 0x%x\n", 219 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 211 220 snd_gf1_select_voice(gus, pvoice->number); 212 221 #endif … … 300 309 unsigned long flags; 301 310 302 // printk("poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n", (int)buf, pos, count, gus->gf1.port); 311 /* 312 printk(KERN_DEBUG 313 "poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n", 314 (int)buf, pos, count, gus->gf1.port); 315 */ 303 316 while (count > 0) { 304 317 len = count; … … 681 694 682 695 #if 0 683 printk("playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer); 696 printk(KERN_DEBUG "playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", 697 (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer); 684 698 #endif 685 699 if ((err = snd_gf1_dma_init(gus)) < 0) -
GPL/trunk/alsa-kernel/isa/gus/gus_uart.c
r305 r426 130 130 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); 131 131 #if 0 132 snd_printk("read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); 133 snd_printk("[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x (page = 0x%x)\n", gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102)); 132 snd_printk(KERN_DEBUG 133 "read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", 134 gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); 135 snd_printk(KERN_DEBUG 136 "[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x " 137 "(page = 0x%x)\n", 138 gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), 139 inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102)); 134 140 #endif 135 141 return 0; -
GPL/trunk/alsa-kernel/isa/gus/interwave.c
r410 r426 171 171 172 172 #if 0 173 printk( "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);173 printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); 174 174 #endif 175 175 outb((data << 1) | ctrl, port); … … 184 184 res = inb(port) & 1; 185 185 #if 0 186 printk( "i2c_getclockline - 0x%lx -> %i\n", port, res);186 printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res); 187 187 #endif 188 188 return res; … … 198 198 res = (inb(port) & 2) >> 1; 199 199 #if 0 200 printk( "i2c_getdataline - 0x%lx -> %i\n", port, res);200 printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res); 201 201 #endif 202 202 return res; … … 343 343 snd_gf1_poke(gus, local + 1, d + 1); 344 344 #if 0 345 printk("d = 0x%x, local = 0x%x, local + 1 = 0x%x, idx << 22 = 0x%x\n", 345 printk(KERN_DEBUG "d = 0x%x, local = 0x%x, " 346 "local + 1 = 0x%x, idx << 22 = 0x%x\n", 346 347 d, 347 348 snd_gf1_peek(gus, local), … … 357 358 } 358 359 #if 0 359 printk("sizes: %i %i %i %i\n", sizes[0], sizes[1], sizes[2], sizes[3]); 360 printk(KERN_DEBUG "sizes: %i %i %i %i\n", 361 sizes[0], sizes[1], sizes[2], sizes[3]); 360 362 #endif 361 363 } … … 411 413 (psizes[1] << 8) | psizes[0]; 412 414 #if 0 413 printk( "lmct = 0x%08x\n", lmct);415 printk(KERN_DEBUG "lmct = 0x%08x\n", lmct); 414 416 #endif 415 417 for (i = 0; i < ARRAY_SIZE(lmc); i++) 416 418 if (lmct == lmc[i]) { 417 419 #if 0 418 printk( "found !!! %i\n", i);420 printk(KERN_DEBUG "found !!! %i\n", i); 419 421 #endif 420 422 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i); -
GPL/trunk/alsa-kernel/isa/opl3sa2.c
r410 r426 184 184 #if 0 185 185 outb(0x1d, port); /* password */ 186 printk( "read [0x%lx] = 0x%x\n", port, inb(port));186 printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port)); 187 187 #endif 188 188 outb(reg, chip->port); /* register */ 189 189 result = inb(chip->port + 1); 190 190 #if 0 191 printk("read [0x%lx] = 0x%x [0x%x]\n", port, result, inb(port)); 191 printk(KERN_DEBUG "read [0x%lx] = 0x%x [0x%x]\n", 192 port, result, inb(port)); 192 193 #endif 193 194 return result; … … 238 239 return -EBUSY; 239 240 } 240 // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a)); 241 /* 242 snd_printk(KERN_DEBUG "REG 0A = 0x%x\n", 243 snd_opl3sa2_read(chip, 0x0a)); 244 */ 241 245 chip->version = 0; 242 246 tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC); … … 482 486 OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, 483 487 db_scale_5bit_12db_max), 488 OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0), 484 489 }; 485 490 … … 555 560 static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) 556 561 { 557 struct snd_opl3sa2 *chip = card->private_data; 558 559 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 560 chip->wss->suspend(chip->wss); 561 /* power down */ 562 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); 562 if (card) { 563 struct snd_opl3sa2 *chip = card->private_data; 564 565 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 566 chip->wss->suspend(chip->wss); 567 /* power down */ 568 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); 569 } 563 570 564 571 return 0; … … 567 574 static int snd_opl3sa2_resume(struct snd_card *card) 568 575 { 569 struct snd_opl3sa2 *chip = card->private_data;576 struct snd_opl3sa2 *chip; 570 577 int i; 571 578 579 if (!card) 580 return 0; 581 582 chip = card->private_data; 572 583 /* power up */ 573 584 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); … … 618 629 struct snd_opl3sa2 *chip = card->private_data; 619 630 if (chip->irq >= 0) 620 free_irq(chip->irq, (void *)chip);631 free_irq(chip->irq, card); 621 632 release_and_free_resource(chip->res_port); 622 633 } … … 633 644 return err; 634 645 strcpy(card->driver, "OPL3SA2"); 635 strcpy(card->shortname, "Yamaha OPL3-SA 2");646 strcpy(card->shortname, "Yamaha OPL3-SA"); 636 647 chip = card->private_data; 637 648 spin_lock_init(&chip->reg_lock); -
GPL/trunk/alsa-kernel/isa/opti9xx/opti92x-ad1848.c
r410 r426 253 253 254 254 default: 255 snd_printk( "chip %d not supported\n", hardware);255 snd_printk(KERN_ERR "chip %d not supported\n", hardware); 256 256 return -ENODEV; 257 257 } … … 295 295 296 296 default: 297 snd_printk( "chip %d not supported\n", chip->hardware);297 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware); 298 298 } 299 299 … … 337 337 338 338 default: 339 snd_printk( "chip %d not supported\n", chip->hardware);339 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware); 340 340 } 341 341 … … 413 413 414 414 default: 415 snd_printk( "chip %d not supported\n", chip->hardware);415 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware); 416 416 return -EINVAL; 417 417 } … … 431 431 break; 432 432 default: 433 snd_printk("WSS port 0x%lx not valid\n", chip->wss_base); 433 snd_printk(KERN_WARNING "WSS port 0x%lx not valid\n", 434 chip->wss_base); 434 435 goto __skip_base; 435 436 } … … 456 457 break; 457 458 default: 458 snd_printk( "WSS irq # %d not valid\n", chip->irq);459 snd_printk(KERN_WARNING "WSS irq # %d not valid\n", chip->irq); 459 460 goto __skip_resources; 460 461 } … … 471 472 break; 472 473 default: 473 snd_printk("WSS dma1 # %d not valid\n", chip->dma1); 474 snd_printk(KERN_WARNING "WSS dma1 # %d not valid\n", 475 chip->dma1); 474 476 goto __skip_resources; 475 477 } … … 477 479 #if defined(CS4231) || defined(OPTi93X) 478 480 if (chip->dma1 == chip->dma2) { 479 snd_printk( "don't want to share dmas\n");481 snd_printk(KERN_ERR "don't want to share dmas\n"); 480 482 return -EBUSY; 481 483 } … … 486 488 break; 487 489 default: 488 snd_printk("WSS dma2 # %d not valid\n", chip->dma2); 490 snd_printk(KERN_WARNING "WSS dma2 # %d not valid\n", 491 chip->dma2); 489 492 goto __skip_resources; 490 493 } … … 517 520 break; 518 521 default: 519 snd_printk("MPU-401 port 0x%lx not valid\n", 522 snd_printk(KERN_WARNING 523 "MPU-401 port 0x%lx not valid\n", 520 524 chip->mpu_port); 521 525 goto __skip_mpu; … … 536 540 break; 537 541 default: 538 snd_printk( "MPU-401 irq # %d not valid\n",542 snd_printk(KERN_WARNING "MPU-401 irq # %d not valid\n", 539 543 chip->mpu_irq); 540 544 goto __skip_mpu; … … 727 731 chip->wss_base = snd_legacy_find_free_ioport(possible_ports, 4); 728 732 if (chip->wss_base < 0) { 729 snd_printk( "unable to find a free WSS port\n");733 snd_printk(KERN_ERR "unable to find a free WSS port\n"); 730 734 return -EBUSY; 731 735 } … … 816 820 } 817 821 if (opl3) { 818 #ifdef CS4231 819 const int t1dev = 1; 820 #else 821 const int t1dev = 0; 822 #endif 823 if ((error = snd_opl3_timer_new(opl3, t1dev, t1dev+1)) < 0) 824 return error; 825 if ((error = snd_opl3_hwdep_new(opl3, 0, 1, &synth)) < 0) 822 error = snd_opl3_hwdep_new(opl3, 0, 1, &synth); 823 if (error < 0) 826 824 return error; 827 825 } … … 901 899 if (dma2 == SNDRV_AUTO_DMA) { 902 900 if ((dma2 = snd_legacy_find_free_dma(possible_dma2s[dma1 % 4])) < 0) { 903 snd_printk( "unable to find a free DMA2\n");901 snd_printk(KERN_ERR "unable to find a free DMA2\n"); 904 902 return -EBUSY; 905 903 } -
GPL/trunk/alsa-kernel/isa/sb/sb16_csp.c
r399 r426 685 685 static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags) 686 686 { 687 int err = -ENOMEM; 688 unsigned char *kbuf = kmalloc(size, GFP_KERNEL); 689 if (kbuf) { 690 if (copy_from_user(kbuf, buf, size)) 691 err = -EFAULT; 692 else 693 err = snd_sb_csp_load(p, kbuf, size, load_flags); 694 kfree(kbuf); 695 } 687 int err; 688 unsigned char *kbuf; 689 690 kbuf = memdup_user(buf, size); 691 if (IS_ERR(kbuf)) 692 return PTR_ERR(kbuf); 693 694 err = snd_sb_csp_load(p, kbuf, size, load_flags); 695 696 kfree(kbuf); 696 697 return err; 697 698 } -
GPL/trunk/alsa-kernel/isa/sb/sb_mixer.c
r399 r426 183 183 static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 184 184 { 185 static c har *texts[5] = {185 static const char *texts[5] = { 186 186 "CD", "Mic", "Line", "Synth", "Master" 187 187 }; … … 270 270 271 271 /* 272 * ALS4000 mono recording control switch 273 */ 274 275 static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol, 276 struct snd_ctl_elem_info *uinfo) 277 { 278 static const char *texts[3] = { 279 "L chan only", "R chan only", "L ch/2 + R ch/2" 280 }; 281 282 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 283 uinfo->count = 1; 284 uinfo->value.enumerated.items = 3; 285 if (uinfo->value.enumerated.item > 2) 286 uinfo->value.enumerated.item = 2; 287 strcpy(uinfo->value.enumerated.name, 288 texts[uinfo->value.enumerated.item]); 289 return 0; 290 } 291 292 static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol, 293 struct snd_ctl_elem_value *ucontrol) 294 { 295 struct snd_sb *sb = snd_kcontrol_chip(kcontrol); 296 unsigned long flags; 297 unsigned char oval; 298 299 spin_lock_irqsave(&sb->mixer_lock, flags); 300 oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL); 301 spin_unlock_irqrestore(&sb->mixer_lock, flags); 302 oval >>= 6; 303 if (oval > 2) 304 oval = 2; 305 306 ucontrol->value.enumerated.item[0] = oval; 307 return 0; 308 } 309 310 static int snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol, 311 struct snd_ctl_elem_value *ucontrol) 312 { 313 struct snd_sb *sb = snd_kcontrol_chip(kcontrol); 314 unsigned long flags; 315 int change; 316 unsigned char nval, oval; 317 318 if (ucontrol->value.enumerated.item[0] > 2) 319 return -EINVAL; 320 spin_lock_irqsave(&sb->mixer_lock, flags); 321 oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL); 322 323 nval = (oval & ~(3 << 6)) 324 | (ucontrol->value.enumerated.item[0] << 6); 325 change = nval != oval; 326 if (change) 327 snd_sbmixer_write(sb, SB_ALS4000_MONO_IO_CTRL, nval); 328 spin_unlock_irqrestore(&sb->mixer_lock, flags); 329 return change; 330 } 331 332 /* 272 333 * SBPRO input multiplexer 273 334 */ … … 275 336 static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 276 337 { 277 static c har *texts[3] = {338 static const char *texts[3] = { 278 339 "Mic", "CD", "Line" 279 340 }; … … 442 503 .get = snd_dt019x_input_sw_get, 443 504 .put = snd_dt019x_input_sw_put, 505 }, 506 [SB_MIX_MONO_CAPTURE_ALS4K] = { 507 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 508 .info = snd_als4k_mono_capture_route_info, 509 .get = snd_als4k_mono_capture_route_get, 510 .put = snd_als4k_mono_capture_route_put, 444 511 }, 445 512 }; … … 637 704 638 705 static struct sbmix_elem *snd_dt019x_controls[] = { 706 /* ALS4000 below has some parts which we might be lacking, 707 * e.g. snd_als4000_ctl_mono_playback_switch - check it! */ 639 708 &snd_dt019x_ctl_master_play_vol, 640 709 &snd_dt019x_ctl_pcm_play_vol, … … 667 736 * ALS4000 specific mixer elements 668 737 */ 669 /* FIXME: SB_ALS4000_MONO_IO_CTRL needs output select ctrl! */670 738 static struct sbmix_elem snd_als4000_ctl_master_mono_playback_switch = 671 739 SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1); 672 static struct sbmix_elem snd_als4000_ctl_master_mono_capture_route = 673 SB_SINGLE("Master Mono Capture Route", SB_ALS4000_MONO_IO_CTRL, 6, 0x03); 674 /* FIXME: mono playback switch also available on DT019X? */ 740 static struct sbmix_elem snd_als4k_ctl_master_mono_capture_route = { 741 .name = "Master Mono Capture Route", 742 .type = SB_MIX_MONO_CAPTURE_ALS4K 743 }; 675 744 static struct sbmix_elem snd_als4000_ctl_mono_playback_switch = 676 745 SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1); 677 746 static struct sbmix_elem snd_als4000_ctl_mic_20db_boost = 678 747 SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03); 679 static struct sbmix_elem snd_als4000_ctl_mixer_loopback = 680 SB_SINGLE("Analog Loopback", SB_ALS4000_MIC_IN_GAIN, 7, 0x01); 748 static struct sbmix_elem snd_als4000_ctl_mixer_analog_loopback = 749 SB_SINGLE("Analog Loopback Switch", SB_ALS4000_MIC_IN_GAIN, 7, 0x01); 750 static struct sbmix_elem snd_als4000_ctl_mixer_digital_loopback = 751 SB_SINGLE("Digital Loopback Switch", 752 SB_ALS4000_CR3_CONFIGURATION, 7, 0x01); 681 753 /* FIXME: functionality of 3D controls might be swapped, I didn't find 682 754 * a description of how to identify what is supposed to be what */ … … 695 767 static struct sbmix_elem snd_als4000_3d_control_poweroff_switch = 696 768 SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01); 769 static struct sbmix_elem snd_als4000_ctl_3db_freq_control_switch = 770 SB_SINGLE("Master Playback 8kHz / 20kHz LPF Switch", 771 SB_ALS4000_FMDAC, 5, 0x01); 697 772 #ifdef NOT_AVAILABLE 698 773 static struct sbmix_elem snd_als4000_ctl_fmdac = … … 703 778 704 779 static struct sbmix_elem *snd_als4000_controls[] = { 705 &snd_sb16_ctl_master_play_vol, 706 &snd_dt019x_ctl_pcm_play_switch, 707 &snd_sb16_ctl_pcm_play_vol, 708 &snd_sb16_ctl_synth_capture_route, 709 &snd_dt019x_ctl_synth_play_switch, 710 &snd_sb16_ctl_synth_play_vol, 711 &snd_sb16_ctl_cd_capture_route, 712 &snd_sb16_ctl_cd_play_switch, 713 &snd_sb16_ctl_cd_play_vol, 714 &snd_sb16_ctl_line_capture_route, 715 &snd_sb16_ctl_line_play_switch, 716 &snd_sb16_ctl_line_play_vol, 717 &snd_sb16_ctl_mic_capture_route, 718 &snd_als4000_ctl_mic_20db_boost, 719 &snd_sb16_ctl_auto_mic_gain, 720 &snd_sb16_ctl_mic_play_switch, 721 &snd_sb16_ctl_mic_play_vol, 722 &snd_sb16_ctl_pc_speaker_vol, 723 &snd_sb16_ctl_capture_vol, 724 &snd_sb16_ctl_play_vol, 725 &snd_als4000_ctl_master_mono_playback_switch, 726 &snd_als4000_ctl_master_mono_capture_route, 727 &snd_als4000_ctl_mono_playback_switch, 728 &snd_als4000_ctl_mixer_loopback, 729 &snd_als4000_3d_control_switch, 730 &snd_als4000_3d_control_ratio, 731 &snd_als4000_3d_control_freq, 732 &snd_als4000_3d_control_delay, 733 &snd_als4000_3d_control_poweroff_switch, 780 /* ALS4000a.PDF regs page */ 781 &snd_sb16_ctl_master_play_vol, /* MX30/31 12 */ 782 &snd_dt019x_ctl_pcm_play_switch, /* MX4C 16 */ 783 &snd_sb16_ctl_pcm_play_vol, /* MX32/33 12 */ 784 &snd_sb16_ctl_synth_capture_route, /* MX3D/3E 14 */ 785 &snd_dt019x_ctl_synth_play_switch, /* MX4C 16 */ 786 &snd_sb16_ctl_synth_play_vol, /* MX34/35 12/13 */ 787 &snd_sb16_ctl_cd_capture_route, /* MX3D/3E 14 */ 788 &snd_sb16_ctl_cd_play_switch, /* MX3C 14 */ 789 &snd_sb16_ctl_cd_play_vol, /* MX36/37 13 */ 790 &snd_sb16_ctl_line_capture_route, /* MX3D/3E 14 */ 791 &snd_sb16_ctl_line_play_switch, /* MX3C 14 */ 792 &snd_sb16_ctl_line_play_vol, /* MX38/39 13 */ 793 &snd_sb16_ctl_mic_capture_route, /* MX3D/3E 14 */ 794 &snd_als4000_ctl_mic_20db_boost, /* MX4D 16 */ 795 &snd_sb16_ctl_mic_play_switch, /* MX3C 14 */ 796 &snd_sb16_ctl_mic_play_vol, /* MX3A 13 */ 797 &snd_sb16_ctl_pc_speaker_vol, /* MX3B 14 */ 798 &snd_sb16_ctl_capture_vol, /* MX3F/40 15 */ 799 &snd_sb16_ctl_play_vol, /* MX41/42 15 */ 800 &snd_als4000_ctl_master_mono_playback_switch, /* MX4C 16 */ 801 &snd_als4k_ctl_master_mono_capture_route, /* MX4B 16 */ 802 &snd_als4000_ctl_mono_playback_switch, /* MX4C 16 */ 803 &snd_als4000_ctl_mixer_analog_loopback, /* MX4D 16 */ 804 &snd_als4000_ctl_mixer_digital_loopback, /* CR3 21 */ 805 &snd_als4000_3d_control_switch, /* MX50 17 */ 806 &snd_als4000_3d_control_ratio, /* MX50 17 */ 807 &snd_als4000_3d_control_freq, /* MX50 17 */ 808 &snd_als4000_3d_control_delay, /* MX51 18 */ 809 &snd_als4000_3d_control_poweroff_switch, /* MX51 18 */ 810 &snd_als4000_ctl_3db_freq_control_switch, /* MX4F 17 */ 734 811 #ifdef NOT_AVAILABLE 735 812 &snd_als4000_ctl_fmdac, … … 906 983 907 984 static unsigned char als4000_saved_regs[] = { 985 /* please verify in dsheet whether regs to be added 986 are actually real H/W or just dummy */ 908 987 SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1, 909 988 SB_DSP4_OUTPUT_SW, … … 912 991 SB_DSP4_SYNTH_DEV, SB_DSP4_SYNTH_DEV + 1, 913 992 SB_DSP4_CD_DEV, SB_DSP4_CD_DEV + 1, 914 SB_DSP4_MIC_AGC,915 993 SB_DSP4_MIC_DEV, 916 994 SB_DSP4_SPEAKER_DEV, … … 920 998 SB_ALS4000_MONO_IO_CTRL, 921 999 SB_ALS4000_MIC_IN_GAIN, 1000 SB_ALS4000_FMDAC, 922 1001 SB_ALS4000_3D_SND_FX, 923 1002 SB_ALS4000_3D_TIME_DELAY, 1003 SB_ALS4000_CR3_CONFIGURATION, 924 1004 }; 925 1005 -
GPL/trunk/alsa-kernel/isa/wavefront/wavefront.c
r410 r426 554 554 #endif 555 555 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { 556 snd_printk( "specify CS4232 port\n");556 snd_printk(KERN_ERR "specify CS4232 port\n"); 557 557 return 0; 558 558 } 559 559 if (ics2115_port[dev] == SNDRV_AUTO_PORT) { 560 snd_printk( "specify ICS2115 port\n");560 snd_printk(KERN_ERR "specify ICS2115 port\n"); 561 561 return 0; 562 562 } -
GPL/trunk/alsa-kernel/isa/wavefront/wavefront_fx.c
r399 r426 35 35 #define WAIT_IDLE 0xff 36 36 37 #ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL38 #include "yss225.c"39 static const struct firmware yss225_registers_firmware = {40 .data = (u8 *)yss225_registers,41 .size = sizeof yss225_registers42 };43 #endif44 45 37 static int 46 38 wavefront_fx_idle (snd_wavefront_t *dev) … … 211 203 return -EIO; 212 204 } 213 page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); 214 if (!page_data) 215 return -ENOMEM; 216 if (copy_from_user (page_data, 217 (unsigned char __user *) r.data[3], 218 r.data[2] * sizeof(short))) { 219 kfree(page_data); 220 return -EFAULT; 221 } 205 page_data = memdup_user((unsigned char __user *) 206 r.data[3], 207 r.data[2] * sizeof(short)); 208 if (IS_ERR(page_data)) 209 return PTR_ERR(page_data); 222 210 pd = page_data; 223 211 } … … 261 249 return 0; 262 250 263 #ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL264 firmware = &yss225_registers_firmware;265 #else266 251 err = request_firmware(&firmware, "yamaha/yss225_registers.bin", 267 252 dev->card->dev); … … 270 255 goto out; 271 256 } 272 #endif273 257 274 258 for (i = 0; i + 1 < firmware->size; i += 2) { … … 293 277 294 278 out: 295 #ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL296 279 release_firmware(firmware); 297 #endif298 280 return err; 299 281 } 300 282 301 #ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL302 283 MODULE_FIRMWARE("yamaha/yss225_registers.bin"); 303 #endif -
GPL/trunk/alsa-kernel/isa/wavefront/wavefront_synth.c
r399 r426 636 636 637 637 if (snd_wavefront_cmd (dev, WFC_IDENTIFY_SAMPLE_TYPE, rbuf, wbuf)) { 638 snd_printk( "cannot identify sample "638 snd_printk(KERN_WARNING "cannot identify sample " 639 639 "type of slot %d\n", i); 640 640 dev->sample_status[i] = WF_ST_EMPTY; … … 1668 1668 1669 1669 case WFCTL_WFCMD: 1670 wc = kmalloc(sizeof(*wc), GFP_KERNEL); 1671 if (! wc) 1672 return -ENOMEM; 1673 if (copy_from_user (wc, argp, sizeof (*wc))) 1674 err = -EFAULT; 1675 else if (wavefront_synth_control (acard, wc) < 0) 1670 wc = memdup_user(argp, sizeof(*wc)); 1671 if (IS_ERR(wc)) 1672 return PTR_ERR(wc); 1673 1674 if (wavefront_synth_control (acard, wc) < 0) 1676 1675 err = -EIO; 1677 1676 else if (copy_to_user (argp, wc, sizeof (*wc)))
Note:
See TracChangeset
for help on using the changeset viewer.
