Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90fd5ce5 authored by James Courtier-Dutton's avatar James Courtier-Dutton Committed by Jaroslav Kysela
Browse files

[ALSA] snd-emu10k1: Add support for E-Mu 1616 PCI, 1616M PCI, 0404 PCI, E-Mu



Notebook.
Description: The .device=0x0008 chips have new, but different EMU32 in/out
channels. Driver updated to make use of these EMU32 channels.

Signed-off-by: default avatarJames Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 25765c4e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1746,6 +1746,8 @@ int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
#define A_FXBUS2(x)	(0x80 + (x))	/* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
#define A_EMU32OUTH(x)	(0xa0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
#define A_EMU32OUTL(x)	(0xb0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
#define A3_EMU32IN(x)	(0x160 + (x))	/* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
#define A3_EMU32OUT(x)	(0x1E0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
#define A_GPR(x)	(A_FXGPREGBASE + (x))

/* cc_reg constants */
+126 −104
Original line number Diff line number Diff line
@@ -1267,8 +1267,16 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))

	/* emu1212 DSP 0 and DSP 1 Capture */
	if (emu->card_capabilities->emu1010) {
		if (emu->card_capabilities->ca0108_chip) {
			/* Note:JCD:No longer bit shift lower 16bits to upper 16bits of 32bit value. */
			A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x0), A_C_00000001);
			A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_GPR(capture+0), A_GPR(gpr), A_GPR(tmp));
			A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x1), A_C_00000001);
			A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr), A_GPR(tmp));
		} else {
			A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_GPR(capture+0), A_GPR(gpr), A_P16VIN(0x0));
			A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr+1), A_P16VIN(0x1));
		}
		snd_emu10k1_init_stereo_control(&controls[nctl++], "EMU Capture Volume", gpr, 0);
		gpr += 2;
	}
@@ -1516,9 +1524,13 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
		/* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */
		snd_printk("EMU outputs on\n");
		for (z = 0; z < 8; z++) {
			if (emu->card_capabilities->ca0108_chip) {
				A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
			} else {
				A_OP(icode, &ptr, iACC3, A_EMU32OUTL(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
			}
		}
	}

	/* IEC958 Optical Raw Playback Switch */ 
	gpr_map[gpr++] = 0;
@@ -1557,6 +1569,15 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
#endif

	if (emu->card_capabilities->emu1010) {
		if (emu->card_capabilities->ca0108_chip) {
			snd_printk("EMU2 inputs on\n");
			for (z = 0; z < 0x10; z++) {
				snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 
									bit_shifter16,
									A3_EMU32IN(z),
									A_FXBUS2(z*2) );
			}
		} else {
			snd_printk("EMU inputs on\n");
			/* Capture 16 (originally 8) channels of S32_LE sound */

@@ -1657,6 +1678,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
								  A_FXBUS2(0x1e));
			A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xf),
			     A_C_00000000, A_C_00000000);
		}

#if 0
		for (z = 4; z < 8; z++) {
+4 −4
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
	int i;
	snd_iprintf(buffer, "EMU1010 Registers:\n\n");

	for(i = 0; i < 0x30; i+=1) {
	for(i = 0; i < 0x40; i+=1) {
		spin_lock_irqsave(&emu->emu_lock, flags);
		regs=i+0x40; /* 0x40 upwards are registers. */
		outl(regs, emu->port + A_IOCFG);
@@ -555,8 +555,8 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
{
	struct snd_info_entry *entry;
#ifdef CONFIG_SND_DEBUG
	if ((emu->card_capabilities->emu1010) &&
	     snd_card_proc_new(emu->card, "emu1010_regs", &entry)) {
	if (emu->card_capabilities->emu1010) {
		if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry)) 
			snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read);
	}
	if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {