2 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>,
3 * Takashi Iwai <tiwai@suse.de>
5 * Routines for control of EMU10K1 chips / mixer routines
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include <sound/driver.h>
30 #include <linux/time.h>
31 #include <linux/init.h>
32 #include <sound/core.h>
33 #include <sound/emu10k1.h>
35 #define chip_t emu10k1_t
37 #define AC97_ID_STAC9758 0x83847658
39 static int snd_emu10k1_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
41 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
46 static int snd_emu10k1_spdif_get(snd_kcontrol_t * kcontrol,
47 snd_ctl_elem_value_t * ucontrol)
49 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
50 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
53 spin_lock_irqsave(&emu->reg_lock, flags);
54 ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff;
55 ucontrol->value.iec958.status[1] = (emu->spdif_bits[idx] >> 8) & 0xff;
56 ucontrol->value.iec958.status[2] = (emu->spdif_bits[idx] >> 16) & 0xff;
57 ucontrol->value.iec958.status[3] = (emu->spdif_bits[idx] >> 24) & 0xff;
58 spin_unlock_irqrestore(&emu->reg_lock, flags);
62 static int snd_emu10k1_spdif_get_mask(snd_kcontrol_t * kcontrol,
63 snd_ctl_elem_value_t * ucontrol)
65 ucontrol->value.iec958.status[0] = 0xff;
66 ucontrol->value.iec958.status[1] = 0xff;
67 ucontrol->value.iec958.status[2] = 0xff;
68 ucontrol->value.iec958.status[3] = 0xff;
72 static int snd_emu10k1_spdif_put(snd_kcontrol_t * kcontrol,
73 snd_ctl_elem_value_t * ucontrol)
75 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
76 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
81 val = (ucontrol->value.iec958.status[0] << 0) |
82 (ucontrol->value.iec958.status[1] << 8) |
83 (ucontrol->value.iec958.status[2] << 16) |
84 (ucontrol->value.iec958.status[3] << 24);
85 spin_lock_irqsave(&emu->reg_lock, flags);
86 change = val != emu->spdif_bits[idx];
88 snd_emu10k1_ptr_write(emu, SPCS0 + idx, 0, val);
89 emu->spdif_bits[idx] = val;
91 spin_unlock_irqrestore(&emu->reg_lock, flags);
95 static snd_kcontrol_new_t snd_emu10k1_spdif_mask_control =
97 .access = SNDRV_CTL_ELEM_ACCESS_READ,
98 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
99 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
101 .info = snd_emu10k1_spdif_info,
102 .get = snd_emu10k1_spdif_get_mask
105 static snd_kcontrol_new_t snd_emu10k1_spdif_control =
107 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
108 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
110 .info = snd_emu10k1_spdif_info,
111 .get = snd_emu10k1_spdif_get,
112 .put = snd_emu10k1_spdif_put
116 static void update_emu10k1_fxrt(emu10k1_t *emu, int voice, unsigned char *route)
119 snd_emu10k1_ptr_write(emu, A_FXRT1, voice,
120 snd_emu10k1_compose_audigy_fxrt1(route));
121 snd_emu10k1_ptr_write(emu, A_FXRT2, voice,
122 snd_emu10k1_compose_audigy_fxrt2(route));
124 snd_emu10k1_ptr_write(emu, FXRT, voice,
125 snd_emu10k1_compose_send_routing(route));
129 static void update_emu10k1_send_volume(emu10k1_t *emu, int voice, unsigned char *volume)
131 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_A, voice, volume[0]);
132 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_B, voice, volume[1]);
133 snd_emu10k1_ptr_write(emu, PSST_FXSENDAMOUNT_C, voice, volume[2]);
134 snd_emu10k1_ptr_write(emu, DSL_FXSENDAMOUNT_D, voice, volume[3]);
136 unsigned int val = ((unsigned int)volume[4] << 24) |
137 ((unsigned int)volume[5] << 16) |
138 ((unsigned int)volume[6] << 8) |
139 (unsigned int)volume[7];
140 snd_emu10k1_ptr_write(emu, A_SENDAMOUNTS, voice, val);
144 static int snd_emu10k1_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
146 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
147 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
148 uinfo->count = emu->audigy ? 3*8 : 3*4;
149 uinfo->value.integer.min = 0;
150 uinfo->value.integer.max = emu->audigy ? 0x3f : 0x0f;
154 static int snd_emu10k1_send_routing_get(snd_kcontrol_t * kcontrol,
155 snd_ctl_elem_value_t * ucontrol)
158 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
159 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
161 int num_efx = emu->audigy ? 8 : 4;
162 int mask = emu->audigy ? 0x3f : 0x0f;
164 spin_lock_irqsave(&emu->reg_lock, flags);
165 for (voice = 0; voice < 3; voice++)
166 for (idx = 0; idx < num_efx; idx++)
167 ucontrol->value.integer.value[(voice * num_efx) + idx] =
168 mix->send_routing[voice][idx] & mask;
169 spin_unlock_irqrestore(&emu->reg_lock, flags);
173 static int snd_emu10k1_send_routing_put(snd_kcontrol_t * kcontrol,
174 snd_ctl_elem_value_t * ucontrol)
177 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
178 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
179 int change = 0, voice, idx, val;
180 int num_efx = emu->audigy ? 8 : 4;
181 int mask = emu->audigy ? 0x3f : 0x0f;
183 spin_lock_irqsave(&emu->reg_lock, flags);
184 for (voice = 0; voice < 3; voice++)
185 for (idx = 0; idx < num_efx; idx++) {
186 val = ucontrol->value.integer.value[(voice * num_efx) + idx] & mask;
187 if (mix->send_routing[voice][idx] != val) {
188 mix->send_routing[voice][idx] = val;
192 if (change && mix->epcm) {
193 if (mix->epcm->voices[0] && mix->epcm->voices[1]) {
194 update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
195 &mix->send_routing[1][0]);
196 update_emu10k1_fxrt(emu, mix->epcm->voices[1]->number,
197 &mix->send_routing[2][0]);
198 } else if (mix->epcm->voices[0]) {
199 update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
200 &mix->send_routing[0][0]);
203 spin_unlock_irqrestore(&emu->reg_lock, flags);
207 static snd_kcontrol_new_t snd_emu10k1_send_routing_control =
209 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
210 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
211 .name = "EMU10K1 PCM Send Routing",
213 .info = snd_emu10k1_send_routing_info,
214 .get = snd_emu10k1_send_routing_get,
215 .put = snd_emu10k1_send_routing_put
218 static int snd_emu10k1_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
220 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
221 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
222 uinfo->count = emu->audigy ? 3*8 : 3*4;
223 uinfo->value.integer.min = 0;
224 uinfo->value.integer.max = 255;
228 static int snd_emu10k1_send_volume_get(snd_kcontrol_t * kcontrol,
229 snd_ctl_elem_value_t * ucontrol)
232 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
233 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
235 int num_efx = emu->audigy ? 8 : 4;
237 spin_lock_irqsave(&emu->reg_lock, flags);
238 for (idx = 0; idx < 3*num_efx; idx++)
239 ucontrol->value.integer.value[idx] = mix->send_volume[idx/num_efx][idx%num_efx];
240 spin_unlock_irqrestore(&emu->reg_lock, flags);
244 static int snd_emu10k1_send_volume_put(snd_kcontrol_t * kcontrol,
245 snd_ctl_elem_value_t * ucontrol)
248 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
249 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
250 int change = 0, idx, val;
251 int num_efx = emu->audigy ? 8 : 4;
253 spin_lock_irqsave(&emu->reg_lock, flags);
254 for (idx = 0; idx < 3*num_efx; idx++) {
255 val = ucontrol->value.integer.value[idx] & 255;
256 if (mix->send_volume[idx/num_efx][idx%num_efx] != val) {
257 mix->send_volume[idx/num_efx][idx%num_efx] = val;
261 if (change && mix->epcm) {
262 if (mix->epcm->voices[0] && mix->epcm->voices[1]) {
263 update_emu10k1_send_volume(emu, mix->epcm->voices[0]->number,
264 &mix->send_volume[1][0]);
265 update_emu10k1_send_volume(emu, mix->epcm->voices[1]->number,
266 &mix->send_volume[2][0]);
267 } else if (mix->epcm->voices[0]) {
268 update_emu10k1_send_volume(emu, mix->epcm->voices[0]->number,
269 &mix->send_volume[0][0]);
272 spin_unlock_irqrestore(&emu->reg_lock, flags);
276 static snd_kcontrol_new_t snd_emu10k1_send_volume_control =
278 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
279 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
280 .name = "EMU10K1 PCM Send Volume",
282 .info = snd_emu10k1_send_volume_info,
283 .get = snd_emu10k1_send_volume_get,
284 .put = snd_emu10k1_send_volume_put
287 static int snd_emu10k1_attn_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
289 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
291 uinfo->value.integer.min = 0;
292 uinfo->value.integer.max = 0xffff;
296 static int snd_emu10k1_attn_get(snd_kcontrol_t * kcontrol,
297 snd_ctl_elem_value_t * ucontrol)
299 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
300 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
304 spin_lock_irqsave(&emu->reg_lock, flags);
305 for (idx = 0; idx < 3; idx++)
306 ucontrol->value.integer.value[idx] = mix->attn[idx];
307 spin_unlock_irqrestore(&emu->reg_lock, flags);
311 static int snd_emu10k1_attn_put(snd_kcontrol_t * kcontrol,
312 snd_ctl_elem_value_t * ucontrol)
315 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
316 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
317 int change = 0, idx, val;
319 spin_lock_irqsave(&emu->reg_lock, flags);
320 for (idx = 0; idx < 3; idx++) {
321 val = ucontrol->value.integer.value[idx] & 0xffff;
322 if (mix->attn[idx] != val) {
323 mix->attn[idx] = val;
327 if (change && mix->epcm) {
328 if (mix->epcm->voices[0] && mix->epcm->voices[1]) {
329 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[0]->number, mix->attn[1]);
330 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[1]->number, mix->attn[2]);
331 } else if (mix->epcm->voices[0]) {
332 snd_emu10k1_ptr_write(emu, VTFT_VOLUMETARGET, mix->epcm->voices[0]->number, mix->attn[0]);
335 spin_unlock_irqrestore(&emu->reg_lock, flags);
339 static snd_kcontrol_new_t snd_emu10k1_attn_control =
341 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
342 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
343 .name = "EMU10K1 PCM Volume",
345 .info = snd_emu10k1_attn_info,
346 .get = snd_emu10k1_attn_get,
347 .put = snd_emu10k1_attn_put
350 static int snd_emu10k1_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
352 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
354 uinfo->value.integer.min = 0;
355 uinfo->value.integer.max = 1;
359 static int snd_emu10k1_shared_spdif_get(snd_kcontrol_t * kcontrol,
360 snd_ctl_elem_value_t * ucontrol)
362 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
365 ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0;
367 ucontrol->value.integer.value[0] = inl(emu->port + HCFG) & HCFG_GPOUT0 ? 1 : 0;
371 static int snd_emu10k1_shared_spdif_put(snd_kcontrol_t * kcontrol,
372 snd_ctl_elem_value_t * ucontrol)
375 emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
376 unsigned int reg, val;
379 spin_lock_irqsave(&emu->reg_lock, flags);
381 reg = inl(emu->port + A_IOCFG);
382 val = ucontrol->value.integer.value[0] ? A_IOCFG_GPOUT0 : 0;
383 change = (reg & A_IOCFG_GPOUT0) != val;
385 reg &= ~A_IOCFG_GPOUT0;
387 outl(reg | val, emu->port + A_IOCFG);
390 reg = inl(emu->port + HCFG);
391 val = ucontrol->value.integer.value[0] ? HCFG_GPOUT0 : 0;
392 change |= (reg & HCFG_GPOUT0) != val;
396 outl(reg | val, emu->port + HCFG);
398 spin_unlock_irqrestore(&emu->reg_lock, flags);
402 static snd_kcontrol_new_t snd_emu10k1_shared_spdif __devinitdata =
404 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
405 .name = "SB Live Analog/Digital Output Jack",
406 .info = snd_emu10k1_shared_spdif_info,
407 .get = snd_emu10k1_shared_spdif_get,
408 .put = snd_emu10k1_shared_spdif_put
411 static snd_kcontrol_new_t snd_audigy_shared_spdif __devinitdata =
413 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
414 .name = "Audigy Analog/Digital Output Jack",
415 .info = snd_emu10k1_shared_spdif_info,
416 .get = snd_emu10k1_shared_spdif_get,
417 .put = snd_emu10k1_shared_spdif_put
422 static void snd_emu10k1_mixer_free_ac97(ac97_t *ac97)
424 emu10k1_t *emu = snd_magic_cast(emu10k1_t, ac97->private_data, return);
430 static int remove_ctl(snd_card_t *card, const char *name)
432 snd_ctl_elem_id_t id;
433 memset(&id, 0, sizeof(id));
434 strcpy(id.name, name);
435 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
436 return snd_ctl_remove_id(card, &id);
439 static snd_kcontrol_t *ctl_find(snd_card_t *card, const char *name)
441 snd_ctl_elem_id_t sid;
442 memset(&sid, 0, sizeof(sid));
443 strcpy(sid.name, name);
444 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
445 return snd_ctl_find_id(card, &sid);
448 static int rename_ctl(snd_card_t *card, const char *src, const char *dst)
450 snd_kcontrol_t *kctl = ctl_find(card, src);
452 strcpy(kctl->id.name, dst);
458 int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
461 snd_kcontrol_t *kctl;
462 snd_card_t *card = emu->card;
464 static char *emu10k1_remove_ctls[] = {
465 /* no AC97 mono, surround, center/lfe */
466 "Master Mono Playback Switch",
467 "Master Mono Playback Volume",
468 "PCM Out Path & Mute",
469 "Mono Output Select",
470 "Surround Playback Switch",
471 "Surround Playback Volume",
472 "Center Playback Switch",
473 "Center Playback Volume",
474 "LFE Playback Switch",
475 "LFE Playback Volume",
478 static char *emu10k1_rename_ctls[] = {
479 "Surround Digital Playback Volume", "Surround Playback Volume",
480 "Center Digital Playback Volume", "Center Playback Volume",
481 "LFE Digital Playback Volume", "LFE Playback Volume",
484 static char *audigy_remove_ctls[] = {
485 /* Master/PCM controls on ac97 of Audigy has no effect */
486 "PCM Playback Switch",
487 "PCM Playback Volume",
488 "Master Mono Playback Switch",
489 "Master Mono Playback Volume",
490 "Master Playback Switch",
491 "Master Playback Volume",
492 "PCM Out Path & Mute",
493 "Mono Output Select",
494 /* remove unused AC97 capture controls */
499 "Video Playback Switch",
500 "Video Playback Volume",
501 "Mic Playback Switch",
502 "Mic Playback Volume",
505 static char *audigy_rename_ctls[] = {
506 /* use conventional names */
507 "Wave Playback Volume", "PCM Playback Volume",
508 /* "Wave Capture Volume", "PCM Capture Volume", */
509 "Wave Master Playback Volume", "Master Playback Volume",
510 "AMic Playback Volume", "Mic Playback Volume",
515 ac97_bus_t bus, *pbus;
518 memset(&bus, 0, sizeof(bus));
519 bus.write = snd_emu10k1_ac97_write;
520 bus.read = snd_emu10k1_ac97_read;
521 if ((err = snd_ac97_bus(emu->card, &bus, &pbus)) < 0)
524 memset(&ac97, 0, sizeof(ac97));
525 ac97.private_data = emu;
526 ac97.private_free = snd_emu10k1_mixer_free_ac97;
527 if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
530 /* set master volume to 0 dB */
531 snd_ac97_write(emu->ac97, AC97_MASTER, 0x0202);
532 /* set capture source to mic */
533 snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000);
534 c = audigy_remove_ctls;
537 * Credits for cards based on STAC9758:
538 * James Courtier-Dutton <James@superbug.demon.co.uk>
539 * Voluspa <voluspa@comhem.se>
541 if (emu->ac97->id == AC97_ID_STAC9758) {
543 snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE|AC97SLOT_REAR_LEFT|AC97SLOT_REAR_RIGHT);
545 /* remove unused AC97 controls */
546 snd_ac97_write(emu->ac97, AC97_SURROUND_MASTER, 0x0202);
547 snd_ac97_write(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202);
548 c = emu10k1_remove_ctls;
551 remove_ctl(card, *c);
554 strcpy(emu->card->mixername, "EMU APS");
555 else if (emu->audigy)
556 strcpy(emu->card->mixername, "SB Audigy");
558 strcpy(emu->card->mixername, "Emu10k1");
562 c = audigy_rename_ctls;
564 c = emu10k1_rename_ctls;
566 rename_ctl(card, c[0], c[1]);
568 if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
570 if ((err = snd_ctl_add(card, kctl)))
572 if ((kctl = emu->ctl_send_volume = snd_ctl_new1(&snd_emu10k1_send_volume_control, emu)) == NULL)
574 if ((err = snd_ctl_add(card, kctl)))
576 if ((kctl = emu->ctl_attn = snd_ctl_new1(&snd_emu10k1_attn_control, emu)) == NULL)
578 if ((err = snd_ctl_add(card, kctl)))
581 /* intiailize the routing and volume table for each pcm playback stream */
582 for (pcm = 0; pcm < 32; pcm++) {
583 emu10k1_pcm_mixer_t *mix;
586 mix = &emu->pcm_mixer[pcm];
589 for (v = 0; v < 4; v++)
590 mix->send_routing[0][v] =
591 mix->send_routing[1][v] =
592 mix->send_routing[2][v] = v;
594 memset(&mix->send_volume, 0, sizeof(mix->send_volume));
595 mix->send_volume[0][0] = mix->send_volume[0][1] =
596 mix->send_volume[1][0] = mix->send_volume[2][1] = 255;
598 mix->attn[0] = mix->attn[1] = mix->attn[2] = 0xffff;
601 if (! emu->APS) { /* FIXME: APS has these controls? */
602 /* sb live! and audigy */
603 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
605 if ((err = snd_ctl_add(card, kctl)))
607 if ((kctl = ctl_find(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT))) != NULL) {
608 /* already defined by ac97, remove it */
609 /* FIXME: or do we need both controls? */
610 remove_ctl(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT));
612 if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
614 if ((err = snd_ctl_add(card, kctl)))
619 if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL)
621 if ((err = snd_ctl_add(card, kctl)))
623 } else if (! emu->APS) {
625 if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
627 if ((err = snd_ctl_add(card, kctl)))