View | Details | Raw Unified | Return to bug 9304 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 9304