Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 78508
Collapse All | Expand All

(-)linux-2.6.10/include/sound/emu10k1.h (-2 / +2 lines)
Lines 838-847 Link Here
838
((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
838
((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
839
839
840
#define snd_emu10k1_compose_audigy_fxrt1(route) \
840
#define snd_emu10k1_compose_audigy_fxrt1(route) \
841
(((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 12)) << 24)
841
((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24))
842
842
843
#define snd_emu10k1_compose_audigy_fxrt2(route) \
843
#define snd_emu10k1_compose_audigy_fxrt2(route) \
844
(((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 12)) << 24)
844
((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24))
845
845
846
typedef struct snd_emu10k1_memblk {
846
typedef struct snd_emu10k1_memblk {
847
	snd_util_memblk_t mem;
847
	snd_util_memblk_t mem;
(-)linux-2.6.10/sound/pci/emu10k1/emu10k1.c (-2 / +23 lines)
Lines 2-7 Link Here
2
 *  The driver for the EMU10K1 (SB Live!) based soundcards
2
 *  The driver for the EMU10K1 (SB Live!) based soundcards
3
 *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
3
 *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
4
 *
4
 *
5
 *  Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
6
 *	Added support for Audigy 2 Value.
7
 *
5
 *
8
 *
6
 *   This program is free software; you can redistribute it and/or modify
9
 *   This program is free software; you can redistribute it and/or modify
7
 *   it under the terms of the GNU General Public License as published by
10
 *   it under the terms of the GNU General Public License as published by
Lines 68-79 Link Here
68
module_param_array(enable_ir, bool, NULL, 0444);
71
module_param_array(enable_ir, bool, NULL, 0444);
69
MODULE_PARM_DESC(enable_ir, "Enable IR.");
72
MODULE_PARM_DESC(enable_ir, "Enable IR.");
70
73
74
/*
75
 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value  Model:SB0400
76
 */
71
static struct pci_device_id snd_emu10k1_ids[] = {
77
static struct pci_device_id snd_emu10k1_ids[] = {
72
	{ 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },	/* EMU10K1 */
78
	{ 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },	/* EMU10K1 */
73
	{ 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },	/* Audigy */
79
	{ 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },	/* Audigy */
80
	{ 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },	/* Audigy 2 Value SB0400 */
74
	{ 0, }
81
	{ 0, }
75
};
82
};
76
83
84
/*
85
 * Audigy 2 Value notes:
86
 * A_IOCFG Input (GPIO)
87
 * 0x400  = Front analog jack plugged in. (Green socket)
88
 * 0x1000 = Read analog jack plugged in. (Black socket)
89
 * 0x2000 = Center/LFE analog jack plugged in. (Orange socket)
90
 * A_IOCFG Output (GPIO)
91
 * 0x60 = Sound out of front Left.
92
 * Win sets it to 0xXX61
93
 */
94
77
MODULE_DEVICE_TABLE(pci, snd_emu10k1_ids);
95
MODULE_DEVICE_TABLE(pci, snd_emu10k1_ids);
78
96
79
static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
97
static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
Lines 155-161 Link Here
155
	}
173
	}
156
#endif
174
#endif
157
 
175
 
158
	if (emu->audigy && (emu->revision == 4) ) {
176
	if (emu->audigy && (emu->serial == 0x10011102) ) {
177
		strcpy(card->driver, "Audigy2");
178
		strcpy(card->shortname, "Sound Blaster Audigy2_Value");
179
	} else if (emu->audigy && (emu->revision == 4) ) {
159
		strcpy(card->driver, "Audigy2");
180
		strcpy(card->driver, "Audigy2");
160
		strcpy(card->shortname, "Sound Blaster Audigy2");
181
		strcpy(card->shortname, "Sound Blaster Audigy2");
161
	} else if (emu->audigy) {
182
	} else if (emu->audigy) {
Lines 168-174 Link Here
168
		strcpy(card->driver, "EMU10K1");
189
		strcpy(card->driver, "EMU10K1");
169
		strcpy(card->shortname, "Sound Blaster Live!");
190
		strcpy(card->shortname, "Sound Blaster Live!");
170
	}
191
	}
171
	sprintf(card->longname, "%s (rev.%d) at 0x%lx, irq %i", card->shortname, emu->revision, emu->port, emu->irq);
192
	sprintf(card->longname, "%s (rev.%d, serial:0x%x) at 0x%lx, irq %i", card->shortname, emu->revision, emu->serial, emu->port, emu->irq);
172
193
173
	if ((err = snd_card_register(card)) < 0) {
194
	if ((err = snd_card_register(card)) < 0) {
174
		snd_card_free(card);
195
		snd_card_free(card);
(-)linux-2.6.10/sound/pci/emu10k1/emu10k1_main.c (-1 / +27 lines)
Lines 3-8 Link Here
3
 *                   Creative Labs, Inc.
3
 *                   Creative Labs, Inc.
4
 *  Routines for control of EMU10K1 chips
4
 *  Routines for control of EMU10K1 chips
5
 *
5
 *
6
 *  Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
7
 *      Added support for Audigy 2 Value.
8
 *
9
 *
6
 *  BUGS:
10
 *  BUGS:
7
 *    --
11
 *    --
8
 *
12
 *
Lines 183-188 Link Here
183
		outl(0x6E0000, emu->port + 0x20);
187
		outl(0x6E0000, emu->port + 0x20);
184
		outl(0xFF00FF00, emu->port + 0x24);
188
		outl(0xFF00FF00, emu->port + 0x24);
185
	}
189
	}
190
	if (emu->audigy && (emu->serial == 0x10011102) ) { /* audigy2 Value */
191
		/* Hacks for Alice3 to work independent of haP16V driver */
192
		u32 tmp;
193
	
194
		snd_printk(KERN_ERR "Audigy2 value:Special config.\n");
195
		//Setup SRCMulti_I2S SamplingRate
196
		tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
197
		tmp &= 0xfffff1ff;
198
		tmp |= (0x2<<9);
199
		snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp);
200
201
		/* Setup SRCSel (Enable Spdif,I2S SRCMulti) */
202
		outl(0x600000, emu->port + 0x20);
203
		outl(0x14, emu->port + 0x24);
204
205
		/* Setup SRCMulti Input Audio Enable */
206
		outl(0x7b0000, emu->port + 0x20);
207
		outl(0xFF000000, emu->port + 0x24);
208
	}
186
209
187
	/*
210
	/*
188
	 *  Clear page with silence & setup all pointers to this page
211
	 *  Clear page with silence & setup all pointers to this page
Lines 267-272 Link Here
267
			 * This has to be done after init ALice3 I2SOut beyond 48KHz.
290
			 * This has to be done after init ALice3 I2SOut beyond 48KHz.
268
			 * So, sequence is important. */
291
			 * So, sequence is important. */
269
			outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
292
			outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
293
		} else if (emu->serial == 0x10011102) { /* audigy2 value */
294
			/* Unmute Analog now. */
295
			outl(inl(emu->port + A_IOCFG) | 0x0060, emu->port + A_IOCFG);
270
		} else {
296
		} else {
271
			/* Disable routing from AC97 line out to Front speakers */
297
			/* Disable routing from AC97 line out to Front speakers */
272
			outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
298
			outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
Lines 590-596 Link Here
590
	*remu = NULL;
616
	*remu = NULL;
591
617
592
	// is_audigy = (int)pci->driver_data;
618
	// is_audigy = (int)pci->driver_data;
593
	is_audigy = (pci->device == 0x0004);
619
	is_audigy = (pci->device == 0x0004) || ( (pci->device == 0x0008) );
594
620
595
	/* enable PCI device */
621
	/* enable PCI device */
596
	if ((err = pci_enable_device(pci)) < 0)
622
	if ((err = pci_enable_device(pci)) < 0)
(-)linux-2.6.10/sound/pci/emu10k1/emufx.c (-1 / +4 lines)
Lines 1312-1320 Link Here
1312
	A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
1312
	A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
1313
1313
1314
	/* ADC buffer */
1314
	/* ADC buffer */
1315
#ifdef EMU10K1_CAPTURE_DIGITAL_OUT
1316
	A_PUT_STEREO_OUTPUT(A_EXTOUT_ADC_CAP_L, A_EXTOUT_ADC_CAP_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
1317
#else
1315
	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_L, capture);
1318
	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_L, capture);
1316
	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_R, capture+1);
1319
	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_R, capture+1);
