Lines Matching +full:chip +full:- +full:selects
1 // SPDX-License-Identifier: GPL-2.0
17 #include <linux/usb/audio-v2.h>
38 * It seems like a selects between
42 * * b selects an input channel (see below).
43 * * c selects an output channel pair (see below).
44 * * d selects left (0) or right (1) of that pair.
45 * * e 0-> disconnect, 0x01000000-> connect,
46 * 0x0109-> used for stereo-linking channels,
54 * 0 - 7 Mic/Inst/Line (Analog inputs)
55 * 8 - 9 S/PDIF
56 * 10 - 17 ADAT
57 * 18 - 35 DAW (Inputs from the host)
60 * 0 -> Main out
61 * 1 -> Line1/2
62 * 2 -> Line3/4
63 * 3 -> S/PDIF
64 * 4 -> ADAT?
159 dev_warn(&dev->dev, "could not send ctl packet\n"); in snd_s1810c_send_ctl_packet()
189 dev_warn(&dev->dev, "could not send state packet (%d)\n", ret); in snd_sc1810c_get_status_field()
198 dev_warn(&dev->dev, "could not get state field %u (%d)\n", in snd_sc1810c_get_status_field()
214 static int snd_s1810c_init_mixer_maps(struct snd_usb_audio *chip) in snd_s1810c_init_mixer_maps() argument
217 struct usb_device *dev = chip->dev; in snd_s1810c_init_mixer_maps()
283 if ((c == 0 && b == 18) || /* DAW1/2 -> Main */ in snd_s1810c_init_mixer_maps()
284 (c == 1 && b == 20) || /* DAW3/4 -> Line3/4 */ in snd_s1810c_init_mixer_maps()
285 (c == 2 && b == 22) || /* DAW4/5 -> Line5/6 */ in snd_s1810c_init_mixer_maps()
286 (c == 3 && b == 24)) { /* DAW5/6 -> S/PDIF */ in snd_s1810c_init_mixer_maps()
330 * whose index is specified in (kctl->private_value & 0xFF),
337 struct snd_usb_audio *chip = mixer->chip; in snd_s1810c_get_switch_state() local
338 struct s1810_mixer_state *private = mixer->private_data; in snd_s1810c_get_switch_state()
340 u32 ctl_idx = (u32) (kctl->private_value & 0xFF); in snd_s1810c_get_switch_state()
343 mutex_lock(&private->usb_mutex); in snd_s1810c_get_switch_state()
344 ret = snd_sc1810c_get_status_field(chip->dev, &field, in snd_s1810c_get_switch_state()
345 ctl_idx, &private->seqnum); in snd_s1810c_get_switch_state()
351 mutex_unlock(&private->usb_mutex); in snd_s1810c_get_switch_state()
357 * specified in (kctl->private_value >> 8) with value
358 * specified in (kctl->private_value >> 16).
364 struct snd_usb_audio *chip = mixer->chip; in snd_s1810c_set_switch_state() local
365 struct s1810_mixer_state *private = mixer->private_data; in snd_s1810c_set_switch_state()
366 u32 pval = (u32) kctl->private_value; in snd_s1810c_set_switch_state()
371 mutex_lock(&private->usb_mutex); in snd_s1810c_set_switch_state()
372 ret = snd_s1810c_send_ctl_packet(chip->dev, 0, 0, 0, ctl_id, ctl_val); in snd_s1810c_set_switch_state()
373 mutex_unlock(&private->usb_mutex); in snd_s1810c_set_switch_state()
384 struct usb_mixer_interface *mixer = list->mixer; in snd_s1810c_switch_get()
385 struct s1810_mixer_state *private = mixer->private_data; in snd_s1810c_switch_get()
386 u32 pval = (u32) kctl->private_value; in snd_s1810c_switch_get()
391 mutex_lock(&private->data_mutex); in snd_s1810c_switch_get()
399 ctl_elem->value.enumerated.item[0] = (int)state; in snd_s1810c_switch_get()
402 ctl_elem->value.integer.value[0] = (long)state; in snd_s1810c_switch_get()
406 mutex_unlock(&private->data_mutex); in snd_s1810c_switch_get()
415 struct usb_mixer_interface *mixer = list->mixer; in snd_s1810c_switch_set()
416 struct s1810_mixer_state *private = mixer->private_data; in snd_s1810c_switch_set()
417 u32 pval = (u32) kctl->private_value; in snd_s1810c_switch_set()
423 mutex_lock(&private->data_mutex); in snd_s1810c_switch_set()
431 newval = (u32) ctl_elem->value.enumerated.item[0]; in snd_s1810c_switch_set()
434 newval = (u32) ctl_elem->value.integer.value[0]; in snd_s1810c_switch_set()
440 kctl->private_value &= ~(0x1 << 16); in snd_s1810c_switch_set()
441 kctl->private_value |= (unsigned int)(newval & 0x1) << 16; in snd_s1810c_switch_set()
445 mutex_unlock(&private->data_mutex); in snd_s1810c_switch_set()
458 return -ENOMEM; in snd_s1810c_switch_init()
460 elem->head.mixer = mixer; in snd_s1810c_switch_init()
461 elem->control = 0; in snd_s1810c_switch_init()
462 elem->head.id = 0; in snd_s1810c_switch_init()
463 elem->channels = 1; in snd_s1810c_switch_init()
468 return -ENOMEM; in snd_s1810c_switch_init()
470 kctl->private_free = snd_usb_mixer_elem_free; in snd_s1810c_switch_init()
472 return snd_usb_mixer_add_control(&elem->head, kctl); in snd_s1810c_switch_init()
537 struct s1810_mixer_state *private = mixer->private_data; in snd_sc1810_mixer_state_free()
539 mixer->private_data = NULL; in snd_sc1810_mixer_state_free()
546 struct snd_usb_audio *chip = mixer->chip; in snd_sc1810_init_mixer() local
547 struct usb_device *dev = chip->dev; in snd_sc1810_init_mixer()
551 if (!list_empty(&chip->mixer_list)) in snd_sc1810_init_mixer()
554 dev_info(&dev->dev, in snd_sc1810_init_mixer()
555 "Presonus Studio 1810c, device_setup: %u\n", chip->setup); in snd_sc1810_init_mixer()
556 if (chip->setup == 1) in snd_sc1810_init_mixer()
557 dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); in snd_sc1810_init_mixer()
558 else if (chip->setup == 2) in snd_sc1810_init_mixer()
559 dev_info(&dev->dev, "(6out/8in @ 192kHz)\n"); in snd_sc1810_init_mixer()
561 dev_info(&dev->dev, "(8out/14in @ 96kHz)\n"); in snd_sc1810_init_mixer()
563 ret = snd_s1810c_init_mixer_maps(chip); in snd_sc1810_init_mixer()
569 return -ENOMEM; in snd_sc1810_init_mixer()
571 mutex_init(&private->usb_mutex); in snd_sc1810_init_mixer()
572 mutex_init(&private->data_mutex); in snd_sc1810_init_mixer()
574 mixer->private_data = private; in snd_sc1810_init_mixer()
575 mixer->private_free = snd_sc1810_mixer_state_free; in snd_sc1810_init_mixer()
577 private->seqnum = 1; in snd_sc1810_init_mixer()