diff options
author | James Courtier-Dutton <James@superbug.co.uk> | 2007-11-04 09:08:26 -0500 |
---|---|---|
committer | Mercurial server <hg@alsa0.alsa-project.org> | 2008-01-31 11:30:24 -0500 |
commit | 190d2c46e52592ba092e8bf8acd4427c920f2d69 (patch) | |
tree | bc4f4271f08aa57ac520fa2536c3990f8741fd55 | |
parent | 44893a36ba49349e0f9d4bc3b7bbf9b54469ae1a (diff) |
[ALSA] snd:emu10k1: E-Mu updates. Fixes to firmware loading and support for 0404.
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | include/sound/emu10k1.h | 2 | ||||
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 130 | ||||
-rw-r--r-- | sound/pci/emu10k1/emufx.c | 6 | ||||
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 4 | ||||
-rw-r--r-- | sound/pci/emu10k1/emupcm.c | 8 | ||||
-rw-r--r-- | sound/pci/emu10k1/emuproc.c | 4 | ||||
-rw-r--r-- | sound/pci/emu10k1/io.c | 7 |
7 files changed, 97 insertions, 64 deletions
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index fb66a949c2fb..8a0c3c1ef80d 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -1628,7 +1628,7 @@ struct snd_emu_chip_details { | |||
1628 | unsigned char spdif_bug; /* Has Spdif phasing bug */ | 1628 | unsigned char spdif_bug; /* Has Spdif phasing bug */ |
1629 | unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ | 1629 | unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ |
1630 | unsigned char ecard; /* APS EEPROM */ | 1630 | unsigned char ecard; /* APS EEPROM */ |
1631 | unsigned char emu1010; /* EMU 1010m card */ | 1631 | unsigned char emu_model; /* EMU model type */ |
1632 | unsigned char spi_dac; /* SPI interface for DAC */ | 1632 | unsigned char spi_dac; /* SPI interface for DAC */ |
1633 | unsigned char i2c_adc; /* I2C interface for ADC */ | 1633 | unsigned char i2c_adc; /* I2C interface for ADC */ |
1634 | unsigned char adc_1361t; /* Use Philips 1361T ADC */ | 1634 | unsigned char adc_1361t; /* Use Philips 1361T ADC */ |
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 69f342ce9b2a..da660676680e 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -54,12 +54,14 @@ | |||
54 | #define DOCK_FILENAME "emu/audio_dock.fw" | 54 | #define DOCK_FILENAME "emu/audio_dock.fw" |
55 | #define EMU1010B_FILENAME "emu/emu1010b.fw" | 55 | #define EMU1010B_FILENAME "emu/emu1010b.fw" |
56 | #define MICRO_DOCK_FILENAME "emu/micro_dock.fw" | 56 | #define MICRO_DOCK_FILENAME "emu/micro_dock.fw" |
57 | #define EMU0404_FILENAME "emu/emu0404.fw" | ||
57 | #define EMU1010_NOTEBOOK_FILENAME "emu/emu1010_notebook.fw" | 58 | #define EMU1010_NOTEBOOK_FILENAME "emu/emu1010_notebook.fw" |
58 | 59 | ||
59 | MODULE_FIRMWARE(HANA_FILENAME); | 60 | MODULE_FIRMWARE(HANA_FILENAME); |
60 | MODULE_FIRMWARE(DOCK_FILENAME); | 61 | MODULE_FIRMWARE(DOCK_FILENAME); |
61 | MODULE_FIRMWARE(EMU1010B_FILENAME); | 62 | MODULE_FIRMWARE(EMU1010B_FILENAME); |
62 | MODULE_FIRMWARE(MICRO_DOCK_FILENAME); | 63 | MODULE_FIRMWARE(MICRO_DOCK_FILENAME); |
64 | MODULE_FIRMWARE(EMU0404_FILENAME); | ||
63 | MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME); | 65 | MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME); |
64 | 66 | ||
65 | 67 | ||
@@ -287,7 +289,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume) | |||
287 | snd_emu10k1_ptr_write(emu, MAPB, ch, silent_page); | 289 | snd_emu10k1_ptr_write(emu, MAPB, ch, silent_page); |
288 | } | 290 | } |
289 | 291 | ||
290 | if (emu->card_capabilities->emu1010) { | 292 | if (emu->card_capabilities->emu_model) { |
291 | outl(HCFG_AUTOMUTE_ASYNC | | 293 | outl(HCFG_AUTOMUTE_ASYNC | |
292 | HCFG_EMU32_SLAVE | | 294 | HCFG_EMU32_SLAVE | |
293 | HCFG_AUDIOENABLE, emu->port + HCFG); | 295 | HCFG_AUDIOENABLE, emu->port + HCFG); |
@@ -317,7 +319,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume) | |||
317 | outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); | 319 | outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG); |
318 | 320 | ||
319 | if (enable_ir) { /* enable IR for SB Live */ | 321 | if (enable_ir) { /* enable IR for SB Live */ |
320 | if (emu->card_capabilities->emu1010) { | 322 | if (emu->card_capabilities->emu_model) { |
321 | ; /* Disable all access to A_IOCFG for the emu1010 */ | 323 | ; /* Disable all access to A_IOCFG for the emu1010 */ |
322 | } else if (emu->card_capabilities->i2c_adc) { | 324 | } else if (emu->card_capabilities->i2c_adc) { |
323 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ | 325 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ |
@@ -338,7 +340,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume) | |||
338 | } | 340 | } |
339 | } | 341 | } |
340 | 342 | ||
341 | if (emu->card_capabilities->emu1010) { | 343 | if (emu->card_capabilities->emu_model) { |
342 | ; /* Disable all access to A_IOCFG for the emu1010 */ | 344 | ; /* Disable all access to A_IOCFG for the emu1010 */ |
343 | } else if (emu->card_capabilities->i2c_adc) { | 345 | } else if (emu->card_capabilities->i2c_adc) { |
344 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ | 346 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ |
@@ -358,7 +360,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu) | |||
358 | outl(inl(emu->port + HCFG) | HCFG_AUDIOENABLE, emu->port + HCFG); | 360 | outl(inl(emu->port + HCFG) | HCFG_AUDIOENABLE, emu->port + HCFG); |
359 | 361 | ||
360 | /* Enable analog/digital outs on audigy */ | 362 | /* Enable analog/digital outs on audigy */ |
361 | if (emu->card_capabilities->emu1010) { | 363 | if (emu->card_capabilities->emu_model) { |
362 | ; /* Disable all access to A_IOCFG for the emu1010 */ | 364 | ; /* Disable all access to A_IOCFG for the emu1010 */ |
363 | } else if (emu->card_capabilities->i2c_adc) { | 365 | } else if (emu->card_capabilities->i2c_adc) { |
364 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ | 366 | ; /* Disable A_IOCFG for Audigy 2 ZS Notebook */ |
@@ -660,6 +662,8 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file | |||
660 | int n, i; | 662 | int n, i; |
661 | int reg; | 663 | int reg; |
662 | int value; | 664 | int value; |
665 | unsigned int write_post; | ||
666 | unsigned long flags; | ||
663 | const struct firmware *fw_entry; | 667 | const struct firmware *fw_entry; |
664 | 668 | ||
665 | if ((err = request_firmware(&fw_entry, filename, &emu->pci->dev)) != 0) { | 669 | if ((err = request_firmware(&fw_entry, filename, &emu->pci->dev)) != 0) { |
@@ -667,12 +671,6 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file | |||
667 | return err; | 671 | return err; |
668 | } | 672 | } |
669 | snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size); | 673 | snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size); |
670 | #if 0 | ||
671 | if (fw_entry->size != 0x133a4) { | ||
672 | snd_printk(KERN_ERR "firmware: %s wrong size.\n",filename); | ||
673 | return -EINVAL; | ||
674 | } | ||
675 | #endif | ||
676 | 674 | ||
677 | /* The FPGA is a Xilinx Spartan IIE XC2S50E */ | 675 | /* The FPGA is a Xilinx Spartan IIE XC2S50E */ |
678 | /* GPIO7 -> FPGA PGMN | 676 | /* GPIO7 -> FPGA PGMN |
@@ -680,9 +678,12 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file | |||
680 | * GPIO5 -> FPGA DIN | 678 | * GPIO5 -> FPGA DIN |
681 | * FPGA CONFIG OFF -> FPGA PGMN | 679 | * FPGA CONFIG OFF -> FPGA PGMN |
682 | */ | 680 | */ |
681 | spin_lock_irqsave(&emu->emu_lock, flags); | ||
683 | outl(0x00, emu->port + A_IOCFG); /* Set PGMN low for 1uS. */ | 682 | outl(0x00, emu->port + A_IOCFG); /* Set PGMN low for 1uS. */ |
684 | udelay(1); | 683 | write_post = inl(emu->port + A_IOCFG); |
684 | udelay(100); | ||
685 | outl(0x80, emu->port + A_IOCFG); /* Leave bit 7 set during netlist setup. */ | 685 | outl(0x80, emu->port + A_IOCFG); /* Leave bit 7 set during netlist setup. */ |
686 | write_post = inl(emu->port + A_IOCFG); | ||
686 | udelay(100); /* Allow FPGA memory to clean */ | 687 | udelay(100); /* Allow FPGA memory to clean */ |
687 | for(n = 0; n < fw_entry->size; n++) { | 688 | for(n = 0; n < fw_entry->size; n++) { |
688 | value=fw_entry->data[n]; | 689 | value=fw_entry->data[n]; |
@@ -692,12 +693,15 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file | |||
692 | reg = reg | 0x20; | 693 | reg = reg | 0x20; |
693 | value = value >> 1; | 694 | value = value >> 1; |
694 | outl(reg, emu->port + A_IOCFG); | 695 | outl(reg, emu->port + A_IOCFG); |
696 | write_post = inl(emu->port + A_IOCFG); | ||
695 | outl(reg | 0x40, emu->port + A_IOCFG); | 697 | outl(reg | 0x40, emu->port + A_IOCFG); |
698 | write_post = inl(emu->port + A_IOCFG); | ||
696 | } | 699 | } |
697 | } | 700 | } |
698 | /* After programming, set GPIO bit 4 high again. */ | 701 | /* After programming, set GPIO bit 4 high again. */ |
699 | outl(0x10, emu->port + A_IOCFG); | 702 | outl(0x10, emu->port + A_IOCFG); |
700 | 703 | write_post = inl(emu->port + A_IOCFG); | |
704 | spin_unlock_irqrestore(&emu->emu_lock, flags); | ||
701 | 705 | ||
702 | release_firmware(fw_entry); | 706 | release_firmware(fw_entry); |
703 | return 0; | 707 | return 0; |
@@ -711,7 +715,7 @@ int emu1010_firmware_thread(void *data) { | |||
711 | 715 | ||
712 | for (;;) { | 716 | for (;;) { |
713 | /* Delay to allow Audio Dock to settle */ | 717 | /* Delay to allow Audio Dock to settle */ |
714 | msleep(1000); | 718 | msleep_interruptible(1000); |
715 | if (kthread_should_stop()) | 719 | if (kthread_should_stop()) |
716 | break; | 720 | break; |
717 | snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp ); /* IRQ Status */ | 721 | snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp ); /* IRQ Status */ |
@@ -721,17 +725,17 @@ int emu1010_firmware_thread(void *data) { | |||
721 | /* Return to Audio Dock programming mode */ | 725 | /* Return to Audio Dock programming mode */ |
722 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); | 726 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n"); |
723 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); | 727 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK ); |
724 | if (emu->card_capabilities->emu1010 == 1) { | 728 | if (emu->card_capabilities->emu_model == 1) { |
725 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { | 729 | if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) { |
726 | return err; | 730 | continue; |
727 | } | 731 | } |
728 | } else if (emu->card_capabilities->emu1010 == 2) { | 732 | } else if (emu->card_capabilities->emu_model == 2) { |
729 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | 733 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { |
730 | return err; | 734 | continue; |
731 | } | 735 | } |
732 | } else if (emu->card_capabilities->emu1010 == 3) { | 736 | } else if (emu->card_capabilities->emu_model == 3) { |
733 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | 737 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { |
734 | return err; | 738 | continue; |
735 | } | 739 | } |
736 | } | 740 | } |
737 | 741 | ||
@@ -744,8 +748,7 @@ int emu1010_firmware_thread(void *data) { | |||
744 | if ((reg & 0x1f) != 0x15) { | 748 | if ((reg & 0x1f) != 0x15) { |
745 | /* FPGA failed to be programmed */ | 749 | /* FPGA failed to be programmed */ |
746 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); | 750 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); |
747 | return 0; | 751 | continue; |
748 | return -ENODEV; | ||
749 | } | 752 | } |
750 | snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n"); | 753 | snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n"); |
751 | snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp ); | 754 | snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp ); |
@@ -756,9 +759,9 @@ int emu1010_firmware_thread(void *data) { | |||
756 | msleep(10); | 759 | msleep(10); |
757 | /* Unmute all. Default is muted after a firmware load */ | 760 | /* Unmute all. Default is muted after a firmware load */ |
758 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); | 761 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); |
759 | break; | ||
760 | } | 762 | } |
761 | } | 763 | } |
764 | snd_printk(KERN_INFO "emu1010: firmware thread stopping\n"); | ||
762 | return 0; | 765 | return 0; |
763 | } | 766 | } |
764 | 767 | ||
@@ -799,6 +802,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
799 | int tmp,tmp2; | 802 | int tmp,tmp2; |
800 | int reg; | 803 | int reg; |
801 | int err; | 804 | int err; |
805 | const char *filename = NULL; | ||
802 | 806 | ||
803 | snd_printk(KERN_INFO "emu1010: Special config.\n"); | 807 | snd_printk(KERN_INFO "emu1010: Special config.\n"); |
804 | /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave, | 808 | /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave, |
@@ -840,21 +844,31 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
840 | return -ENODEV; | 844 | return -ENODEV; |
841 | } | 845 | } |
842 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); | 846 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); |
843 | if (emu->card_capabilities->emu1010 == 1) { | 847 | switch (emu->card_capabilities->emu_model) { |
844 | if ((err = snd_emu1010_load_firmware(emu, HANA_FILENAME)) != 0) { | 848 | case 1: |
845 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file %s failed\n", HANA_FILENAME); | 849 | filename = HANA_FILENAME; |
846 | return err; | 850 | break; |
847 | } | 851 | case 2: |
848 | } else if (emu->card_capabilities->emu1010 == 2) { | 852 | filename = EMU1010B_FILENAME; |
849 | if ((err = snd_emu1010_load_firmware(emu, EMU1010B_FILENAME)) != 0) { | 853 | break; |
850 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010B_FILENAME); | 854 | case 3: |
851 | return err; | 855 | filename = EMU1010_NOTEBOOK_FILENAME; |
852 | } | 856 | break; |
853 | } else if (emu->card_capabilities->emu1010 == 3) { | 857 | case 4: |
854 | if ((err = snd_emu1010_load_firmware(emu, EMU1010_NOTEBOOK_FILENAME)) != 0) { | 858 | filename = EMU0404_FILENAME; |
855 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010_NOTEBOOK_FILENAME); | 859 | break; |
856 | return err; | 860 | default: |
857 | } | 861 | filename = NULL; |
862 | return -ENODEV; | ||
863 | break; | ||
864 | } | ||
865 | snd_printk(KERN_INFO "emu1010: filename %s testing\n", filename); | ||
866 | err = snd_emu1010_load_firmware(emu, filename); | ||
867 | if (err != 0) { | ||
868 | snd_printk( | ||
869 | KERN_INFO "emu1010: Loading Firmware file %s failed\n", | ||
870 | filename); | ||
871 | return err; | ||
858 | } | 872 | } |
859 | 873 | ||
860 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ | 874 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ |
@@ -1201,11 +1215,12 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu) | |||
1201 | } | 1215 | } |
1202 | snd_emu10k1_free_efx(emu); | 1216 | snd_emu10k1_free_efx(emu); |
1203 | } | 1217 | } |
1204 | if (emu->card_capabilities->emu1010) { | 1218 | if (emu->card_capabilities->emu_model == 1) { |
1205 | /* Disable 48Volt power to Audio Dock */ | 1219 | /* Disable 48Volt power to Audio Dock */ |
1206 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); | 1220 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); |
1207 | kthread_stop(emu->emu1010.firmware_thread); | ||
1208 | } | 1221 | } |
1222 | if (emu->card_capabilities->emu_model) | ||
1223 | kthread_stop(emu->emu1010.firmware_thread); | ||
1209 | if (emu->memhdr) | 1224 | if (emu->memhdr) |
1210 | snd_util_memhdr_free(emu->memhdr); | 1225 | snd_util_memhdr_free(emu->memhdr); |
1211 | if (emu->silent_page.area) | 1226 | if (emu->silent_page.area) |
@@ -1337,6 +1352,15 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1337 | .spi_dac = 1, | 1352 | .spi_dac = 1, |
1338 | .i2c_adc = 1, | 1353 | .i2c_adc = 1, |
1339 | .spk71 = 1} , | 1354 | .spk71 = 1} , |
1355 | /* Tested by James@superbug.co.uk 20-3-2007. */ | ||
1356 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40021102, | ||
1357 | .driver = "Audigy2", .name = "E-mu 0404 [4002]", | ||
1358 | .id = "EMU0404", | ||
1359 | .emu10k2_chip = 1, | ||
1360 | .ca0102_chip = 1, | ||
1361 | .spk71 = 1, | ||
1362 | .emu_model = 4} , /* EMU 0404 */ | ||
1363 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ | ||
1340 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102, | 1364 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102, |
1341 | .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", | 1365 | .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", |
1342 | .id = "EMU1010", | 1366 | .id = "EMU1010", |
@@ -1344,28 +1368,30 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1344 | .ca0108_chip = 1, | 1368 | .ca0108_chip = 1, |
1345 | .ca_cardbus_chip = 1, | 1369 | .ca_cardbus_chip = 1, |
1346 | .spk71 = 1 , | 1370 | .spk71 = 1 , |
1347 | .emu1010 = 3} , | 1371 | .emu_model = 3} , |
1372 | /* Tested by James@superbug.co.uk 4th Nov 2007. */ | ||
1348 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, | 1373 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, |
1349 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", | 1374 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", |
1350 | .id = "EMU1010", | 1375 | .id = "EMU1010", |
1351 | .emu10k2_chip = 1, | 1376 | .emu10k2_chip = 1, |
1352 | .ca0108_chip = 1, | 1377 | .ca0108_chip = 1, |
1353 | .spk71 = 1 , | 1378 | .spk71 = 1, |
1354 | .emu1010 = 2} , | 1379 | .emu_model = 2} , |
1380 | /* Tested by James@superbug.co.uk 8th July 2005. */ | ||
1381 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, | ||
1382 | .driver = "Audigy2", .name = "E-mu 1010 [4001]", | ||
1383 | .id = "EMU1010", | ||
1384 | .emu10k2_chip = 1, | ||
1385 | .ca0102_chip = 1, | ||
1386 | .spk71 = 1, | ||
1387 | .emu_model = 1} , /* Emu 1010 */ | ||
1388 | /* Audigy4 (Not PRO) SB0610 */ | ||
1355 | {.vendor = 0x1102, .device = 0x0008, | 1389 | {.vendor = 0x1102, .device = 0x0008, |
1356 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", | 1390 | .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", |
1357 | .id = "Audigy2", | 1391 | .id = "Audigy2", |
1358 | .emu10k2_chip = 1, | 1392 | .emu10k2_chip = 1, |
1359 | .ca0108_chip = 1, | 1393 | .ca0108_chip = 1, |
1360 | .ac97_chip = 1} , | 1394 | .ac97_chip = 1} , |
1361 | /* Tested by James@superbug.co.uk 8th July 2005. No sound available yet. */ | ||
1362 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, | ||
1363 | .driver = "Audigy2", .name = "E-mu 1010 [4001]", | ||
1364 | .id = "EMU1010", | ||
1365 | .emu10k2_chip = 1, | ||
1366 | .ca0102_chip = 1, | ||
1367 | .spk71 = 1, | ||
1368 | .emu1010 = 1} , | ||
1369 | /* Tested by James@superbug.co.uk 3rd July 2005 */ | 1395 | /* Tested by James@superbug.co.uk 3rd July 2005 */ |
1370 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102, | 1396 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102, |
1371 | .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]", | 1397 | .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]", |
@@ -1793,7 +1819,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card, | |||
1793 | if (emu->card_capabilities->ecard) { | 1819 | if (emu->card_capabilities->ecard) { |
1794 | if ((err = snd_emu10k1_ecard_init(emu)) < 0) | 1820 | if ((err = snd_emu10k1_ecard_init(emu)) < 0) |
1795 | goto error; | 1821 | goto error; |
1796 | } else if (emu->card_capabilities->emu1010) { | 1822 | } else if (emu->card_capabilities->emu_model) { |
1797 | if ((err = snd_emu10k1_emu1010_init(emu)) < 0) { | 1823 | if ((err = snd_emu10k1_emu1010_init(emu)) < 0) { |
1798 | snd_emu10k1_free(emu); | 1824 | snd_emu10k1_free(emu); |
1799 | return err; | 1825 | return err; |
@@ -1942,7 +1968,7 @@ void snd_emu10k1_resume_init(struct snd_emu10k1 *emu) | |||
1942 | snd_emu10k1_cardbus_init(emu); | 1968 | snd_emu10k1_cardbus_init(emu); |
1943 | if (emu->card_capabilities->ecard) | 1969 | if (emu->card_capabilities->ecard) |
1944 | snd_emu10k1_ecard_init(emu); | 1970 | snd_emu10k1_ecard_init(emu); |
1945 | else if (emu->card_capabilities->emu1010) | 1971 | else if (emu->card_capabilities->emu_model) |
1946 | snd_emu10k1_emu1010_init(emu); | 1972 | snd_emu10k1_emu1010_init(emu); |
1947 | else | 1973 | else |
1948 | snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE); | 1974 | snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE); |
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index 354a892adb40..71dc4c8865b8 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c | |||
@@ -1261,7 +1261,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) | |||
1261 | A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | 1261 | A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) |
1262 | 1262 | ||
1263 | /* emu1212 DSP 0 and DSP 1 Capture */ | 1263 | /* emu1212 DSP 0 and DSP 1 Capture */ |
1264 | if (emu->card_capabilities->emu1010) { | 1264 | if (emu->card_capabilities->emu_model) { |
1265 | if (emu->card_capabilities->ca0108_chip) { | 1265 | if (emu->card_capabilities->ca0108_chip) { |
1266 | /* Note:JCD:No longer bit shift lower 16bits to upper 16bits of 32bit value. */ | 1266 | /* Note:JCD:No longer bit shift lower 16bits to upper 16bits of 32bit value. */ |
1267 | A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x0), A_C_00000001); | 1267 | A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x0), A_C_00000001); |
@@ -1515,7 +1515,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1515 | 1515 | ||
1516 | /* digital outputs */ | 1516 | /* digital outputs */ |
1517 | /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */ | 1517 | /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */ |
1518 | if (emu->card_capabilities->emu1010) { | 1518 | if (emu->card_capabilities->emu_model) { |
1519 | /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ | 1519 | /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ |
1520 | snd_printk("EMU outputs on\n"); | 1520 | snd_printk("EMU outputs on\n"); |
1521 | for (z = 0; z < 8; z++) { | 1521 | for (z = 0; z < 8; z++) { |
@@ -1563,7 +1563,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input)) | |||
1563 | A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_R, capture+1); | 1563 | A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_R, capture+1); |
1564 | #endif | 1564 | #endif |
1565 | 1565 | ||
1566 | if (emu->card_capabilities->emu1010) { | 1566 | if (emu->card_capabilities->emu_model) { |
1567 | if (emu->card_capabilities->ca0108_chip) { | 1567 | if (emu->card_capabilities->ca0108_chip) { |
1568 | snd_printk("EMU2 inputs on\n"); | 1568 | snd_printk("EMU2 inputs on\n"); |
1569 | for (z = 0; z < 0x10; z++) { | 1569 | for (z = 0; z < 0x10; z++) { |
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 5a38fe71e52f..83acfa6e9317 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -1792,7 +1792,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, | |||
1792 | return err; | 1792 | return err; |
1793 | } | 1793 | } |
1794 | 1794 | ||
1795 | if ( emu->card_capabilities->emu1010) { | 1795 | if (emu->card_capabilities->emu_model) { |
1796 | ; /* Disable the snd_audigy_spdif_shared_spdif */ | 1796 | ; /* Disable the snd_audigy_spdif_shared_spdif */ |
1797 | } else if (emu->audigy) { | 1797 | } else if (emu->audigy) { |
1798 | if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL) | 1798 | if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL) |
@@ -1817,7 +1817,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, | |||
1817 | return err; | 1817 | return err; |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | if ( emu->card_capabilities->emu1010) { | 1820 | if (emu->card_capabilities->emu_model) { |
1821 | int i; | 1821 | int i; |
1822 | 1822 | ||
1823 | for (i = 0; i < ARRAY_SIZE(snd_emu1010_output_enum_ctls); i++) { | 1823 | for (i = 0; i < ARRAY_SIZE(snd_emu1010_output_enum_ctls); i++) { |
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index cf4e3ec6530e..cf9276ddad42 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c | |||
@@ -357,7 +357,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu, | |||
357 | snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); | 357 | snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); |
358 | snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); | 358 | snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); |
359 | snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24)); | 359 | snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24)); |
360 | if (emu->card_capabilities->emu1010) | 360 | if (emu->card_capabilities->emu_model) |
361 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ | 361 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ |
362 | else | 362 | else |
363 | pitch_target = emu10k1_calc_pitch_target(runtime->rate); | 363 | pitch_target = emu10k1_calc_pitch_target(runtime->rate); |
@@ -700,7 +700,7 @@ static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct s | |||
700 | voice = evoice->number; | 700 | voice = evoice->number; |
701 | 701 | ||
702 | pitch = snd_emu10k1_rate_to_pitch(runtime->rate) >> 8; | 702 | pitch = snd_emu10k1_rate_to_pitch(runtime->rate) >> 8; |
703 | if (emu->card_capabilities->emu1010) | 703 | if (emu->card_capabilities->emu_model) |
704 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ | 704 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ |
705 | else | 705 | else |
706 | pitch_target = emu10k1_calc_pitch_target(runtime->rate); | 706 | pitch_target = emu10k1_calc_pitch_target(runtime->rate); |
@@ -1231,7 +1231,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) | |||
1231 | runtime->hw.rates = SNDRV_PCM_RATE_48000; | 1231 | runtime->hw.rates = SNDRV_PCM_RATE_48000; |
1232 | runtime->hw.rate_min = runtime->hw.rate_max = 48000; | 1232 | runtime->hw.rate_min = runtime->hw.rate_max = 48000; |
1233 | spin_lock_irq(&emu->reg_lock); | 1233 | spin_lock_irq(&emu->reg_lock); |
1234 | if (emu->card_capabilities->emu1010) { | 1234 | if (emu->card_capabilities->emu_model) { |
1235 | /* Nb. of channels has been increased to 16 */ | 1235 | /* Nb. of channels has been increased to 16 */ |
1236 | /* TODO | 1236 | /* TODO |
1237 | * SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE | 1237 | * SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE |
@@ -1790,7 +1790,7 @@ int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct s | |||
1790 | /* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */ | 1790 | /* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */ |
1791 | if (emu->audigy) { | 1791 | if (emu->audigy) { |
1792 | emu->efx_voices_mask[0] = 0; | 1792 | emu->efx_voices_mask[0] = 0; |
1793 | if (emu->card_capabilities->emu1010) | 1793 | if (emu->card_capabilities->emu_model) |
1794 | /* Pavel Hofman - 32 voices will be used for | 1794 | /* Pavel Hofman - 32 voices will be used for |
1795 | * capture (write mode) - | 1795 | * capture (write mode) - |
1796 | * each bit = corresponding voice | 1796 | * each bit = corresponding voice |
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c index bd8a47116528..f3caa3f890c6 100644 --- a/sound/pci/emu10k1/emuproc.c +++ b/sound/pci/emu10k1/emuproc.c | |||
@@ -244,7 +244,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry, | |||
244 | unsigned long flags; | 244 | unsigned long flags; |
245 | u32 rate; | 245 | u32 rate; |
246 | 246 | ||
247 | if (emu->card_capabilities->emu1010) { | 247 | if (emu->card_capabilities->emu_model) { |
248 | spin_lock_irqsave(&emu->emu_lock, flags); | 248 | spin_lock_irqsave(&emu->emu_lock, flags); |
249 | snd_emu1010_fpga_read(emu, 0x38, &value); | 249 | snd_emu1010_fpga_read(emu, 0x38, &value); |
250 | spin_unlock_irqrestore(&emu->emu_lock, flags); | 250 | spin_unlock_irqrestore(&emu->emu_lock, flags); |
@@ -584,7 +584,7 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu) | |||
584 | { | 584 | { |
585 | struct snd_info_entry *entry; | 585 | struct snd_info_entry *entry; |
586 | #ifdef CONFIG_SND_DEBUG | 586 | #ifdef CONFIG_SND_DEBUG |
587 | if (emu->card_capabilities->emu1010) { | 587 | if (emu->card_capabilities->emu_model) { |
588 | if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry)) | 588 | if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry)) |
589 | snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read); | 589 | snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read); |
590 | } | 590 | } |
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c index 2862e17446fe..a02638350a0a 100644 --- a/sound/pci/emu10k1/io.c +++ b/sound/pci/emu10k1/io.c | |||
@@ -227,11 +227,14 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, | |||
227 | 227 | ||
228 | int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value) | 228 | int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value) |
229 | { | 229 | { |
230 | unsigned long flags; | ||
231 | |||
230 | if (reg > 0x3f) | 232 | if (reg > 0x3f) |
231 | return 1; | 233 | return 1; |
232 | reg += 0x40; /* 0x40 upwards are registers. */ | 234 | reg += 0x40; /* 0x40 upwards are registers. */ |
233 | if (value < 0 || value > 0x3f) /* 0 to 0x3f are values */ | 235 | if (value < 0 || value > 0x3f) /* 0 to 0x3f are values */ |
234 | return 1; | 236 | return 1; |
237 | spin_lock_irqsave(&emu->emu_lock, flags); | ||
235 | outl(reg, emu->port + A_IOCFG); | 238 | outl(reg, emu->port + A_IOCFG); |
236 | udelay(10); | 239 | udelay(10); |
237 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | 240 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ |
@@ -239,20 +242,24 @@ int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value) | |||
239 | outl(value, emu->port + A_IOCFG); | 242 | outl(value, emu->port + A_IOCFG); |
240 | udelay(10); | 243 | udelay(10); |
241 | outl(value | 0x80 , emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | 244 | outl(value | 0x80 , emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ |
245 | spin_unlock_irqrestore(&emu->emu_lock, flags); | ||
242 | 246 | ||
243 | return 0; | 247 | return 0; |
244 | } | 248 | } |
245 | 249 | ||
246 | int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value) | 250 | int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value) |
247 | { | 251 | { |
252 | unsigned long flags; | ||
248 | if (reg > 0x3f) | 253 | if (reg > 0x3f) |
249 | return 1; | 254 | return 1; |
250 | reg += 0x40; /* 0x40 upwards are registers. */ | 255 | reg += 0x40; /* 0x40 upwards are registers. */ |
256 | spin_lock_irqsave(&emu->emu_lock, flags); | ||
251 | outl(reg, emu->port + A_IOCFG); | 257 | outl(reg, emu->port + A_IOCFG); |
252 | udelay(10); | 258 | udelay(10); |
253 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ | 259 | outl(reg | 0x80, emu->port + A_IOCFG); /* High bit clocks the value into the fpga. */ |
254 | udelay(10); | 260 | udelay(10); |
255 | *value = ((inl(emu->port + A_IOCFG) >> 8) & 0x7f); | 261 | *value = ((inl(emu->port + A_IOCFG) >> 8) & 0x7f); |
262 | spin_unlock_irqrestore(&emu->emu_lock, flags); | ||
256 | 263 | ||
257 | return 0; | 264 | return 0; |
258 | } | 265 | } |