1317
1320
#endif
1318
	/*
1321
	/*
1319
	 * ok, set up done..
1322
	 * ok, set up done..
1320
	 */
1323
	 */
(-)linux-2.6.10/sound/pci/emu10k1/emuproc.c (+174 lines)
Lines 309-314 Link Here
309
	return 0;
309
	return 0;
310
}
310
}
311
311
312
#ifdef CONFIG_SND_DEBUG
313
static void snd_emu_proc_io_reg_read(snd_info_entry_t *entry,
314
					snd_info_buffer_t * buffer)
315
{
316
	emu10k1_t *emu = entry->private_data;
317
	unsigned long value;
318
	unsigned long flags;
319
	int i;
320
	snd_iprintf(buffer, "IO Registers:\n\n");
321
	for(i = 0; i < 0x40; i+=4) {
322
		spin_lock_irqsave(&emu->emu_lock, flags);
323
		value = inl(emu->port + i);
324
		spin_unlock_irqrestore(&emu->emu_lock, flags);
325
		snd_iprintf(buffer, "%02X: %08lX\n", i, value);
326
	}
327
}
328
329
static void snd_emu_proc_io_reg_write(snd_info_entry_t *entry,
330
					snd_info_buffer_t * buffer)
331
{
332
	emu10k1_t *emu = entry->private_data;
333
	unsigned long flags;
334
	char line[64];
335
	u32 reg, val;
336
	while (!snd_info_get_line(buffer, line, sizeof(line))) {
337
		if (sscanf(line, "%x %x", &reg, &val) != 2)
338
			continue;
339
		if ((reg < 0x40) && (reg >=0) && (val <= 0xffffffff) ) {
340
			spin_lock_irqsave(&emu->emu_lock, flags);
341
			outl(val, emu->port + (reg & 0xfffffffc));
342
			spin_unlock_irqrestore(&emu->emu_lock, flags);
343
		}
344
	}
345
}
346
347
static unsigned int snd_ptr_read(emu10k1_t * emu,
348
					unsigned int iobase,
349
					unsigned int reg,
350
					unsigned int chn)
