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
6 * FEATURES currently supported:
7 * See ca0106_main.c for features.
10 * Support interrupts per period.
11 * Removed noise from Center/LFE channel when in Analog mode.
12 * Rename and remove mixer controls.
14 * Use separate card based DMA buffer for periods table list.
16 * Change remove and rename ctrls into lists.
18 * Try to fix capture sources.
21 * Enable S32_LE format support.
23 * Enable playback 48000 and 96000 rates. (Rates other that these do not work, even with "plug:front".)
25 * Add Model name recognition.
27 * Correct interrupt timing. interrupt at end of period, instead of in the middle of a playback period.
28 * Remove redundent "voice" handling.
30 * Single trigger call for multi channels.
32 * Set limits based on what the sound card hardware can do.
33 * playback periods_min=2, periods_max=8
34 * capture hw constraints require period_size = n * 64 bytes.
35 * playback hw constraints require period_size = n * 64 bytes.
37 * Separated ca0106.c into separate functional .c files.
39 * Modified Copyright message.
41 * Implement Mic and Line in Capture.
43 * 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 * This program is free software; you can redistribute it and/or modify
47 * it under the terms of the GNU General Public License as published by
48 * the Free Software Foundation; either version 2 of the License, or
49 * (at your option) any later version.
51 * This program is distributed in the hope that it will be useful,
52 * but WITHOUT ANY WARRANTY; without even the implied warranty of
53 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 * GNU General Public License for more details.
56 * You should have received a copy of the GNU General Public License
57 * along with this program; if not, write to the Free Software
58 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
61 #include <sound/driver.h>
62 #include <linux/delay.h>
63 #include <linux/init.h>
64 #include <linux/interrupt.h>
65 #include <linux/pci.h>
66 #include <linux/slab.h>
67 #include <linux/moduleparam.h>
68 #include <sound/core.h>
69 #include <sound/initval.h>
70 #include <sound/pcm.h>
71 #include <sound/ac97_codec.h>
72 #include <sound/info.h>
73 #include <sound/tlv.h>
77 static DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale1, -5175, 25, 1);
78 static DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale2, -10350, 50, 1);
80 static int snd_ca0106_shared_spdif_info(struct snd_kcontrol *kcontrol,
81 struct snd_ctl_elem_info *uinfo)
83 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
85 uinfo->value.integer.min = 0;
86 uinfo->value.integer.max = 1;
90 static int snd_ca0106_shared_spdif_get(struct snd_kcontrol *kcontrol,
91 struct snd_ctl_elem_value *ucontrol)
93 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
95 ucontrol->value.enumerated.item[0] = emu->spdif_enable;
99 static int snd_ca0106_shared_spdif_put(struct snd_kcontrol *kcontrol,
100 struct snd_ctl_elem_value *ucontrol)
102 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
107 val = ucontrol->value.enumerated.item[0] ;
108 change = (emu->spdif_enable != val);
110 emu->spdif_enable = val;
113 snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
114 snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000);
115 snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0,
116 snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000);
117 mask = inl(emu->port + GPIO) & ~0x101;
118 outl(mask, emu->port + GPIO);
122 snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
123 snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000);
124 snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0,
125 snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000);
126 mask = inl(emu->port + GPIO) | 0x101;
127 outl(mask, emu->port + GPIO);
133 static int snd_ca0106_capture_source_info(struct snd_kcontrol *kcontrol,
134 struct snd_ctl_elem_info *uinfo)
136 static char *texts[6] = {
137 "IEC958 out", "i2s mixer out", "IEC958 in", "i2s in", "AC97 in", "SRC out"
140 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
142 uinfo->value.enumerated.items = 6;
143 if (uinfo->value.enumerated.item > 5)
144 uinfo->value.enumerated.item = 5;
145 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
149 static int snd_ca0106_capture_source_get(struct snd_kcontrol *kcontrol,
150 struct snd_ctl_elem_value *ucontrol)
152 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
154 ucontrol->value.enumerated.item[0] = emu->capture_source;
158 static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
159 struct snd_ctl_elem_value *ucontrol)
161 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
167 val = ucontrol->value.enumerated.item[0] ;
168 change = (emu->capture_source != val);
170 emu->capture_source = val;
171 source = (val << 28) | (val << 24) | (val << 20) | (val << 16);
172 mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff;
173 snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask);
178 static int snd_ca0106_i2c_capture_source_info(struct snd_kcontrol *kcontrol,
179 struct snd_ctl_elem_info *uinfo)
181 static char *texts[6] = {
182 "Phone", "Mic", "Line in", "Aux"
185 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
187 uinfo->value.enumerated.items = 4;
188 if (uinfo->value.enumerated.item > 3)
189 uinfo->value.enumerated.item = 3;
190 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
194 static int snd_ca0106_i2c_capture_source_get(struct snd_kcontrol *kcontrol,
195 struct snd_ctl_elem_value *ucontrol)
197 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
199 ucontrol->value.enumerated.item[0] = emu->i2c_capture_source;
203 static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
204 struct snd_ctl_elem_value *ucontrol)
206 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
207 unsigned int source_id;
208 unsigned int ngain, ogain;
211 /* If the capture source has changed,
212 * update the capture volume from the cached value
213 * for the particular source.
215 source_id = ucontrol->value.enumerated.item[0] ;
216 change = (emu->i2c_capture_source != source_id);
218 snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
219 ngain = emu->i2c_capture_volume[source_id][0]; /* Left */
220 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */
222 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
223 ngain = emu->i2c_capture_volume[source_id][1]; /* Left */
224 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Left */
226 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
227 source = 1 << source_id;
228 snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */
229 emu->i2c_capture_source = source_id;
234 static int snd_ca0106_capture_line_in_side_out_info(struct snd_kcontrol *kcontrol,
235 struct snd_ctl_elem_info *uinfo)
237 static char *texts[2] = { "Side out", "Line in" };
239 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
241 uinfo->value.enumerated.items = 2;
242 if (uinfo->value.enumerated.item > 1)
243 uinfo->value.enumerated.item = 1;
244 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
248 static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol,
249 struct snd_ctl_elem_info *uinfo)
251 static char *texts[2] = { "Line in", "Mic in" };
253 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
255 uinfo->value.enumerated.items = 2;
256 if (uinfo->value.enumerated.item > 1)
257 uinfo->value.enumerated.item = 1;
258 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
262 static int snd_ca0106_capture_mic_line_in_get(struct snd_kcontrol *kcontrol,
263 struct snd_ctl_elem_value *ucontrol)
265 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
267 ucontrol->value.enumerated.item[0] = emu->capture_mic_line_in;
271 static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
272 struct snd_ctl_elem_value *ucontrol)
274 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
279 val = ucontrol->value.enumerated.item[0] ;
280 change = (emu->capture_mic_line_in != val);
282 emu->capture_mic_line_in = val;
284 //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
285 tmp = inl(emu->port+GPIO) & ~0x400;
287 outl(tmp, emu->port+GPIO);
288 //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC);
290 //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
291 tmp = inl(emu->port+GPIO) & ~0x400;
292 outl(tmp, emu->port+GPIO);
293 //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN);
299 static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata =
301 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
302 .name = "Shared Mic/Line in Capture Switch",
303 .info = snd_ca0106_capture_mic_line_in_info,
304 .get = snd_ca0106_capture_mic_line_in_get,
305 .put = snd_ca0106_capture_mic_line_in_put
308 static struct snd_kcontrol_new snd_ca0106_capture_line_in_side_out __devinitdata =
310 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
311 .name = "Shared Line in/Side out Capture Switch",
312 .info = snd_ca0106_capture_line_in_side_out_info,
313 .get = snd_ca0106_capture_mic_line_in_get,
314 .put = snd_ca0106_capture_mic_line_in_put
318 static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol,
319 struct snd_ctl_elem_info *uinfo)
321 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
326 static int snd_ca0106_spdif_get(struct snd_kcontrol *kcontrol,
327 struct snd_ctl_elem_value *ucontrol)
329 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
330 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
332 ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff;
333 ucontrol->value.iec958.status[1] = (emu->spdif_bits[idx] >> 8) & 0xff;
334 ucontrol->value.iec958.status[2] = (emu->spdif_bits[idx] >> 16) & 0xff;
335 ucontrol->value.iec958.status[3] = (emu->spdif_bits[idx] >> 24) & 0xff;
339 static int snd_ca0106_spdif_get_mask(struct snd_kcontrol *kcontrol,
340 struct snd_ctl_elem_value *ucontrol)
342 ucontrol->value.iec958.status[0] = 0xff;
343 ucontrol->value.iec958.status[1] = 0xff;
344 ucontrol->value.iec958.status[2] = 0xff;
345 ucontrol->value.iec958.status[3] = 0xff;
349 static int snd_ca0106_spdif_put(struct snd_kcontrol *kcontrol,
350 struct snd_ctl_elem_value *ucontrol)
352 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
353 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
357 val = (ucontrol->value.iec958.status[0] << 0) |
358 (ucontrol->value.iec958.status[1] << 8) |
359 (ucontrol->value.iec958.status[2] << 16) |
360 (ucontrol->value.iec958.status[3] << 24);
361 change = val != emu->spdif_bits[idx];
363 snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, val);
364 emu->spdif_bits[idx] = val;
369 static int snd_ca0106_volume_info(struct snd_kcontrol *kcontrol,
370 struct snd_ctl_elem_info *uinfo)
372 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
374 uinfo->value.integer.min = 0;
375 uinfo->value.integer.max = 255;
379 static int snd_ca0106_volume_get(struct snd_kcontrol *kcontrol,
380 struct snd_ctl_elem_value *ucontrol)
382 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
386 channel_id = (kcontrol->private_value >> 8) & 0xff;
387 reg = kcontrol->private_value & 0xff;
389 value = snd_ca0106_ptr_read(emu, reg, channel_id);
390 ucontrol->value.integer.value[0] = 0xff - ((value >> 24) & 0xff); /* Left */
391 ucontrol->value.integer.value[1] = 0xff - ((value >> 16) & 0xff); /* Right */
395 static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol,
396 struct snd_ctl_elem_value *ucontrol)
398 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
399 unsigned int oval, nval;
402 channel_id = (kcontrol->private_value >> 8) & 0xff;
403 reg = kcontrol->private_value & 0xff;
405 oval = snd_ca0106_ptr_read(emu, reg, channel_id);
406 nval = ((0xff - ucontrol->value.integer.value[0]) << 24) |
407 ((0xff - ucontrol->value.integer.value[1]) << 16);
408 nval |= ((0xff - ucontrol->value.integer.value[0]) << 8) |
409 ((0xff - ucontrol->value.integer.value[1]) );
412 snd_ca0106_ptr_write(emu, reg, channel_id, nval);
416 static int snd_ca0106_i2c_volume_info(struct snd_kcontrol *kcontrol,
417 struct snd_ctl_elem_info *uinfo)
419 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
421 uinfo->value.integer.min = 0;
422 uinfo->value.integer.max = 255;
426 static int snd_ca0106_i2c_volume_get(struct snd_kcontrol *kcontrol,
427 struct snd_ctl_elem_value *ucontrol)
429 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
432 source_id = kcontrol->private_value;
434 ucontrol->value.integer.value[0] = emu->i2c_capture_volume[source_id][0];
435 ucontrol->value.integer.value[1] = emu->i2c_capture_volume[source_id][1];
439 static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,
440 struct snd_ctl_elem_value *ucontrol)
442 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
448 source_id = kcontrol->private_value;
449 ogain = emu->i2c_capture_volume[source_id][0]; /* Left */
450 ngain = ucontrol->value.integer.value[0];
453 if (ogain != ngain) {
454 if (emu->i2c_capture_source == source_id)
455 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
456 emu->i2c_capture_volume[source_id][0] = ucontrol->value.integer.value[0];
459 ogain = emu->i2c_capture_volume[source_id][1]; /* Right */
460 ngain = ucontrol->value.integer.value[1];
463 if (ogain != ngain) {
464 if (emu->i2c_capture_source == source_id)
465 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
466 emu->i2c_capture_volume[source_id][1] = ucontrol->value.integer.value[1];
473 #define CA_VOLUME(xname,chid,reg) \
475 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
476 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
477 SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
478 .info = snd_ca0106_volume_info, \
479 .get = snd_ca0106_volume_get, \
480 .put = snd_ca0106_volume_put, \
481 .tlv = { .p = snd_ca0106_db_scale1 }, \
482 .private_value = ((chid) << 8) | (reg) \
485 #define I2C_VOLUME(xname,chid) \
487 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
488 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
489 SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
490 .info = snd_ca0106_i2c_volume_info, \
491 .get = snd_ca0106_i2c_volume_get, \
492 .put = snd_ca0106_i2c_volume_put, \
493 .tlv = { .p = snd_ca0106_db_scale2 }, \
494 .private_value = chid \
498 static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = {
499 CA_VOLUME("Analog Front Playback Volume",
500 CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2),
501 CA_VOLUME("Analog Rear Playback Volume",
502 CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2),
503 CA_VOLUME("Analog Center/LFE Playback Volume",
504 CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2),
505 CA_VOLUME("Analog Side Playback Volume",
506 CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2),
508 CA_VOLUME("IEC958 Front Playback Volume",
509 CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME1),
510 CA_VOLUME("IEC958 Rear Playback Volume",
511 CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME1),
512 CA_VOLUME("IEC958 Center/LFE Playback Volume",
513 CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME1),
514 CA_VOLUME("IEC958 Unknown Playback Volume",
515 CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME1),
517 CA_VOLUME("CAPTURE feedback Playback Volume",
520 I2C_VOLUME("Phone Capture Volume", 0),
521 I2C_VOLUME("Mic Capture Volume", 1),
522 I2C_VOLUME("Line in Capture Volume", 2),
523 I2C_VOLUME("Aux Capture Volume", 3),
526 .access = SNDRV_CTL_ELEM_ACCESS_READ,
527 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
528 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
530 .info = snd_ca0106_spdif_info,
531 .get = snd_ca0106_spdif_get_mask
534 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
535 .name = "IEC958 Playback Switch",
536 .info = snd_ca0106_shared_spdif_info,
537 .get = snd_ca0106_shared_spdif_get,
538 .put = snd_ca0106_shared_spdif_put
541 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
542 .name = "Digital Capture Source",
543 .info = snd_ca0106_capture_source_info,
544 .get = snd_ca0106_capture_source_get,
545 .put = snd_ca0106_capture_source_put
548 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
549 .name = "Capture Source",
550 .info = snd_ca0106_i2c_capture_source_info,
551 .get = snd_ca0106_i2c_capture_source_get,
552 .put = snd_ca0106_i2c_capture_source_put
555 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
556 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
558 .info = snd_ca0106_spdif_info,
559 .get = snd_ca0106_spdif_get,
560 .put = snd_ca0106_spdif_put
564 static int __devinit remove_ctl(struct snd_card *card, const char *name)
566 struct snd_ctl_elem_id id;
567 memset(&id, 0, sizeof(id));
568 strcpy(id.name, name);
569 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
570 return snd_ctl_remove_id(card, &id);
573 static struct snd_kcontrol __devinit *ctl_find(struct snd_card *card, const char *name)
575 struct snd_ctl_elem_id sid;
576 memset(&sid, 0, sizeof(sid));
577 /* FIXME: strcpy is bad. */
578 strcpy(sid.name, name);
579 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
580 return snd_ctl_find_id(card, &sid);
583 static int __devinit rename_ctl(struct snd_card *card, const char *src, const char *dst)
585 struct snd_kcontrol *kctl = ctl_find(card, src);
587 strcpy(kctl->id.name, dst);
593 int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
596 struct snd_card *card = emu->card;
598 static char *ca0106_remove_ctls[] = {
599 "Master Mono Playback Switch",
600 "Master Mono Playback Volume",
601 "3D Control - Switch",
602 "3D Control Sigmatel - Depth",
603 "PCM Playback Switch",
604 "PCM Playback Volume",
605 "CD Playback Switch",
606 "CD Playback Volume",
607 "Phone Playback Switch",
608 "Phone Playback Volume",
609 "Video Playback Switch",
610 "Video Playback Volume",
611 "PC Speaker Playback Switch",
612 "PC Speaker Playback Volume",
613 "Mono Output Select",
617 "External Amplifier",
618 "Sigmatel 4-Speaker Stereo Playback Switch",
619 "Sigmatel Surround Phase Inversion Playback ",
622 static char *ca0106_rename_ctls[] = {
623 "Master Playback Switch", "Capture Switch",
624 "Master Playback Volume", "Capture Volume",
625 "Line Playback Switch", "AC97 Line Capture Switch",
626 "Line Playback Volume", "AC97 Line Capture Volume",
627 "Aux Playback Switch", "AC97 Aux Capture Switch",
628 "Aux Playback Volume", "AC97 Aux Capture Volume",
629 "Mic Playback Switch", "AC97 Mic Capture Switch",
630 "Mic Playback Volume", "AC97 Mic Capture Volume",
631 "Mic Select", "AC97 Mic Select",
632 "Mic Boost (+20dB)", "AC97 Mic Boost (+20dB)",
636 for (c = ca0106_remove_ctls; *c; c++)
637 remove_ctl(card, *c);
638 for (c = ca0106_rename_ctls; *c; c += 2)
639 rename_ctl(card, c[0], c[1]);
642 for (i = 0; i < ARRAY_SIZE(snd_ca0106_volume_ctls); i++) {
643 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_volume_ctls[i], emu));
647 if (emu->details->i2c_adc == 1) {
648 if (emu->details->gpio_type == 1)
649 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_mic_line_in, emu));
650 else /* gpio_type == 2 */
651 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_line_in_side_out, emu));