aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_main.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c133
1 files changed, 75 insertions, 58 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index a341e758acde..746b51ef3966 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -191,7 +191,7 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
191 /* Set playback routing. */ 191 /* Set playback routing. */
192 snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, 0x78e4); 192 snd_emu10k1_ptr20_write(emu, CAPTURE_P16V_SOURCE, 0, 0x78e4);
193 } 193 }
194 if (emu->audigy && (emu->serial == 0x10011102) ) { /* audigy2 Value */ 194 if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
195 /* Hacks for Alice3 to work independent of haP16V driver */ 195 /* Hacks for Alice3 to work independent of haP16V driver */
196 u32 tmp; 196 u32 tmp;
197 197
@@ -253,6 +253,8 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
253 HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); 253 HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
254 else 254 else
255 outl(HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); 255 outl(HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
256 /* FIXME: Remove all these emu->model and replace it with a card recognition parameter,
257 * e.g. card_capabilities->joystick */
256 } else if (emu->model == 0x20 || 258 } else if (emu->model == 0x20 ||
257 emu->model == 0xc400 || 259 emu->model == 0xc400 ||
258 (emu->model == 0x21 && emu->revision < 6)) 260 (emu->model == 0x21 && emu->revision < 6))
@@ -299,12 +301,12 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
299 if (emu->audigy) { 301 if (emu->audigy) {
300 outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG); 302 outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG);
301 303
302 if (emu->revision == 4) { /* audigy2 */ 304 if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
303 /* Unmute Analog now. Set GPO6 to 1 for Apollo. 305 /* Unmute Analog now. Set GPO6 to 1 for Apollo.
304 * This has to be done after init ALice3 I2SOut beyond 48KHz. 306 * This has to be done after init ALice3 I2SOut beyond 48KHz.
305 * So, sequence is important. */ 307 * So, sequence is important. */
306 outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG); 308 outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
307 } else if (emu->serial == 0x10011102) { /* audigy2 value */ 309 } else if (emu->card_capabilities->ca0108_chip) { /* audigy2 value */
308 /* Unmute Analog now. */ 310 /* Unmute Analog now. */
309 outl(inl(emu->port + A_IOCFG) | 0x0060, emu->port + A_IOCFG); 311 outl(inl(emu->port + A_IOCFG) | 0x0060, emu->port + A_IOCFG);
310 } else { 312 } else {
@@ -614,6 +616,7 @@ static int snd_emu10k1_dev_free(snd_device_t *device)
614 616
615static emu_chip_details_t emu_chip_details[] = { 617static emu_chip_details_t emu_chip_details[] = {
616 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 618 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
619 /* Tested by James@superbug.co.uk 3rd July 2005 */
617 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102, 620 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
618 .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]", 621 .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]",
619 .id = "Audigy2", 622 .id = "Audigy2",
@@ -627,6 +630,14 @@ static emu_chip_details_t emu_chip_details[] = {
627 .emu10k2_chip = 1, 630 .emu10k2_chip = 1,
628 .ca0108_chip = 1, 631 .ca0108_chip = 1,
629 .ac97_chip = 1} , 632 .ac97_chip = 1} ,
633 /* Tested by James@superbug.co.uk 8th July 2005. No sound available yet. */
634 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
635 .driver = "Audigy2", .name = "E-mu 1212m [4001]",
636 .id = "EMU1212m",
637 .emu10k2_chip = 1,
638 .ca0102_chip = 1,
639 .ecard = 1} ,
640 /* Tested by James@superbug.co.uk 3rd July 2005 */
630 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102, 641 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102,
631 .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]", 642 .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]",
632 .id = "Audigy2", 643 .id = "Audigy2",
@@ -687,18 +698,18 @@ static emu_chip_details_t emu_chip_details[] = {
687 .ca0151_chip = 1, 698 .ca0151_chip = 1,
688 .spdif_bug = 1, 699 .spdif_bug = 1,
689 .ac97_chip = 1} , 700 .ac97_chip = 1} ,
690 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10020052, 701 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00531102,
691 .driver = "Audigy", .name = "Audigy 1 ES [SB0160]", 702 .driver = "Audigy", .name = "Audigy 1 [SB0090]",
692 .id = "Audigy", 703 .id = "Audigy",
693 .emu10k2_chip = 1, 704 .emu10k2_chip = 1,
694 .ca0102_chip = 1, 705 .ca0102_chip = 1,
695 .spdif_bug = 1,
696 .ac97_chip = 1} , 706 .ac97_chip = 1} ,
697 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00531102, 707 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00521102,
698 .driver = "Audigy", .name = "Audigy 1 [SB0090]", 708 .driver = "Audigy", .name = "Audigy 1 ES [SB0160]",
699 .id = "Audigy", 709 .id = "Audigy",
700 .emu10k2_chip = 1, 710 .emu10k2_chip = 1,
701 .ca0102_chip = 1, 711 .ca0102_chip = 1,
712 .spdif_bug = 1,
702 .ac97_chip = 1} , 713 .ac97_chip = 1} ,
703 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00511102, 714 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00511102,
704 .driver = "Audigy", .name = "Audigy 1 [SB0090]", 715 .driver = "Audigy", .name = "Audigy 1 [SB0090]",
@@ -712,54 +723,49 @@ static emu_chip_details_t emu_chip_details[] = {
712 .emu10k2_chip = 1, 723 .emu10k2_chip = 1,
713 .ca0102_chip = 1, 724 .ca0102_chip = 1,
714 .ac97_chip = 1} , 725 .ac97_chip = 1} ,
715 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x40011102, 726 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806B1102,
716 .driver = "EMU10K1", .name = "E-mu APS [4001]", 727 .driver = "EMU10K1", .name = "SBLive! [SB0105]",
717 .id = "APS",
718 .emu10k1_chip = 1,
719 .ecard = 1} ,
720 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80611102,
721 .driver = "EMU10K1", .name = "SBLive! Player 5.1 [SB0060]",
722 .id = "Live", 728 .id = "Live",
723 .emu10k1_chip = 1, 729 .emu10k1_chip = 1,
724 .ac97_chip = 1, 730 .ac97_chip = 1,
725 .sblive51 = 1} , 731 .sblive51 = 1} ,
726 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102, 732 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806A1102,
727 .driver = "EMU10K1", .name = "SB Live 5.1", 733 .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
728 .id = "Live", 734 .id = "Live",
729 .emu10k1_chip = 1, 735 .emu10k1_chip = 1,
730 .ac97_chip = 1, 736 .ac97_chip = 1,
731 .sblive51 = 1} , 737 .sblive51 = 1} ,
732 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102, 738 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80691102,
733 .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]", 739 .driver = "EMU10K1", .name = "SBLive! Value [SB0101]",
734 .id = "Live",
735 .emu10k1_chip = 1,
736 .ac97_chip = 1} ,
737 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00211102,
738 .driver = "EMU10K1", .name = "SBLive! [CT4620]",
739 .id = "Live", 740 .id = "Live",
740 .emu10k1_chip = 1, 741 .emu10k1_chip = 1,
741 .ac97_chip = 1, 742 .ac97_chip = 1,
742 .sblive51 = 1} , 743 .sblive51 = 1} ,
743 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00201102, 744 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102,
744 .driver = "EMU10K1", .name = "SBLive! Value [CT4670]", 745 .driver = "EMU10K1", .name = "SB Live 5.1",
745 .id = "Live", 746 .id = "Live",
746 .emu10k1_chip = 1, 747 .emu10k1_chip = 1,
747 .ac97_chip = 1, 748 .ac97_chip = 1,
748 .sblive51 = 1} , 749 .sblive51 = 1} ,
749 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80221102, 750 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80611102,
750 .driver = "EMU10K1", .name = "SBLive! Value [CT4780]", 751 .driver = "EMU10K1", .name = "SBLive! Player 5.1 [SB0060]",
751 .id = "Live", 752 .id = "Live",
752 .emu10k1_chip = 1, 753 .emu10k1_chip = 1,
753 .ac97_chip = 1, 754 .ac97_chip = 1,
754 .sblive51 = 1} , 755 .sblive51 = 1} ,
755 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80231102, 756 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102,
756 .driver = "EMU10K1", .name = "SB PCI512 [CT4790]", 757 .driver = "EMU10K1", .name = "SBLive! Value [CT4850]",
757 .id = "Live", 758 .id = "Live",
758 .emu10k1_chip = 1, 759 .emu10k1_chip = 1,
759 .ac97_chip = 1, 760 .ac97_chip = 1,
760 .sblive51 = 1} , 761 .sblive51 = 1} ,
761 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80261102, 762 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102,
762 .driver = "EMU10K1", .name = "SBLive! Value [CT4830]", 763 .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
764 .id = "Live",
765 .emu10k1_chip = 1,
766 .ac97_chip = 1} ,
767 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80321102,
768 .driver = "EMU10K1", .name = "SBLive! Value [CT4871]",
763 .id = "Live", 769 .id = "Live",
764 .emu10k1_chip = 1, 770 .emu10k1_chip = 1,
765 .ac97_chip = 1, 771 .ac97_chip = 1,
@@ -770,50 +776,50 @@ static emu_chip_details_t emu_chip_details[] = {
770 .emu10k1_chip = 1, 776 .emu10k1_chip = 1,
771 .ac97_chip = 1, 777 .ac97_chip = 1,
772 .sblive51 = 1} , 778 .sblive51 = 1} ,
773 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102, 779 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80281102,
774 .driver = "EMU10K1", .name = "SBLive! Value [CT4832]", 780 .driver = "EMU10K1", .name = "SBLive! Value [CT4870]",
775 .id = "Live", 781 .id = "Live",
776 .emu10k1_chip = 1, 782 .emu10k1_chip = 1,
777 .ac97_chip = 1, 783 .ac97_chip = 1,
778 .sblive51 = 1} , 784 .sblive51 = 1} ,
779 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102, 785 /* Tested by James@superbug.co.uk 3rd July 2005 */
780 .driver = "EMU10K1", .name = "SBLive! Value [CT4850]", 786 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102,
787 .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
781 .id = "Live", 788 .id = "Live",
782 .emu10k1_chip = 1, 789 .emu10k1_chip = 1,
783 .ac97_chip = 1, 790 .ac97_chip = 1,
784 .sblive51 = 1} , 791 .sblive51 = 1} ,
785 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80281102, 792 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80261102,
786 .driver = "EMU10K1", .name = "SBLive! Value [CT4870]", 793 .driver = "EMU10K1", .name = "SBLive! Value [CT4830]",
787 .id = "Live", 794 .id = "Live",
788 .emu10k1_chip = 1, 795 .emu10k1_chip = 1,
789 .ac97_chip = 1, 796 .ac97_chip = 1,
790 .sblive51 = 1} , 797 .sblive51 = 1} ,
791 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80321102, 798 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80231102,
792 .driver = "EMU10K1", .name = "SBLive! Value [CT4871]", 799 .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
793 .id = "Live", 800 .id = "Live",
794 .emu10k1_chip = 1, 801 .emu10k1_chip = 1,
795 .ac97_chip = 1, 802 .ac97_chip = 1,
796 .sblive51 = 1} , 803 .sblive51 = 1} ,
797 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80611102, 804 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80221102,
798 .driver = "EMU10K1", .name = "SBLive! Value [SB0060]", 805 .driver = "EMU10K1", .name = "SBLive! Value [CT4780]",
799 .id = "Live", 806 .id = "Live",
800 .emu10k1_chip = 1, 807 .emu10k1_chip = 1,
801 .ac97_chip = 1, 808 .ac97_chip = 1,
802 .sblive51 = 1} , 809 .sblive51 = 1} ,
803 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80691102, 810 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x40011102,
804 .driver = "EMU10K1", .name = "SBLive! Value [SB0101]", 811 .driver = "EMU10K1", .name = "E-mu APS [4001]",
805 .id = "Live", 812 .id = "APS",
806 .emu10k1_chip = 1, 813 .emu10k1_chip = 1,
807 .ac97_chip = 1, 814 .ecard = 1} ,
808 .sblive51 = 1} , 815 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00211102,
809 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806A1102, 816 .driver = "EMU10K1", .name = "SBLive! [CT4620]",
810 .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
811 .id = "Live", 817 .id = "Live",
812 .emu10k1_chip = 1, 818 .emu10k1_chip = 1,
813 .ac97_chip = 1, 819 .ac97_chip = 1,
814 .sblive51 = 1} , 820 .sblive51 = 1} ,
815 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806B1102, 821 {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00201102,
816 .driver = "EMU10K1", .name = "SBLive! [SB0105]", 822 .driver = "EMU10K1", .name = "SBLive! Value [CT4670]",
817 .id = "Live", 823 .id = "Live",
818 .emu10k1_chip = 1, 824 .emu10k1_chip = 1,
819 .ac97_chip = 1, 825 .ac97_chip = 1,
@@ -833,6 +839,7 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
833 unsigned short extout_mask, 839 unsigned short extout_mask,
834 long max_cache_bytes, 840 long max_cache_bytes,
835 int enable_ir, 841 int enable_ir,
842 uint subsystem,
836 emu10k1_t ** remu) 843 emu10k1_t ** remu)
837{ 844{
838 emu10k1_t *emu; 845 emu10k1_t *emu;
@@ -878,10 +885,16 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
878 885
879 for (c = emu_chip_details; c->vendor; c++) { 886 for (c = emu_chip_details; c->vendor; c++) {
880 if (c->vendor == pci->vendor && c->device == pci->device) { 887 if (c->vendor == pci->vendor && c->device == pci->device) {
881 if (c->subsystem && c->subsystem != emu->serial) 888 if (subsystem) {
882 continue; 889 if (c->subsystem && (c->subsystem == subsystem) ) {
883 if (c->revision && c->revision != emu->revision) 890 break;
884 continue; 891 } else continue;
892 } else {
893 if (c->subsystem && (c->subsystem != emu->serial) )
894 continue;
895 if (c->revision && c->revision != emu->revision)
896 continue;
897 }
885 break; 898 break;
886 } 899 }
887 } 900 }
@@ -892,10 +905,14 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
892 return -ENOENT; 905 return -ENOENT;
893 } 906 }
894 emu->card_capabilities = c; 907 emu->card_capabilities = c;
895 if (c->subsystem != 0) 908 if (c->subsystem && !subsystem)
896 snd_printdd("Sound card name=%s\n", c->name); 909 snd_printdd("Sound card name=%s\n", c->name);
897 else 910 else if (subsystem)
898 snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x\n", c->name, pci->vendor, pci->device, emu->serial); 911 snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x. Forced to subsytem=0x%x\n",
912 c->name, pci->vendor, pci->device, emu->serial, c->subsystem);
913 else
914 snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x.\n",
915 c->name, pci->vendor, pci->device, emu->serial);
899 916
900 if (!*card->id && c->id) { 917 if (!*card->id && c->id) {
901 int i, n = 0; 918 int i, n = 0;