351
{
352
	unsigned long flags;
353
	unsigned int regptr, val;
354
	regptr = (reg << 16) | chn;
355
356
	spin_lock_irqsave(&emu->emu_lock, flags);
357
	outl(regptr, emu->port + iobase + PTR);
358
	val = inl(emu->port + iobase + DATA);
359
	spin_unlock_irqrestore(&emu->emu_lock, flags);
360
	return val;
361
}
362
363
static void snd_ptr_write(emu10k1_t *emu,
364
				unsigned int iobase,
365
				unsigned int reg,
366
				unsigned int chn,
367
				unsigned int data)
368
{
369
	unsigned int regptr;
370
	unsigned long flags;
371
372
	regptr = (reg << 16) | chn;
373
	spin_lock_irqsave(&emu->emu_lock, flags);
374
	outl(regptr, emu->port + iobase + PTR);
375
	outl(data, emu->port + iobase + DATA);
376
	spin_unlock_irqrestore(&emu->emu_lock, flags);
377
}
378
379
static void snd_emu_proc_ptr_reg_read(snd_info_entry_t *entry,
380
					snd_info_buffer_t * buffer,
381
					int iobase, int offset,
382
					int length)
383
{
384
	emu10k1_t *emu = entry->private_data;
385
	unsigned long value;
386
	int i,j;
387
	if (offset+length > 0x80) {
388
		snd_iprintf(buffer, "Input values out of range\n");
389
		return;
390
	}
391
	snd_iprintf(buffer, "Registers 0x%x\n", iobase);
392
	for(i = offset; i < offset+length; i++) {
393
		snd_iprintf(buffer, "%02X: ",i);
394
		for (j = 0; j < 4; j++) {
395
			if(iobase == 0) {
396
				value = snd_ptr_read(emu, 0, i, j);
397
			} else {
398
				value = snd_ptr_read(emu, 0x20, i, j);
399
			}
400
			snd_iprintf(buffer, "%08lX ", value);
401
		}
402
		snd_iprintf(buffer, "\n");
403
	}
404
}
405
406
static void snd_emu_proc_ptr_reg_write(snd_info_entry_t *entry,
407
					snd_info_buffer_t * buffer,
408
					int iobase)
