aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ca0106/ca0106_proc.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-06-22 21:26:47 -0400
committerSteve French <sfrench@us.ibm.com>2005-06-22 21:26:47 -0400
commitea0daab4ae4a2f853f06c76961c0ed324fd0804c (patch)
treef6fbe2db5772695181b7a7257b05e43343bd8d75 /sound/pci/ca0106/ca0106_proc.c
parent58aab753de605c14b9878a897e7349c3063afeff (diff)
parent1bdf7a78c2b21fb94dfe7994dbe89310b18479d2 (diff)
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
Diffstat (limited to 'sound/pci/ca0106/ca0106_proc.c')
-rw-r--r--sound/pci/ca0106/ca0106_proc.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index afb711421e47..1c9cc821d1b9 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk> 2 * Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk>
3 * Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit 3 * Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
4 * Version: 0.0.17 4 * Version: 0.0.18
5 * 5 *
6 * FEATURES currently supported: 6 * FEATURES currently supported:
7 * See ca0106_main.c for features. 7 * See ca0106_main.c for features.
@@ -39,7 +39,9 @@
39 * Modified Copyright message. 39 * Modified Copyright message.
40 * 0.0.17 40 * 0.0.17
41 * Add iec958 file in proc file system to show status of SPDIF in. 41 * Add iec958 file in proc file system to show status of SPDIF in.
42 * 42 * 0.0.18
43 * Implement support for Line-in capture on SB Live 24bit.
44 *
43 * This code was initally based on code from ALSA's emu10k1x.c which is: 45 * This code was initally based on code from ALSA's emu10k1x.c which is:
44 * Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com> 46 * Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
45 * 47 *
@@ -95,7 +97,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = {
95}; 97};
96 98
97 99
98void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value) 100static void snd_ca0106_proc_dump_iec958( snd_info_buffer_t *buffer, u32 value)
99{ 101{
100 int i; 102 int i;
101 u32 status[4]; 103 u32 status[4];
@@ -407,6 +409,20 @@ static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry,
407 } 409 }
408} 410}
409 411
412static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry,
413 snd_info_buffer_t * buffer)
414{
415 ca0106_t *emu = entry->private_data;
416 char line[64];
417 unsigned int reg, val;
418 while (!snd_info_get_line(buffer, line, sizeof(line))) {
419 if (sscanf(line, "%x %x", &reg, &val) != 2)
420 continue;
421 if ((reg <= 0x7f) || (val <= 0x1ff)) {
422 snd_ca0106_i2c_write(emu, reg, val);
423 }
424 }
425}
410 426
411int __devinit snd_ca0106_proc_init(ca0106_t * emu) 427int __devinit snd_ca0106_proc_init(ca0106_t * emu)
412{ 428{
@@ -418,6 +434,7 @@ int __devinit snd_ca0106_proc_init(ca0106_t * emu)
418 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read32); 434 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read32);
419 entry->c.text.write_size = 64; 435 entry->c.text.write_size = 64;
420 entry->c.text.write = snd_ca0106_proc_reg_write32; 436 entry->c.text.write = snd_ca0106_proc_reg_write32;
437 entry->mode |= S_IWUSR;
421 } 438 }
422 if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry)) 439 if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
423 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read16); 440 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read16);
@@ -427,6 +444,14 @@ int __devinit snd_ca0106_proc_init(ca0106_t * emu)
427 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read1); 444 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read1);
428 entry->c.text.write_size = 64; 445 entry->c.text.write_size = 64;
429 entry->c.text.write = snd_ca0106_proc_reg_write; 446 entry->c.text.write = snd_ca0106_proc_reg_write;
447 entry->mode |= S_IWUSR;
448// entry->private_data = emu;
449 }
450 if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
451 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_i2c_write);
452 entry->c.text.write_size = 64;
453 entry->c.text.write = snd_ca0106_proc_i2c_write;
454 entry->mode |= S_IWUSR;
430// entry->private_data = emu; 455// entry->private_data = emu;
431 } 456 }
432 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) 457 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))