aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_main.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2007-11-04 09:08:26 -0500
committerMercurial server <hg@alsa0.alsa-project.org>2008-01-31 11:30:24 -0500
commit190d2c46e52592ba092e8bf8acd4427c920f2d69 (patch)
treebc4f4271f08aa57ac520fa2536c3990f8741fd55 /sound/pci/emu10k1/emu10k1_main.c
parent44893a36ba49349e0f9d4bc3b7bbf9b54469ae1a (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>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_main.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c130
1 files changed, 78 insertions, 52 deletions
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
59MODULE_FIRMWARE(HANA_FILENAME); 60MODULE_FIRMWARE(HANA_FILENAME);
60MODULE_FIRMWARE(DOCK_FILENAME); 61MODULE_FIRMWARE(DOCK_FILENAME);
61MODULE_FIRMWARE(EMU1010B_FILENAME); 62MODULE_FIRMWARE(EMU1010B_FILENAME);
62MODULE_FIRMWARE(MICRO_DOCK_FILENAME); 63MODULE_FIRMWARE(MICRO_DOCK_FILENAME);
64MODULE_FIRMWARE(EMU0404_FILENAME);
63MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME); 65MODULE_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);