Changeset 426 for GPL/trunk/alsa-kernel/isa/cs423x
- Timestamp:
- May 9, 2009, 11:45:26 AM (16 years ago)
- Location:
- GPL/trunk/alsa-kernel/isa/cs423x
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.