Lines Matching +full:hall +full:- +full:effect

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Quirks and vendor-specific extensions for mixer interfaces
48 * See the quirks for M-Audio FTUs or Ebox-44.
68 return -ENOMEM; in snd_create_std_mono_ctl_offset()
70 snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid); in snd_create_std_mono_ctl_offset()
71 cval->val_type = val_type; in snd_create_std_mono_ctl_offset()
72 cval->channels = 1; in snd_create_std_mono_ctl_offset()
73 cval->control = control; in snd_create_std_mono_ctl_offset()
74 cval->cmask = cmask; in snd_create_std_mono_ctl_offset()
75 cval->idx_off = idx_off; in snd_create_std_mono_ctl_offset()
78 * so provide a short-cut for booleans */ in snd_create_std_mono_ctl_offset()
79 cval->min = 0; in snd_create_std_mono_ctl_offset()
80 cval->max = 1; in snd_create_std_mono_ctl_offset()
81 cval->res = 0; in snd_create_std_mono_ctl_offset()
82 cval->dBmin = 0; in snd_create_std_mono_ctl_offset()
83 cval->dBmax = 0; in snd_create_std_mono_ctl_offset()
89 return -ENOMEM; in snd_create_std_mono_ctl_offset()
93 snprintf(kctl->id.name, sizeof(kctl->id.name), name); in snd_create_std_mono_ctl_offset()
94 kctl->private_free = snd_usb_mixer_elem_free; in snd_create_std_mono_ctl_offset()
98 kctl->tlv.c = tlv_callback; in snd_create_std_mono_ctl_offset()
99 kctl->vd[0].access |= in snd_create_std_mono_ctl_offset()
104 return snd_usb_mixer_add_control(&cval->head, kctl); in snd_create_std_mono_ctl_offset()
127 while (t->name != NULL) { in snd_create_std_mono_table()
128 err = snd_create_std_mono_ctl(mixer, t->unitid, t->control, in snd_create_std_mono_table()
129 t->cmask, t->val_type, t->name, t->tlv_callback); in snd_create_std_mono_table()
149 return -ENOMEM; in add_single_ctl_with_resume()
152 list->mixer = mixer; in add_single_ctl_with_resume()
153 list->id = id; in add_single_ctl_with_resume()
154 list->resume = resume; in add_single_ctl_with_resume()
158 return -ENOMEM; in add_single_ctl_with_resume()
160 kctl->private_free = snd_usb_mixer_elem_free; in add_single_ctl_with_resume()
171 * Live! 24-bit: 06 80 xx yy 22 83
184 { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */
185 { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 */
186 { USB_ID(0x041e, 0x30df), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
187 { USB_ID(0x041e, 0x3237), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
188 { USB_ID(0x041e, 0x3263), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
194 struct usb_mixer_interface *mixer = urb->context; in snd_usb_soundblaster_remote_complete()
195 const struct rc_config *rc = mixer->rc_cfg; in snd_usb_soundblaster_remote_complete()
198 if (urb->status < 0 || urb->actual_length < rc->min_packet_length) in snd_usb_soundblaster_remote_complete()
201 code = mixer->rc_buffer[rc->offset]; in snd_usb_soundblaster_remote_complete()
202 if (rc->length == 2) in snd_usb_soundblaster_remote_complete()
203 code |= mixer->rc_buffer[rc->offset + 1] << 8; in snd_usb_soundblaster_remote_complete()
206 if (code == rc->mute_code) in snd_usb_soundblaster_remote_complete()
207 snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id); in snd_usb_soundblaster_remote_complete()
208 mixer->rc_code = code; in snd_usb_soundblaster_remote_complete()
210 wake_up(&mixer->rc_waitq); in snd_usb_soundblaster_remote_complete()
216 struct usb_mixer_interface *mixer = hw->private_data; in snd_usb_sbrc_hwdep_read()
221 return -EINVAL; in snd_usb_sbrc_hwdep_read()
222 err = wait_event_interruptible(mixer->rc_waitq, in snd_usb_sbrc_hwdep_read()
223 (rc_code = xchg(&mixer->rc_code, 0)) != 0); in snd_usb_sbrc_hwdep_read()
236 struct usb_mixer_interface *mixer = hw->private_data; in snd_usb_sbrc_hwdep_poll()
238 poll_wait(file, &mixer->rc_waitq, wait); in snd_usb_sbrc_hwdep_poll()
239 return mixer->rc_code ? EPOLLIN | EPOLLRDNORM : 0; in snd_usb_sbrc_hwdep_poll()
248 if (rc_configs[i].usb_id == mixer->chip->usb_id) in snd_usb_soundblaster_remote_init()
252 mixer->rc_cfg = &rc_configs[i]; in snd_usb_soundblaster_remote_init()
254 len = mixer->rc_cfg->packet_length; in snd_usb_soundblaster_remote_init()
256 init_waitqueue_head(&mixer->rc_waitq); in snd_usb_soundblaster_remote_init()
257 err = snd_hwdep_new(mixer->chip->card, "SB remote control", 0, &hwdep); in snd_usb_soundblaster_remote_init()
260 snprintf(hwdep->name, sizeof(hwdep->name), in snd_usb_soundblaster_remote_init()
261 "%s remote control", mixer->chip->card->shortname); in snd_usb_soundblaster_remote_init()
262 hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC; in snd_usb_soundblaster_remote_init()
263 hwdep->private_data = mixer; in snd_usb_soundblaster_remote_init()
264 hwdep->ops.read = snd_usb_sbrc_hwdep_read; in snd_usb_soundblaster_remote_init()
265 hwdep->ops.poll = snd_usb_sbrc_hwdep_poll; in snd_usb_soundblaster_remote_init()
266 hwdep->exclusive = 1; in snd_usb_soundblaster_remote_init()
268 mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL); in snd_usb_soundblaster_remote_init()
269 if (!mixer->rc_urb) in snd_usb_soundblaster_remote_init()
270 return -ENOMEM; in snd_usb_soundblaster_remote_init()
271 mixer->rc_setup_packet = kmalloc(sizeof(*mixer->rc_setup_packet), GFP_KERNEL); in snd_usb_soundblaster_remote_init()
272 if (!mixer->rc_setup_packet) { in snd_usb_soundblaster_remote_init()
273 usb_free_urb(mixer->rc_urb); in snd_usb_soundblaster_remote_init()
274 mixer->rc_urb = NULL; in snd_usb_soundblaster_remote_init()
275 return -ENOMEM; in snd_usb_soundblaster_remote_init()
277 mixer->rc_setup_packet->bRequestType = in snd_usb_soundblaster_remote_init()
279 mixer->rc_setup_packet->bRequest = UAC_GET_MEM; in snd_usb_soundblaster_remote_init()
280 mixer->rc_setup_packet->wValue = cpu_to_le16(0); in snd_usb_soundblaster_remote_init()
281 mixer->rc_setup_packet->wIndex = cpu_to_le16(0); in snd_usb_soundblaster_remote_init()
282 mixer->rc_setup_packet->wLength = cpu_to_le16(len); in snd_usb_soundblaster_remote_init()
283 usb_fill_control_urb(mixer->rc_urb, mixer->chip->dev, in snd_usb_soundblaster_remote_init()
284 usb_rcvctrlpipe(mixer->chip->dev, 0), in snd_usb_soundblaster_remote_init()
285 (u8*)mixer->rc_setup_packet, mixer->rc_buffer, len, in snd_usb_soundblaster_remote_init()
294 ucontrol->value.integer.value[0] = kcontrol->private_value >> 8; in snd_audigy2nx_led_get()
301 struct snd_usb_audio *chip = mixer->chip; in snd_audigy2nx_led_update()
308 if (chip->usb_id == USB_ID(0x041e, 0x3042)) in snd_audigy2nx_led_update()
309 err = snd_usb_ctl_msg(chip->dev, in snd_audigy2nx_led_update()
310 usb_sndctrlpipe(chip->dev, 0), 0x24, in snd_audigy2nx_led_update()
313 /* USB X-Fi S51 Pro */ in snd_audigy2nx_led_update()
314 if (chip->usb_id == USB_ID(0x041e, 0x30df)) in snd_audigy2nx_led_update()
315 err = snd_usb_ctl_msg(chip->dev, in snd_audigy2nx_led_update()
316 usb_sndctrlpipe(chip->dev, 0), 0x24, in snd_audigy2nx_led_update()
320 err = snd_usb_ctl_msg(chip->dev, in snd_audigy2nx_led_update()
321 usb_sndctrlpipe(chip->dev, 0), 0x24, in snd_audigy2nx_led_update()
332 struct usb_mixer_interface *mixer = list->mixer; in snd_audigy2nx_led_put()
333 int index = kcontrol->private_value & 0xff; in snd_audigy2nx_led_put()
334 unsigned int value = ucontrol->value.integer.value[0]; in snd_audigy2nx_led_put()
335 int old_value = kcontrol->private_value >> 8; in snd_audigy2nx_led_put()
339 return -EINVAL; in snd_audigy2nx_led_put()
342 kcontrol->private_value = (value << 8) | index; in snd_audigy2nx_led_put()
349 int priv_value = list->kctl->private_value; in snd_audigy2nx_led_resume()
351 return snd_audigy2nx_led_update(list->mixer, priv_value >> 8, in snd_audigy2nx_led_resume()
376 /* USB X-Fi S51 doesn't have a CMSS LED */ in snd_audigy2nx_controls_create()
377 if ((mixer->chip->usb_id == USB_ID(0x041e, 0x3042)) && i == 0) in snd_audigy2nx_controls_create()
379 /* USB X-Fi S51 Pro doesn't have one either */ in snd_audigy2nx_controls_create()
380 if ((mixer->chip->usb_id == USB_ID(0x041e, 0x30df)) && i == 0) in snd_audigy2nx_controls_create()
383 (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || in snd_audigy2nx_controls_create()
384 mixer->chip->usb_id == USB_ID(0x041e, 0x3042) || in snd_audigy2nx_controls_create()
385 mixer->chip->usb_id == USB_ID(0x041e, 0x30df) || in snd_audigy2nx_controls_create()
386 mixer->chip->usb_id == USB_ID(0x041e, 0x3048))) in snd_audigy2nx_controls_create()
412 {-1, NULL} in snd_audigy2nx_proc_read()
417 {-1, NULL} in snd_audigy2nx_proc_read()
420 struct usb_mixer_interface *mixer = entry->private_data; in snd_audigy2nx_proc_read()
424 snd_iprintf(buffer, "%s jacks\n\n", mixer->chip->card->shortname); in snd_audigy2nx_proc_read()
425 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020)) in snd_audigy2nx_proc_read()
427 else if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || in snd_audigy2nx_proc_read()
428 mixer->chip->usb_id == USB_ID(0x041e, 0x3048)) in snd_audigy2nx_proc_read()
435 err = snd_usb_lock_shutdown(mixer->chip); in snd_audigy2nx_proc_read()
438 err = snd_usb_ctl_msg(mixer->chip->dev, in snd_audigy2nx_proc_read()
439 usb_rcvctrlpipe(mixer->chip->dev, 0), in snd_audigy2nx_proc_read()
443 snd_usb_unlock_shutdown(mixer->chip); in snd_audigy2nx_proc_read()
463 ucontrol->value.enumerated.item[0] = kcontrol->private_value; in snd_emu0204_ch_switch_get()
470 struct snd_usb_audio *chip = mixer->chip; in snd_emu0204_ch_switch_update()
480 err = snd_usb_ctl_msg(chip->dev, in snd_emu0204_ch_switch_update()
481 usb_sndctrlpipe(chip->dev, 0), UAC_SET_CUR, in snd_emu0204_ch_switch_update()
492 struct usb_mixer_interface *mixer = list->mixer; in snd_emu0204_ch_switch_put()
493 unsigned int value = ucontrol->value.enumerated.item[0]; in snd_emu0204_ch_switch_put()
497 return -EINVAL; in snd_emu0204_ch_switch_put()
499 if (value == kcontrol->private_value) in snd_emu0204_ch_switch_put()
502 kcontrol->private_value = value; in snd_emu0204_ch_switch_put()
509 return snd_emu0204_ch_switch_update(list->mixer, in snd_emu0204_ch_switch_resume()
510 list->kctl->private_value); in snd_emu0204_ch_switch_resume()
534 ucontrol->value.integer.value[0] = !!(kcontrol->private_value & 0x02); in snd_xonar_u1_switch_get()
541 struct snd_usb_audio *chip = mixer->chip; in snd_xonar_u1_switch_update()
547 err = snd_usb_ctl_msg(chip->dev, in snd_xonar_u1_switch_update()
548 usb_sndctrlpipe(chip->dev, 0), 0x08, in snd_xonar_u1_switch_update()
562 old_status = kcontrol->private_value; in snd_xonar_u1_switch_put()
563 if (ucontrol->value.integer.value[0]) in snd_xonar_u1_switch_put()
570 kcontrol->private_value = new_status; in snd_xonar_u1_switch_put()
571 err = snd_xonar_u1_switch_update(list->mixer, new_status); in snd_xonar_u1_switch_put()
577 return snd_xonar_u1_switch_update(list->mixer, in snd_xonar_u1_switch_resume()
578 list->kctl->private_value); in snd_xonar_u1_switch_resume()
602 ucontrol->value.enumerated.item[0] = kctl->private_value; in snd_mbox1_switch_get()
608 struct snd_usb_audio *chip = mixer->chip; in snd_mbox1_switch_update()
617 err = snd_usb_ctl_msg(chip->dev, in snd_mbox1_switch_update()
618 usb_rcvctrlpipe(chip->dev, 0), 0x81, in snd_mbox1_switch_update()
624 err = snd_usb_ctl_msg(chip->dev, in snd_mbox1_switch_update()
625 usb_rcvctrlpipe(chip->dev, 0), 0x81, in snd_mbox1_switch_update()
632 /* 2 possibilities: Internal -> send sample rate in snd_mbox1_switch_update()
633 * S/PDIF sync -> send zeroes in snd_mbox1_switch_update()
648 err = snd_usb_ctl_msg(chip->dev, in snd_mbox1_switch_update()
649 usb_sndctrlpipe(chip->dev, 0), 0x1, in snd_mbox1_switch_update()
654 err = snd_usb_ctl_msg(chip->dev, in snd_mbox1_switch_update()
655 usb_rcvctrlpipe(chip->dev, 0), 0x81, in snd_mbox1_switch_update()
661 err = snd_usb_ctl_msg(chip->dev, in snd_mbox1_switch_update()
662 usb_rcvctrlpipe(chip->dev, 0), 0x81, in snd_mbox1_switch_update()
678 struct usb_mixer_interface *mixer = list->mixer; in snd_mbox1_switch_put()
682 cur_val = kctl->private_value; in snd_mbox1_switch_put()
683 new_val = ucontrol->value.enumerated.item[0]; in snd_mbox1_switch_put()
687 kctl->private_value = new_val; in snd_mbox1_switch_put()
705 return snd_mbox1_switch_update(list->mixer, list->kctl->private_value); in snd_mbox1_switch_resume()
733 struct usb_device *dev = mixer->chip->dev; in snd_ni_control_init_val()
734 unsigned int pval = kctl->private_value; in snd_ni_control_init_val()
743 dev_err(&dev->dev, in snd_ni_control_init_val()
748 kctl->private_value |= ((unsigned int)value << 24); in snd_ni_control_init_val()
755 ucontrol->value.integer.value[0] = kcontrol->private_value >> 24; in snd_nativeinstruments_control_get()
761 struct snd_usb_audio *chip = list->mixer->chip; in snd_ni_update_cur_val()
762 unsigned int pval = list->kctl->private_value; in snd_ni_update_cur_val()
768 err = usb_control_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0), in snd_ni_update_cur_val()
780 u8 oldval = (kcontrol->private_value >> 24) & 0xff; in snd_nativeinstruments_control_put()
781 u8 newval = ucontrol->value.integer.value[0]; in snd_nativeinstruments_control_put()
787 kcontrol->private_value &= ~(0xff << 24); in snd_nativeinstruments_control_put()
788 kcontrol->private_value |= (unsigned int)newval << 24; in snd_nativeinstruments_control_put()
871 snd_ni_control_init_val(mixer, list->kctl); in snd_nativeinstruments_create_mixer()
877 /* M-Audio FastTrack Ultra quirks */
878 /* FTU Effect switch (also used by C400/C600) */
883 "Room 1", "Room 2", "Room 3", "Hall 1", in snd_ftu_eff_switch_info()
884 "Hall 2", "Plate", "Delay", "Echo" in snd_ftu_eff_switch_info()
893 struct usb_device *dev = mixer->chip->dev; in snd_ftu_eff_switch_init()
894 unsigned int pval = kctl->private_value; in snd_ftu_eff_switch_init()
904 snd_usb_ctrl_intf(mixer->chip) | ((pval & 0xff) << 8), in snd_ftu_eff_switch_init()
909 kctl->private_value |= (unsigned int)value[0] << 24; in snd_ftu_eff_switch_init()
916 ucontrol->value.enumerated.item[0] = kctl->private_value >> 24; in snd_ftu_eff_switch_get()
922 struct snd_usb_audio *chip = list->mixer->chip; in snd_ftu_eff_switch_update()
923 unsigned int pval = list->kctl->private_value; in snd_ftu_eff_switch_update()
933 err = snd_usb_ctl_msg(chip->dev, in snd_ftu_eff_switch_update()
934 usb_sndctrlpipe(chip->dev, 0), in snd_ftu_eff_switch_update()
948 unsigned int pval = list->kctl->private_value; in snd_ftu_eff_switch_put()
952 new_val = ucontrol->value.enumerated.item[0]; in snd_ftu_eff_switch_put()
956 kctl->private_value &= ~(0xff << 24); in snd_ftu_eff_switch_put()
957 kctl->private_value |= new_val << 24; in snd_ftu_eff_switch_put()
967 .name = "Effect Program Switch", in snd_ftu_create_effect_switch()
982 list->kctl->private_value = (validx << 8) | bUnitID; in snd_ftu_create_effect_switch()
983 snd_ftu_eff_switch_init(mixer, list->kctl); in snd_ftu_create_effect_switch()
1002 "AIn%d - Out%d Capture Volume", in snd_ftu_create_volume_ctls()
1013 "DIn%d - Out%d Playback Volume", in snd_ftu_create_volume_ctls()
1014 in - 7, out + 1); in snd_ftu_create_volume_ctls()
1029 static const char name[] = "Effect Volume"; in snd_ftu_create_effect_volume_ctl()
1042 static const char name[] = "Effect Duration"; in snd_ftu_create_effect_duration_ctl()
1055 static const char name[] = "Effect Feedback Volume"; in snd_ftu_create_effect_feedback_ctl()
1078 "Effect Return %d Volume", ch + 1); in snd_ftu_create_effect_return_ctls()
1102 "Effect Send AIn%d Volume", ch + 1); in snd_ftu_create_effect_send_ctls()
1112 "Effect Send DIn%d Volume", ch - 7); in snd_ftu_create_effect_send_ctls()
1164 list_for_each_entry(mixer, &chip->mixer_list, list) { in snd_emuusb_set_samplerate()
1165 if (mixer->id_elems[unitid]) { in snd_emuusb_set_samplerate()
1166 cval = mixer_elem_list_to_info(mixer->id_elems[unitid]); in snd_emuusb_set_samplerate()
1168 cval->control << 8, in snd_emuusb_set_samplerate()
1176 /* M-Audio Fast Track C400/C600 */
1190 switch (mixer->chip->usb_id) { in snd_c400_create_vol_ctls()
1205 "PCM%d-Out%d Playback Volume", in snd_c400_create_vol_ctls()
1209 "In%d-Out%d Playback Volume", in snd_c400_create_vol_ctls()
1210 chan - num_outs + 1, out + 1); in snd_c400_create_vol_ctls()
1213 cmask = (out == 0) ? 0 : 1 << (out - 1); in snd_c400_create_vol_ctls()
1229 static const char name[] = "Effect Volume"; in snd_c400_create_effect_volume_ctl()
1242 static const char name[] = "Effect Duration"; in snd_c400_create_effect_duration_ctl()
1255 static const char name[] = "Effect Feedback Volume"; in snd_c400_create_effect_feedback_ctl()
1277 switch (mixer->chip->usb_id) { in snd_c400_create_effect_vol_ctls()
1291 "Effect Send DOut%d", in snd_c400_create_effect_vol_ctls()
1295 "Effect Send AIn%d", in snd_c400_create_effect_vol_ctls()
1296 chan - num_outs + 1); in snd_c400_create_effect_vol_ctls()
1299 cmask = (chan == 0) ? 0 : 1 << (chan - 1); in snd_c400_create_effect_vol_ctls()
1322 switch (mixer->chip->usb_id) { in snd_c400_create_effect_ret_vol_ctls()
1337 "Effect Return %d", in snd_c400_create_effect_ret_vol_ctls()
1341 1 << (chan + (chan % 2) * num_outs - 1); in snd_c400_create_effect_ret_vol_ctls()
1388 * The mixer units for Ebox-44 are corrupt, and even where they
1465 * AES0: [0 0 0 0 2.3 2.2 2.1 2.0] - default 0x00
1466 * AES1: [3.3 3.2.3.1.3.0 2.7 2.6 2.5 2.4] - default: 0x01
1468 * AES3: [0 0 0 0 0 0 x 0] - 'x' bit is set basing on standard usb request
1480 * 0 - on (0x28 register value)
1481 * 1 - off (0x2a register value)
1487 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; in snd_microii_spdif_info()
1488 uinfo->count = 1; in snd_microii_spdif_info()
1496 struct snd_usb_audio *chip = list->mixer->chip; in snd_microii_spdif_default_get()
1508 ucontrol->value.iec958.status[0] = kcontrol->private_value & 0xff; in snd_microii_spdif_default_get()
1509 ucontrol->value.iec958.status[1] = (kcontrol->private_value >> 8) & 0xff; in snd_microii_spdif_default_get()
1510 ucontrol->value.iec958.status[2] = 0x00; in snd_microii_spdif_default_get()
1513 iface = usb_ifnum_to_if(chip->dev, 1); in snd_microii_spdif_default_get()
1514 if (!iface || iface->num_altsetting < 2) { in snd_microii_spdif_default_get()
1515 err = -EINVAL; in snd_microii_spdif_default_get()
1518 alts = &iface->altsetting[1]; in snd_microii_spdif_default_get()
1519 if (get_iface_desc(alts)->bNumEndpoints < 1) { in snd_microii_spdif_default_get()
1520 err = -EINVAL; in snd_microii_spdif_default_get()
1523 ep = get_endpoint(alts, 0)->bEndpointAddress; in snd_microii_spdif_default_get()
1525 err = snd_usb_ctl_msg(chip->dev, in snd_microii_spdif_default_get()
1526 usb_rcvctrlpipe(chip->dev, 0), in snd_microii_spdif_default_get()
1537 ucontrol->value.iec958.status[3] = (rate == 48000) ? in snd_microii_spdif_default_get()
1548 struct snd_usb_audio *chip = list->mixer->chip; in snd_microii_spdif_default_update()
1549 unsigned int pval = list->kctl->private_value; in snd_microii_spdif_default_update()
1558 err = snd_usb_ctl_msg(chip->dev, in snd_microii_spdif_default_update()
1559 usb_sndctrlpipe(chip->dev, 0), in snd_microii_spdif_default_update()
1571 err = snd_usb_ctl_msg(chip->dev, in snd_microii_spdif_default_update()
1572 usb_sndctrlpipe(chip->dev, 0), in snd_microii_spdif_default_update()
1594 pval = pval_old = kcontrol->private_value; in snd_microii_spdif_default_put()
1596 pval |= (ucontrol->value.iec958.status[1] & 0x0f) << 8; in snd_microii_spdif_default_put()
1597 pval |= (ucontrol->value.iec958.status[0] & 0x0f); in snd_microii_spdif_default_put()
1600 pval |= (ucontrol->value.iec958.status[1] & 0xf0) << 8; in snd_microii_spdif_default_put()
1609 kcontrol->private_value = pval; in snd_microii_spdif_default_put()
1617 ucontrol->value.iec958.status[0] = 0x0f; in snd_microii_spdif_mask_get()
1618 ucontrol->value.iec958.status[1] = 0xff; in snd_microii_spdif_mask_get()
1619 ucontrol->value.iec958.status[2] = 0x00; in snd_microii_spdif_mask_get()
1620 ucontrol->value.iec958.status[3] = 0x00; in snd_microii_spdif_mask_get()
1628 ucontrol->value.integer.value[0] = !(kcontrol->private_value & 0x02); in snd_microii_spdif_switch_get()
1635 struct snd_usb_audio *chip = list->mixer->chip; in snd_microii_spdif_switch_update()
1636 u8 reg = list->kctl->private_value; in snd_microii_spdif_switch_update()
1643 err = snd_usb_ctl_msg(chip->dev, in snd_microii_spdif_switch_update()
1644 usb_sndctrlpipe(chip->dev, 0), in snd_microii_spdif_switch_update()
1663 reg = ucontrol->value.integer.value[0] ? 0x28 : 0x2a; in snd_microii_spdif_switch_put()
1664 if (reg != list->kctl->private_value) in snd_microii_spdif_switch_put()
1667 kcontrol->private_value = reg; in snd_microii_spdif_switch_put()
1724 ucontrol->value.integer.value[0] = kcontrol->private_value; in snd_soundblaster_e1_switch_get()
1731 struct snd_usb_audio *chip = mixer->chip; in snd_soundblaster_e1_switch_update()
1741 err = snd_usb_ctl_msg(chip->dev, in snd_soundblaster_e1_switch_update()
1742 usb_sndctrlpipe(chip->dev, 0), HID_REQ_SET_REPORT, in snd_soundblaster_e1_switch_update()
1753 unsigned char value = !!ucontrol->value.integer.value[0]; in snd_soundblaster_e1_switch_put()
1756 if (kcontrol->private_value == value) in snd_soundblaster_e1_switch_put()
1758 kcontrol->private_value = value; in snd_soundblaster_e1_switch_put()
1759 err = snd_soundblaster_e1_switch_update(list->mixer, value); in snd_soundblaster_e1_switch_put()
1765 return snd_soundblaster_e1_switch_update(list->mixer, in snd_soundblaster_e1_switch_resume()
1766 list->kctl->private_value); in snd_soundblaster_e1_switch_resume()
1800 snd_usb_ctl_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0), UAC_SET_CUR, in dell_dock_init_vol()
1809 dell_dock_init_vol(mixer->chip, 1, 16); in dell_dock_mixer_init()
1810 dell_dock_init_vol(mixer->chip, 2, 16); in dell_dock_mixer_init()
1811 dell_dock_init_vol(mixer->chip, 1, 19); in dell_dock_mixer_init()
1812 dell_dock_init_vol(mixer->chip, 2, 19); in dell_dock_mixer_init()
1877 struct usb_device *dev = chip->dev; in snd_rme_read_value()
1886 dev_err(&dev->dev, in snd_rme_read_value()
1896 struct snd_usb_audio *chip = list->mixer->chip; in snd_rme_get_status1()
1918 switch (kcontrol->private_value) { in snd_rme_rate_get()
1935 return -EINVAL; in snd_rme_rate_get()
1937 ucontrol->value.integer.value[0] = rate; in snd_rme_rate_get()
1951 switch (kcontrol->private_value) { in snd_rme_sync_state_get()
1965 return -EINVAL; in snd_rme_sync_state_get()
1967 ucontrol->value.enumerated.item[0] = idx; in snd_rme_sync_state_get()
1980 ucontrol->value.enumerated.item[0] = SND_RME_SPDIF_IF(status1); in snd_rme_spdif_if_get()
1993 ucontrol->value.enumerated.item[0] = SND_RME_SPDIF_FORMAT(status1); in snd_rme_spdif_format_get()
2006 ucontrol->value.enumerated.item[0] = SND_RME_CLK_SYNC(status1); in snd_rme_sync_source_get()
2014 struct snd_usb_audio *chip = list->mixer->chip; in snd_rme_current_freq_get()
2032 ucontrol->value.integer.value[0] = freq; in snd_rme_current_freq_get()
2042 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_rme_rate_info()
2043 uinfo->count = 1; in snd_rme_rate_info()
2044 switch (kcontrol->private_value) { in snd_rme_rate_info()
2046 uinfo->value.integer.min = 32000; in snd_rme_rate_info()
2047 uinfo->value.integer.max = 800000; in snd_rme_rate_info()
2052 uinfo->value.integer.min = 0; in snd_rme_rate_info()
2053 uinfo->value.integer.max = 200000; in snd_rme_rate_info()
2055 uinfo->value.integer.step = 0; in snd_rme_rate_info()
2196 * Volume control is linear, from -inf (dec. 0) to +6dB (dec. 65536) with
2224 #define SND_BBFPRO_MIXER_VAL_MIN 0 // -inf
2236 struct snd_usb_audio *chip = mixer->chip; in snd_bbfpro_ctl_update()
2257 err = snd_usb_ctl_msg(chip->dev, in snd_bbfpro_ctl_update()
2258 usb_sndctrlpipe(chip->dev, 0), usb_req, in snd_bbfpro_ctl_update()
2272 pv = kcontrol->private_value; in snd_bbfpro_ctl_get()
2275 val = kcontrol->private_value >> SND_BBFPRO_CTL_VAL_SHIFT; in snd_bbfpro_ctl_get()
2282 ucontrol->value.enumerated.item[0] = val; in snd_bbfpro_ctl_get()
2284 ucontrol->value.integer.value[0] = val; in snd_bbfpro_ctl_get()
2295 pv = kcontrol->private_value; in snd_bbfpro_ctl_info()
2310 "-10dBV", in snd_bbfpro_ctl_info()
2316 uinfo->count = 1; in snd_bbfpro_ctl_info()
2317 uinfo->value.integer.min = 0; in snd_bbfpro_ctl_info()
2318 uinfo->value.integer.max = 1; in snd_bbfpro_ctl_info()
2319 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; in snd_bbfpro_ctl_info()
2331 struct usb_mixer_interface *mixer = list->mixer; in snd_bbfpro_ctl_put()
2333 pv = kcontrol->private_value; in snd_bbfpro_ctl_put()
2343 val = ucontrol->value.enumerated.item[0]; in snd_bbfpro_ctl_put()
2345 val = ucontrol->value.integer.value[0]; in snd_bbfpro_ctl_put()
2349 return -EINVAL; in snd_bbfpro_ctl_put()
2354 kcontrol->private_value = reg in snd_bbfpro_ctl_put()
2367 pv = list->kctl->private_value; in snd_bbfpro_ctl_resume()
2372 return snd_bbfpro_ctl_update(list->mixer, reg, idx, value); in snd_bbfpro_ctl_resume()
2378 struct snd_usb_audio *chip = mixer->chip; in snd_bbfpro_vol_update()
2394 err = snd_usb_ctl_msg(chip->dev, in snd_bbfpro_vol_update()
2395 usb_sndctrlpipe(chip->dev, 0), in snd_bbfpro_vol_update()
2408 ucontrol->value.integer.value[0] = in snd_bbfpro_vol_get()
2409 kcontrol->private_value >> SND_BBFPRO_MIXER_VAL_SHIFT; in snd_bbfpro_vol_get()
2416 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_bbfpro_vol_info()
2417 uinfo->count = 1; in snd_bbfpro_vol_info()
2418 uinfo->value.integer.min = SND_BBFPRO_MIXER_VAL_MIN; in snd_bbfpro_vol_info()
2419 uinfo->value.integer.max = SND_BBFPRO_MIXER_VAL_MAX; in snd_bbfpro_vol_info()
2430 struct usb_mixer_interface *mixer = list->mixer; in snd_bbfpro_vol_put()
2432 uvalue = ucontrol->value.integer.value[0]; in snd_bbfpro_vol_put()
2433 idx = kcontrol->private_value & SND_BBFPRO_MIXER_IDX_MASK; in snd_bbfpro_vol_put()
2434 old_value = kcontrol->private_value >> SND_BBFPRO_MIXER_VAL_SHIFT; in snd_bbfpro_vol_put()
2437 return -EINVAL; in snd_bbfpro_vol_put()
2444 kcontrol->private_value = idx in snd_bbfpro_vol_put()
2453 int pv = list->kctl->private_value; in snd_bbfpro_vol_resume()
2457 return snd_bbfpro_vol_update(list->mixer, idx, val); in snd_bbfpro_vol_resume()
2522 "%s-%s-%s Playback Volume", in snd_bbfpro_controls_create()
2531 "PCM-%s-%s Playback Volume", in snd_bbfpro_controls_create()
2568 "Mic-AN1 48V"); in snd_bbfpro_controls_create()
2574 "Mic-AN2 48V"); in snd_bbfpro_controls_create()
2580 "Line-IN3 Sens."); in snd_bbfpro_controls_create()
2586 "Line-IN4 Sens."); in snd_bbfpro_controls_create()
2592 "Mic-AN1 PAD"); in snd_bbfpro_controls_create()
2598 "Mic-AN2 PAD"); in snd_bbfpro_controls_create()
2606 * Pioneer DJ DJM-250MK2 and maybe other DJM models
2610 * and three stereo sources (Playback 1-2, Playback 3-4, Playback 5-6).
2617 * Channels 7-8 are in both directions fixed to FX SEND / FX RETURN.
2619 * See also notes in the quirks-table.h file.
2629 { .name = "-5 dB", .wValue = 0x0300, .wIndex = 0x8003 },
2630 { .name = "-10 dB", .wValue = 0x0200, .wIndex = 0x8003 },
2631 { .name = "-15 dB", .wValue = 0x0100, .wIndex = 0x8003 },
2632 { .name = "-19 dB", .wValue = 0x0000, .wIndex = 0x8003 }
2700 snd_pioneer_djm_option_group_item("Capture 1-2 Capture Switch", capture_ch12, 2),
2701 snd_pioneer_djm_option_group_item("Capture 3-4 Capture Switch", capture_ch34, 2),
2702 snd_pioneer_djm_option_group_item("Capture 5-6 Capture Switch", capture_ch56, 0),
2703 snd_pioneer_djm_option_group_item("Playback 1-2 Playback Switch", playback_12, 0),
2704 snd_pioneer_djm_option_group_item("Playback 3-4 Playback Switch", playback_34, 1),
2705 snd_pioneer_djm_option_group_item("Playback 5-6 Playback Switch", playback_56, 2)
2708 // layout of the kcontrol->private_value:
2715 u16 group_index = kctl->private_value >> SND_PIONEER_DJM_GROUP_SHIFT; in snd_pioneer_djm_controls_info()
2721 return -EINVAL; in snd_pioneer_djm_controls_info()
2724 count = group->count; in snd_pioneer_djm_controls_info()
2725 if (info->value.enumerated.item >= count) in snd_pioneer_djm_controls_info()
2726 info->value.enumerated.item = count - 1; in snd_pioneer_djm_controls_info()
2727 name = group->options[info->value.enumerated.item].name; in snd_pioneer_djm_controls_info()
2728 strlcpy(info->value.enumerated.name, name, sizeof(info->value.enumerated.name)); in snd_pioneer_djm_controls_info()
2729 info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in snd_pioneer_djm_controls_info()
2730 info->count = 1; in snd_pioneer_djm_controls_info()
2731 info->value.enumerated.items = count; in snd_pioneer_djm_controls_info()
2741 return -EINVAL; in snd_pioneer_djm_controls_update()
2743 err = snd_usb_lock_shutdown(mixer->chip); in snd_pioneer_djm_controls_update()
2748 mixer->chip->dev, usb_sndctrlpipe(mixer->chip->dev, 0), in snd_pioneer_djm_controls_update()
2755 snd_usb_unlock_shutdown(mixer->chip); in snd_pioneer_djm_controls_update()
2761 elem->value.enumerated.item[0] = kctl->private_value & SND_PIONEER_DJM_VALUE_MASK; in snd_pioneer_djm_controls_get()
2768 struct usb_mixer_interface *mixer = list->mixer; in snd_pioneer_djm_controls_put()
2769 unsigned long private_value = kctl->private_value; in snd_pioneer_djm_controls_put()
2771 u16 value = elem->value.enumerated.item[0]; in snd_pioneer_djm_controls_put()
2773 kctl->private_value = (group << SND_PIONEER_DJM_GROUP_SHIFT) | value; in snd_pioneer_djm_controls_put()
2780 unsigned long private_value = list->kctl->private_value; in snd_pioneer_djm_controls_resume()
2784 return snd_pioneer_djm_controls_update(list->mixer, group, value); in snd_pioneer_djm_controls_resume()
2802 knew.name = group->name; in snd_pioneer_djm_controls_create()
2803 knew.private_value = (i << SND_PIONEER_DJM_GROUP_SHIFT) | group->default_value; in snd_pioneer_djm_controls_create()
2804 err = snd_pioneer_djm_controls_update(mixer, i, group->default_value); in snd_pioneer_djm_controls_create()
2823 switch (mixer->chip->usb_id) { in snd_usb_mixer_apply_create_quirk()
2824 /* Tascam US-16x08 */ in snd_usb_mixer_apply_create_quirk()
2836 snd_card_ro_proc_new(mixer->chip->card, "audigy2nx", in snd_usb_mixer_apply_create_quirk()
2845 case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ in snd_usb_mixer_apply_create_quirk()
2846 case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C400 */ in snd_usb_mixer_apply_create_quirk()
2850 case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra */ in snd_usb_mixer_apply_create_quirk()
2851 case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */ in snd_usb_mixer_apply_create_quirk()
2881 case USB_ID(0x200c, 0x1018): /* Electrix Ebox-44 */ in snd_usb_mixer_apply_create_quirk()
2907 case USB_ID(0x2a39, 0x3fd2): /* RME ADI-2 Pro */ in snd_usb_mixer_apply_create_quirk()
2908 case USB_ID(0x2a39, 0x3fd3): /* RME ADI-2 DAC */ in snd_usb_mixer_apply_create_quirk()
2919 case USB_ID(0x2b73, 0x0017): /* Pioneer DJ DJM-250MK2 */ in snd_usb_mixer_apply_create_quirk()
2930 switch (mixer->chip->usb_id) { in snd_usb_mixer_resume_quirk()
2941 if (!mixer->rc_cfg) in snd_usb_mixer_rc_memory_change()
2946 mixer->rc_urb->dev = mixer->chip->dev; in snd_usb_mixer_rc_memory_change()
2947 usb_submit_urb(mixer->rc_urb, GFP_ATOMIC); in snd_usb_mixer_rc_memory_change()
2954 /* live24ext: 4 = line-in jack */ in snd_usb_mixer_rc_memory_change()
2955 case 3: /* hp-out jack (may actuate Mute) */ in snd_usb_mixer_rc_memory_change()
2956 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || in snd_usb_mixer_rc_memory_change()
2957 mixer->chip->usb_id == USB_ID(0x041e, 0x3048)) in snd_usb_mixer_rc_memory_change()
2958 snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id); in snd_usb_mixer_rc_memory_change()
2961 usb_audio_dbg(mixer->chip, "memory change in unknown unit %d\n", unitid); in snd_usb_mixer_rc_memory_change()
2973 0, 1, TLV_DB_MINMAX_ITEM(-5300, -4970), in snd_dragonfly_quirk_db_scale()
2974 2, 5, TLV_DB_MINMAX_ITEM(-4710, -4160), in snd_dragonfly_quirk_db_scale()
2975 6, 7, TLV_DB_MINMAX_ITEM(-3884, -3710), in snd_dragonfly_quirk_db_scale()
2976 8, 14, TLV_DB_MINMAX_ITEM(-3443, -2560), in snd_dragonfly_quirk_db_scale()
2977 15, 16, TLV_DB_MINMAX_ITEM(-2475, -2324), in snd_dragonfly_quirk_db_scale()
2978 17, 19, TLV_DB_MINMAX_ITEM(-2228, -2031), in snd_dragonfly_quirk_db_scale()
2979 20, 26, TLV_DB_MINMAX_ITEM(-1910, -1393), in snd_dragonfly_quirk_db_scale()
2980 27, 31, TLV_DB_MINMAX_ITEM(-1322, -1032), in snd_dragonfly_quirk_db_scale()
2981 32, 40, TLV_DB_MINMAX_ITEM(-968, -490), in snd_dragonfly_quirk_db_scale()
2982 41, 50, TLV_DB_MINMAX_ITEM(-441, 0), in snd_dragonfly_quirk_db_scale()
2985 if (cval->min == 0 && cval->max == 50) { in snd_dragonfly_quirk_db_scale()
2986 usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk (0-50 variant)\n"); in snd_dragonfly_quirk_db_scale()
2987 kctl->tlv.p = scale; in snd_dragonfly_quirk_db_scale()
2988 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; in snd_dragonfly_quirk_db_scale()
2989 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK; in snd_dragonfly_quirk_db_scale()
2991 } else if (cval->min == 0 && cval->max <= 1000) { in snd_dragonfly_quirk_db_scale()
2995 usb_audio_info(mixer->chip, "ignoring too narrow dB range on a DragonFly device"); in snd_dragonfly_quirk_db_scale()
2996 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK; in snd_dragonfly_quirk_db_scale()
3004 switch (mixer->chip->usb_id) { in snd_usb_mixer_fu_apply_quirk()
3006 if (unitid == 7 && cval->control == UAC_FU_VOLUME) in snd_usb_mixer_fu_apply_quirk()
3009 /* lowest playback value is muted on C-Media devices */ in snd_usb_mixer_fu_apply_quirk()
3012 if (strstr(kctl->id.name, "Playback")) in snd_usb_mixer_fu_apply_quirk()
3013 cval->min_mute = 1; in snd_usb_mixer_fu_apply_quirk()