aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ca0106/ca0106_proc.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-05-27 16:07:23 -0400
committerJaroslav Kysela <perex@suse.cz>2005-06-22 06:27:06 -0400
commit7199acdc74dc16d2e75f83b8c65301ad19c40ef3 (patch)
tree923cbbe39b3e82e3f24ffcc04dce864995d6a199 /sound/pci/ca0106/ca0106_proc.c
parentda04b128cf0d74dd4cab270c53d9264e70f9203e (diff)
[ALSA] Implement support for Line-in capture on SB Live 24bit.
CA0106 driver Notes: MIC capture not tested yet. Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Diffstat (limited to 'sound/pci/ca0106/ca0106_proc.c')
-rw-r--r--sound/pci/ca0106/ca0106_proc.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index 3e5161a32363..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 *
@@ -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{
@@ -431,6 +447,13 @@ int __devinit snd_ca0106_proc_init(ca0106_t * emu)
431 entry->mode |= S_IWUSR; 447 entry->mode |= S_IWUSR;
432// entry->private_data = emu; 448// entry->private_data = emu;
433 } 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;
455// entry->private_data = emu;
456 }
434 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) 457 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
435 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read2); 458 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read2);
436 return 0; 459 return 0;