diff options
author | James Courtier-Dutton <James@superbug.co.uk> | 2007-07-13 21:18:26 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-07-20 05:11:58 -0400 |
commit | 3663d845e557989d09e856c1e9e708e80a976dd4 (patch) | |
tree | b66b19548eb2e8425788962758f6c508cdf6fdd4 | |
parent | 89f157d9e6bf08b65f93dcb1dca1de037079885f (diff) |
[ALSA] snd-emu10k1: Initial support for E-Mu 1616 and 1616m.
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 72367411ee6b..6135fc99fa5e 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -51,9 +51,13 @@ | |||
51 | 51 | ||
52 | #define HANA_FILENAME "emu/hana.fw" | 52 | #define HANA_FILENAME "emu/hana.fw" |
53 | #define DOCK_FILENAME "emu/audio_dock.fw" | 53 | #define DOCK_FILENAME "emu/audio_dock.fw" |
54 | #define EMU1010B_FILENAME "emu/emu1010b.fw" | ||
55 | #define MICRO_DOCK_FILENAME "emu/micro_dock.fw" | ||
54 | 56 | ||
55 | MODULE_FIRMWARE(HANA_FILENAME); | 57 | MODULE_FIRMWARE(HANA_FILENAME); |
56 | MODULE_FIRMWARE(DOCK_FILENAME); | 58 | MODULE_FIRMWARE(DOCK_FILENAME); |
59 | MODULE_FIRMWARE(EMU1010B_FILENAME); | ||
60 | MODULE_FIRMWARE(MICRO_DOCK_FILENAME); | ||
57 | 61 | ||
58 | 62 | ||
59 | /************************************************************************* | 63 | /************************************************************************* |
@@ -660,10 +664,12 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file | |||
660 | return err; | 664 | return err; |
661 | } | 665 | } |
662 | snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size); | 666 | snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size); |
667 | #if 0 | ||
663 | if (fw_entry->size != 0x133a4) { | 668 | if (fw_entry->size != 0x133a4) { |
664 | snd_printk(KERN_ERR "firmware: %s wrong size.\n",filename); | 669 | snd_printk(KERN_ERR "firmware: %s wrong size.\n",filename); |
665 | return -EINVAL; | 670 | return -EINVAL; |
666 | } | 671 | } |
672 | #endif | ||
667 | 673 | ||
668 | /* The FPGA is a Xilinx Spartan IIE XC2S50E */ | 674 | /* The FPGA is a Xilinx Spartan IIE XC2S50E */ |
669 | /* GPIO7 -> FPGA PGMN | 675 | /* GPIO7 -> FPGA PGMN |
@@ -758,7 +764,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
758 | /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ | 764 | /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ |
759 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 765 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
760 | snd_printdd("reg1=0x%x\n",reg); | 766 | snd_printdd("reg1=0x%x\n",reg); |
761 | if (reg == 0x55) { | 767 | if ((reg & 0x1f) == 0x15) { |
762 | /* FPGA netlist already present so clear it */ | 768 | /* FPGA netlist already present so clear it */ |
763 | /* Return to programming mode */ | 769 | /* Return to programming mode */ |
764 | 770 | ||
@@ -766,19 +772,26 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
766 | } | 772 | } |
767 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 773 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
768 | snd_printdd("reg2=0x%x\n",reg); | 774 | snd_printdd("reg2=0x%x\n",reg); |
769 | if (reg == 0x55) { | 775 | if ((reg & 0x1f) == 0x15) { |
770 | /* FPGA failed to return to programming mode */ | 776 | /* FPGA failed to return to programming mode */ |
771 | return -ENODEV; | 777 | return -ENODEV; |
772 | } | 778 | } |
773 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); | 779 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); |
774 | if ((err = snd_emu1010_load_firmware(emu, HANA_FILENAME)) != 0) { | 780 | if (emu->card_capabilities->emu1010 == 1) { |
775 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file %s failed\n", HANA_FILENAME); | 781 | if ((err = snd_emu1010_load_firmware(emu, HANA_FILENAME)) != 0) { |
776 | return err; | 782 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file %s failed\n", HANA_FILENAME); |
783 | return err; | ||
784 | } | ||
785 | } else if (emu->card_capabilities->emu1010 == 2) { | ||
786 | if ((err = snd_emu1010_load_firmware(emu, EMU1010B_FILENAME)) != 0) { | ||
787 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010B_FILENAME); | ||
788 | return err; | ||
789 | } | ||
777 | } | 790 | } |
778 | 791 | ||
779 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ | 792 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ |
780 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 793 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
781 | if (reg != 0x55) { | 794 | if ((reg & 0x1f) != 0x15) { |
782 | /* FPGA failed to be programmed */ | 795 | /* FPGA failed to be programmed */ |
783 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg); | 796 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg); |
784 | return -ENODEV; | 797 | return -ENODEV; |
@@ -995,16 +1008,23 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
995 | /* Return to Audio Dock programming mode */ | 1008 | /* Return to Audio Dock programming mode */ |
996 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); | 1009 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); |
997 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); | 1010 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); |
998 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { | 1011 | if (emu->card_capabilities->emu1010 == 1) { |
999 | return err; | 1012 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { |
1013 | return err; | ||
1014 | } | ||
1015 | } else if (emu->card_capabilities->emu1010 == 2) { | ||
1016 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | ||
1017 | return err; | ||
1018 | } | ||
1000 | } | 1019 | } |
1020 | |||
1001 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); | 1021 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); |
1002 | snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ® ); | 1022 | snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ® ); |
1003 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg); | 1023 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg); |
1004 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ | 1024 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ |
1005 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 1025 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
1006 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg); | 1026 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg); |
1007 | if (reg != 0x55) { | 1027 | if ((reg & 0x1f) != 0x15) { |
1008 | /* FPGA failed to be programmed */ | 1028 | /* FPGA failed to be programmed */ |
1009 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); | 1029 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); |
1010 | return 0; | 1030 | return 0; |
@@ -1282,6 +1302,13 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1282 | .spi_dac = 1, | 1302 | .spi_dac = 1, |
1283 | .i2c_adc = 1, | 1303 | .i2c_adc = 1, |
1284 | .spk71 = 1} , | 1304 | .spk71 = 1} , |
1305 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, | ||
1306 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", | ||
1307 | .id = "EMU1010", | ||
1308 | .emu10k2_chip = 1, | ||
1309 | .ca0108_chip = 1, | ||
1310 | .spk71 = 1 , | ||
1311 | .emu1010 = 2} , | ||
1285 | {.vendor = 0x1102, .device = 0x0008, | 1312 | {.vendor = 0x1102, .device = 0x0008, |
1286 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", | 1313 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", |
1287 | .id = "Audigy2", | 1314 | .id = "Audigy2", |