409
{
410
	emu10k1_t *emu = entry->private_data;
411
	char line[64];
412
	unsigned int reg, channel_id , val;
413
	while (!snd_info_get_line(buffer, line, sizeof(line))) {
414
		if (sscanf(line, "%x %x %x", &reg, &channel_id, &val) != 3)
415
			continue;
416
		if ((reg < 0x80) && (reg >=0) && (val <= 0xffffffff) && (channel_id >=0) && (channel_id <= 3) )
417
			snd_ptr_write(emu, iobase, reg, channel_id, val);
418
	}
419
}
420
421
static void snd_emu_proc_ptr_reg_write00(snd_info_entry_t *entry,
422
						snd_info_buffer_t * buffer)
423
{
424
	snd_emu_proc_ptr_reg_write(entry, buffer, 0);
425
}
426
427
static void snd_emu_proc_ptr_reg_write20(snd_info_entry_t *entry,
428
					snd_info_buffer_t * buffer)
429
{
430
	snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
431
}
432
433
static void snd_emu_proc_ptr_reg_read00a(snd_info_entry_t *entry,
434
					snd_info_buffer_t * buffer)
435
{
436
	snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40);
437
}
438
439
static void snd_emu_proc_ptr_reg_read00b(snd_info_entry_t *entry,
440
					snd_info_buffer_t * buffer)
441
{
442
	snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40);
443
}
444
445
static void snd_emu_proc_ptr_reg_read20a(snd_info_entry_t *entry,
446
					snd_info_buffer_t * buffer)
447
{
448
	snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40);
449
}
450
451
static void snd_emu_proc_ptr_reg_read20b(snd_info_entry_t *entry,
452
					snd_info_buffer_t * buffer)
453
{
454
	snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40);
455
}
456
#endif
457
312
static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = {
458
static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = {
313
	.read = snd_emu10k1_fx8010_read,
459
	.read = snd_emu10k1_fx8010_read,
314
};
460
};
Lines 316-321 Link Here
316
int __devinit snd_emu10k1_proc_init(emu10k1_t * emu)
463
int __devinit snd_emu10k1_proc_init(emu10k1_t * emu)
317
{
464
{
318
	snd_info_entry_t *entry;
465
	snd_info_entry_t *entry;
466
467
#ifdef CONFIG_SND_DEBUG
468
	if(! snd_card_proc_new(emu->card, "io_regs", &entry)) {
469
		snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_io_reg_read);
470
		entry->c.text.write_size = 64;
471
		entry->c.text.write = snd_emu_proc_io_reg_write;
472
	}
473
	if(! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
474
		snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read00a);
475
		entry->c.text.write_size = 64;
476
		entry->c.text.write = snd_emu_proc_ptr_reg_write00;
477
	}
478
	if(! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
479
		snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read00b);
480
		entry->c.text.write_size = 64;
481
		entry->c.text.write = snd_emu_proc_ptr_reg_write00;
482
	}
483
	if(! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
484
		snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read20a);
485
		entry->c.text.write_size = 64;
486
		entry->c.text.write = snd_emu_proc_ptr_reg_write20;
487
	}
488
	if(! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
489
		snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_ptr_reg_read20b);
490
		entry->c.text.write_size = 64;
491
		entry->c.text.write = snd_emu_proc_ptr_reg_write20;
492
	}
493
#endif
319
	
494
	
320
	if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
495
	if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
321
		snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1_proc_read);
496
		snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1_proc_read);

Return to bug 78508