aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/ca0106/ca0106_proc.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-05-27 22:07:23 +0200
committerJaroslav Kysela <perex@suse.cz>2005-06-22 12:27:06 +0200
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 3e5161a3236..1c9cc821d1b 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
- * Version: 0.0.17
+ * Version: 0.0.18
*
* FEATURES currently supported:
* See ca0106_main.c for features.
@@ -39,7 +39,9 @@
* Modified Copyright message.
* 0.0.17
* Add iec958 file in proc file system to show status of SPDIF in.
- *
+ * 0.0.18
+ * Implement support for Line-in capture on SB Live 24bit.
+ *
* This code was initally based on code from ALSA's emu10k1x.c which is:
* Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
*
@@ -407,6 +409,20 @@ static void snd_ca0106_proc_reg_write(snd_info_entry_t *entry,
}
}
+static void snd_ca0106_proc_i2c_write(snd_info_entry_t *entry,
+ snd_info_buffer_t * buffer)
+{
+ ca0106_t *emu = entry->private_data;
+ char line[64];
+ unsigned int reg, val;
+ while (!snd_info_get_line(buffer, line, sizeof(line))) {
+ if (sscanf(line, "%x %x", &reg, &val) != 2)
+ continue;
+ if ((reg <= 0x7f) || (val <= 0x1ff)) {
+ snd_ca0106_i2c_write(emu, reg, val);
+ }
+ }
+}
int __devinit snd_ca0106_proc_init(ca0106_t * emu)
{
@@ -431,6 +447,13 @@ int __devinit snd_ca0106_proc_init(ca0106_t * emu)
entry->mode |= S_IWUSR;
// entry->private_data = emu;
}
+ if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
+ snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_i2c_write);
+ entry->c.text.write_size = 64;
+ entry->c.text.write = snd_ca0106_proc_i2c_write;
+ entry->mode |= S_IWUSR;
+// entry->private_data = emu;
+ }
if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read2);
return 0;