2 * USB Audio Driver for ALSA
4 * Quirks and vendor-specific extensions for mixer interfaces
6 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
8 * Many codes borrowed from audio.c by
9 * Alan Cox (alan@lxorguk.ukuu.org.uk)
10 * Thomas Sailer (sailer@ife.ee.ethz.ch)
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
28 #include <linux/init.h>
29 #include <linux/slab.h>
30 #include <linux/usb.h>
31 #include <linux/usb/audio.h>
33 #include <sound/core.h>
34 #include <sound/control.h>
35 #include <sound/hwdep.h>
36 #include <sound/info.h>
37 #include <sound/tlv.h>
41 #include "mixer_quirks.h"
44 extern struct snd_kcontrol_new *snd_usb_feature_unit_ctl;
47 * Sound Blaster remote control configuration
49 * format of remote control data:
51 * Audigy 2 NX: 06 80 xx 00 00 00
52 * Live! 24-bit: 06 80 xx yy 22 83
54 static const struct rc_config {
59 u8 min_packet_length; /* minimum accepted length of the URB result */
63 { USB_ID(0x041e, 0x3000), 0, 1, 2, 1, 18, 0x0013 }, /* Extigy */
64 { USB_ID(0x041e, 0x3020), 2, 1, 6, 6, 18, 0x0013 }, /* Audigy 2 NX */
65 { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */
66 { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 */
67 { USB_ID(0x041e, 0x30df), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
68 { USB_ID(0x041e, 0x3237), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
69 { USB_ID(0x041e, 0x3048), 2, 2, 6, 6, 2, 0x6e91 }, /* Toshiba SB0500 */
72 static void snd_usb_soundblaster_remote_complete(struct urb *urb)
74 struct usb_mixer_interface *mixer = urb->context;
75 const struct rc_config *rc = mixer->rc_cfg;
78 if (urb->status < 0 || urb->actual_length < rc->min_packet_length)
81 code = mixer->rc_buffer[rc->offset];
83 code |= mixer->rc_buffer[rc->offset + 1] << 8;
85 /* the Mute button actually changes the mixer control */
86 if (code == rc->mute_code)
87 snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id);
88 mixer->rc_code = code;
90 wake_up(&mixer->rc_waitq);
93 static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf,
94 long count, loff_t *offset)
96 struct usb_mixer_interface *mixer = hw->private_data;
100 if (count != 1 && count != 4)
102 err = wait_event_interruptible(mixer->rc_waitq,
103 (rc_code = xchg(&mixer->rc_code, 0)) != 0);
106 err = put_user(rc_code, buf);
108 err = put_user(rc_code, (u32 __user *)buf);
110 return err < 0 ? err : count;
113 static unsigned int snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file,
116 struct usb_mixer_interface *mixer = hw->private_data;
118 poll_wait(file, &mixer->rc_waitq, wait);
119 return mixer->rc_code ? POLLIN | POLLRDNORM : 0;
122 static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
124 struct snd_hwdep *hwdep;
127 for (i = 0; i < ARRAY_SIZE(rc_configs); ++i)
128 if (rc_configs[i].usb_id == mixer->chip->usb_id)
130 if (i >= ARRAY_SIZE(rc_configs))
132 mixer->rc_cfg = &rc_configs[i];
134 len = mixer->rc_cfg->packet_length;
136 init_waitqueue_head(&mixer->rc_waitq);
137 err = snd_hwdep_new(mixer->chip->card, "SB remote control", 0, &hwdep);
140 snprintf(hwdep->name, sizeof(hwdep->name),
141 "%s remote control", mixer->chip->card->shortname);
142 hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC;
143 hwdep->private_data = mixer;
144 hwdep->ops.read = snd_usb_sbrc_hwdep_read;
145 hwdep->ops.poll = snd_usb_sbrc_hwdep_poll;
146 hwdep->exclusive = 1;
148 mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL);
151 mixer->rc_setup_packet = kmalloc(sizeof(*mixer->rc_setup_packet), GFP_KERNEL);
152 if (!mixer->rc_setup_packet) {
153 usb_free_urb(mixer->rc_urb);
154 mixer->rc_urb = NULL;
157 mixer->rc_setup_packet->bRequestType =
158 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
159 mixer->rc_setup_packet->bRequest = UAC_GET_MEM;
160 mixer->rc_setup_packet->wValue = cpu_to_le16(0);
161 mixer->rc_setup_packet->wIndex = cpu_to_le16(0);
162 mixer->rc_setup_packet->wLength = cpu_to_le16(len);
163 usb_fill_control_urb(mixer->rc_urb, mixer->chip->dev,
164 usb_rcvctrlpipe(mixer->chip->dev, 0),
165 (u8*)mixer->rc_setup_packet, mixer->rc_buffer, len,
166 snd_usb_soundblaster_remote_complete, mixer);
170 #define snd_audigy2nx_led_info snd_ctl_boolean_mono_info
172 static int snd_audigy2nx_led_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
174 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
175 int index = kcontrol->private_value;
177 ucontrol->value.integer.value[0] = mixer->audigy2nx_leds[index];
181 static int snd_audigy2nx_led_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
183 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
184 int index = kcontrol->private_value;
185 int value = ucontrol->value.integer.value[0];
190 changed = value != mixer->audigy2nx_leds[index];
191 down_read(&mixer->chip->shutdown_rwsem);
192 if (mixer->chip->shutdown) {
196 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3042))
197 err = snd_usb_ctl_msg(mixer->chip->dev,
198 usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
199 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
201 /* USB X-Fi S51 Pro */
202 if (mixer->chip->usb_id == USB_ID(0x041e, 0x30df))
203 err = snd_usb_ctl_msg(mixer->chip->dev,
204 usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
205 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
208 err = snd_usb_ctl_msg(mixer->chip->dev,
209 usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
210 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
211 value, index + 2, NULL, 0);
213 up_read(&mixer->chip->shutdown_rwsem);
216 mixer->audigy2nx_leds[index] = value;
220 static struct snd_kcontrol_new snd_audigy2nx_controls[] = {
222 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
223 .name = "CMSS LED Switch",
224 .info = snd_audigy2nx_led_info,
225 .get = snd_audigy2nx_led_get,
226 .put = snd_audigy2nx_led_put,
230 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
231 .name = "Power LED Switch",
232 .info = snd_audigy2nx_led_info,
233 .get = snd_audigy2nx_led_get,
234 .put = snd_audigy2nx_led_put,
238 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
239 .name = "Dolby Digital LED Switch",
240 .info = snd_audigy2nx_led_info,
241 .get = snd_audigy2nx_led_get,
242 .put = snd_audigy2nx_led_put,
247 static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer)
251 for (i = 0; i < ARRAY_SIZE(snd_audigy2nx_controls); ++i) {
252 /* USB X-Fi S51 doesn't have a CMSS LED */
253 if ((mixer->chip->usb_id == USB_ID(0x041e, 0x3042)) && i == 0)
255 /* USB X-Fi S51 Pro doesn't have one either */
256 if ((mixer->chip->usb_id == USB_ID(0x041e, 0x30df)) && i == 0)
258 if (i > 1 && /* Live24ext has 2 LEDs only */
259 (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
260 mixer->chip->usb_id == USB_ID(0x041e, 0x3042) ||
261 mixer->chip->usb_id == USB_ID(0x041e, 0x30df) ||
262 mixer->chip->usb_id == USB_ID(0x041e, 0x3048)))
264 err = snd_ctl_add(mixer->chip->card,
265 snd_ctl_new1(&snd_audigy2nx_controls[i], mixer));
269 mixer->audigy2nx_leds[1] = 1; /* Power LED is on by default */
273 static void snd_audigy2nx_proc_read(struct snd_info_entry *entry,
274 struct snd_info_buffer *buffer)
276 static const struct sb_jack {
279 } jacks_audigy2nx[] = {
285 }, jacks_live24ext[] = {
286 {4, "line in"}, /* &1=Line, &2=Mic*/
287 {3, "hph out"}, /* headphones */
288 {0, "RC "}, /* last command, 6 bytes see rc_config above */
291 const struct sb_jack *jacks;
292 struct usb_mixer_interface *mixer = entry->private_data;
296 snd_iprintf(buffer, "%s jacks\n\n", mixer->chip->card->shortname);
297 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020))
298 jacks = jacks_audigy2nx;
299 else if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
300 mixer->chip->usb_id == USB_ID(0x041e, 0x3048))
301 jacks = jacks_live24ext;
305 for (i = 0; jacks[i].name; ++i) {
306 snd_iprintf(buffer, "%s: ", jacks[i].name);
307 down_read(&mixer->chip->shutdown_rwsem);
308 if (mixer->chip->shutdown)
311 err = snd_usb_ctl_msg(mixer->chip->dev,
312 usb_rcvctrlpipe(mixer->chip->dev, 0),
313 UAC_GET_MEM, USB_DIR_IN | USB_TYPE_CLASS |
314 USB_RECIP_INTERFACE, 0,
315 jacks[i].unitid << 8, buf, 3);
316 up_read(&mixer->chip->shutdown_rwsem);
317 if (err == 3 && (buf[0] == 3 || buf[0] == 6))
318 snd_iprintf(buffer, "%02x %02x\n", buf[1], buf[2]);
320 snd_iprintf(buffer, "?\n");
324 static int snd_xonar_u1_switch_get(struct snd_kcontrol *kcontrol,
325 struct snd_ctl_elem_value *ucontrol)
327 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
329 ucontrol->value.integer.value[0] = !!(mixer->xonar_u1_status & 0x02);
333 static int snd_xonar_u1_switch_put(struct snd_kcontrol *kcontrol,
334 struct snd_ctl_elem_value *ucontrol)
336 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
337 u8 old_status, new_status;
340 old_status = mixer->xonar_u1_status;
341 if (ucontrol->value.integer.value[0])
342 new_status = old_status | 0x02;
344 new_status = old_status & ~0x02;
345 changed = new_status != old_status;
346 down_read(&mixer->chip->shutdown_rwsem);
347 if (mixer->chip->shutdown)
350 err = snd_usb_ctl_msg(mixer->chip->dev,
351 usb_sndctrlpipe(mixer->chip->dev, 0), 0x08,
352 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
353 50, 0, &new_status, 1);
354 up_read(&mixer->chip->shutdown_rwsem);
357 mixer->xonar_u1_status = new_status;
361 static struct snd_kcontrol_new snd_xonar_u1_output_switch = {
362 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
363 .name = "Digital Playback Switch",
364 .info = snd_ctl_boolean_mono_info,
365 .get = snd_xonar_u1_switch_get,
366 .put = snd_xonar_u1_switch_put,
369 static int snd_xonar_u1_controls_create(struct usb_mixer_interface *mixer)
373 err = snd_ctl_add(mixer->chip->card,
374 snd_ctl_new1(&snd_xonar_u1_output_switch, mixer));
377 mixer->xonar_u1_status = 0x05;
381 /* Native Instruments device quirks */
383 #define _MAKE_NI_CONTROL(bRequest,wIndex) ((bRequest) << 16 | (wIndex))
385 static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,
386 struct snd_ctl_elem_value *ucontrol)
388 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
389 struct usb_device *dev = mixer->chip->dev;
390 u8 bRequest = (kcontrol->private_value >> 16) & 0xff;
391 u16 wIndex = kcontrol->private_value & 0xffff;
395 down_read(&mixer->chip->shutdown_rwsem);
396 if (mixer->chip->shutdown)
399 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
400 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
402 &tmp, sizeof(tmp), 1000);
403 up_read(&mixer->chip->shutdown_rwsem);
407 "unable to issue vendor read request (ret = %d)", ret);
411 ucontrol->value.integer.value[0] = tmp;
416 static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
417 struct snd_ctl_elem_value *ucontrol)
419 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
420 struct usb_device *dev = mixer->chip->dev;
421 u8 bRequest = (kcontrol->private_value >> 16) & 0xff;
422 u16 wIndex = kcontrol->private_value & 0xffff;
423 u16 wValue = ucontrol->value.integer.value[0];
426 down_read(&mixer->chip->shutdown_rwsem);
427 if (mixer->chip->shutdown)
430 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), bRequest,
431 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
434 up_read(&mixer->chip->shutdown_rwsem);
438 "unable to issue vendor write request (ret = %d)", ret);
445 static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = {
447 .name = "Direct Thru Channel A",
448 .private_value = _MAKE_NI_CONTROL(0x01, 0x03),
451 .name = "Direct Thru Channel B",
452 .private_value = _MAKE_NI_CONTROL(0x01, 0x05),
455 .name = "Phono Input Channel A",
456 .private_value = _MAKE_NI_CONTROL(0x02, 0x03),
459 .name = "Phono Input Channel B",
460 .private_value = _MAKE_NI_CONTROL(0x02, 0x05),
464 static struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = {
466 .name = "Direct Thru Channel A",
467 .private_value = _MAKE_NI_CONTROL(0x01, 0x03),
470 .name = "Direct Thru Channel B",
471 .private_value = _MAKE_NI_CONTROL(0x01, 0x05),
474 .name = "Direct Thru Channel C",
475 .private_value = _MAKE_NI_CONTROL(0x01, 0x07),
478 .name = "Direct Thru Channel D",
479 .private_value = _MAKE_NI_CONTROL(0x01, 0x09),
482 .name = "Phono Input Channel A",
483 .private_value = _MAKE_NI_CONTROL(0x02, 0x03),
486 .name = "Phono Input Channel B",
487 .private_value = _MAKE_NI_CONTROL(0x02, 0x05),
490 .name = "Phono Input Channel C",
491 .private_value = _MAKE_NI_CONTROL(0x02, 0x07),
494 .name = "Phono Input Channel D",
495 .private_value = _MAKE_NI_CONTROL(0x02, 0x09),
499 static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer,
500 const struct snd_kcontrol_new *kc,
504 struct snd_kcontrol_new template = {
505 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
506 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
507 .get = snd_nativeinstruments_control_get,
508 .put = snd_nativeinstruments_control_put,
509 .info = snd_ctl_boolean_mono_info,
512 for (i = 0; i < count; i++) {
513 struct snd_kcontrol *c;
515 template.name = kc[i].name;
516 template.private_value = kc[i].private_value;
518 c = snd_ctl_new1(&template, mixer);
519 err = snd_ctl_add(mixer->chip->card, c);
528 /* M-Audio FastTrack Ultra quirks */
530 /* private_free callback */
531 static void usb_mixer_elem_free(struct snd_kcontrol *kctl)
533 kfree(kctl->private_data);
534 kctl->private_data = NULL;
537 static int snd_maudio_ftu_create_ctl(struct usb_mixer_interface *mixer,
538 int in, int out, const char *name)
540 struct usb_mixer_elem_info *cval;
541 struct snd_kcontrol *kctl;
543 cval = kzalloc(sizeof(*cval), GFP_KERNEL);
549 cval->val_type = USB_MIXER_S16;
551 cval->control = out + 1;
552 cval->cmask = 1 << in;
554 kctl = snd_ctl_new1(snd_usb_feature_unit_ctl, cval);
560 snprintf(kctl->id.name, sizeof(kctl->id.name), name);
561 kctl->private_free = usb_mixer_elem_free;
562 return snd_usb_mixer_add_control(mixer, kctl);
565 static int snd_maudio_ftu_create_mixer(struct usb_mixer_interface *mixer)
570 for (out = 0; out < 8; out++) {
571 for (in = 0; in < 8; in++) {
572 snprintf(name, sizeof(name),
573 "AIn%d - Out%d Capture Volume", in + 1, out + 1);
574 err = snd_maudio_ftu_create_ctl(mixer, in, out, name);
579 for (in = 8; in < 16; in++) {
580 snprintf(name, sizeof(name),
581 "DIn%d - Out%d Playback Volume", in - 7, out + 1);
582 err = snd_maudio_ftu_create_ctl(mixer, in, out, name);
591 void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
592 unsigned char samplerate_id)
594 struct usb_mixer_interface *mixer;
595 struct usb_mixer_elem_info *cval;
596 int unitid = 12; /* SamleRate ExtensionUnit ID */
598 list_for_each_entry(mixer, &chip->mixer_list, list) {
599 cval = mixer->id_elems[unitid];
601 snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR,
604 snd_usb_mixer_notify_id(mixer, unitid);
610 int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
613 struct snd_info_entry *entry;
615 if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0)
618 switch (mixer->chip->usb_id) {
619 case USB_ID(0x041e, 0x3020):
620 case USB_ID(0x041e, 0x3040):
621 case USB_ID(0x041e, 0x3042):
622 case USB_ID(0x041e, 0x30df):
623 case USB_ID(0x041e, 0x3048):
624 err = snd_audigy2nx_controls_create(mixer);
627 if (!snd_card_proc_new(mixer->chip->card, "audigy2nx", &entry))
628 snd_info_set_text_ops(entry, mixer,
629 snd_audigy2nx_proc_read);
632 case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra */
633 case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */
634 err = snd_maudio_ftu_create_mixer(mixer);
637 case USB_ID(0x0b05, 0x1739):
638 case USB_ID(0x0b05, 0x1743):
639 err = snd_xonar_u1_controls_create(mixer);
642 case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */
643 err = snd_nativeinstruments_create_mixer(mixer,
644 snd_nativeinstruments_ta6_mixers,
645 ARRAY_SIZE(snd_nativeinstruments_ta6_mixers));
648 case USB_ID(0x17cc, 0x1021): /* Traktor Audio 10 */
649 err = snd_nativeinstruments_create_mixer(mixer,
650 snd_nativeinstruments_ta10_mixers,
651 ARRAY_SIZE(snd_nativeinstruments_ta10_mixers));
658 void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
663 /* unit ids specific to Extigy/Audigy 2 NX: */
665 case 0: /* remote control */
666 mixer->rc_urb->dev = mixer->chip->dev;
667 usb_submit_urb(mixer->rc_urb, GFP_ATOMIC);
669 case 4: /* digital in jack */
670 case 7: /* line in jacks */
671 case 19: /* speaker out jacks */
672 case 20: /* headphones out jack */
674 /* live24ext: 4 = line-in jack */
675 case 3: /* hp-out jack (may actuate Mute) */
676 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
677 mixer->chip->usb_id == USB_ID(0x041e, 0x3048))
678 snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id);
681 snd_printd(KERN_DEBUG "memory change in unknown unit %d\n", unitid);
686 static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer,
687 struct snd_kcontrol *kctl)
689 /* Approximation using 10 ranges based on output measurement on hw v1.2.
690 * This seems close to the cubic mapping e.g. alsamixer uses. */
691 static const DECLARE_TLV_DB_RANGE(scale,
692 0, 1, TLV_DB_MINMAX_ITEM(-5300, -4970),
693 2, 5, TLV_DB_MINMAX_ITEM(-4710, -4160),
694 6, 7, TLV_DB_MINMAX_ITEM(-3884, -3710),
695 8, 14, TLV_DB_MINMAX_ITEM(-3443, -2560),
696 15, 16, TLV_DB_MINMAX_ITEM(-2475, -2324),
697 17, 19, TLV_DB_MINMAX_ITEM(-2228, -2031),
698 20, 26, TLV_DB_MINMAX_ITEM(-1910, -1393),
699 27, 31, TLV_DB_MINMAX_ITEM(-1322, -1032),
700 32, 40, TLV_DB_MINMAX_ITEM(-968, -490),
701 41, 50, TLV_DB_MINMAX_ITEM(-441, 0),
704 dev_info(&mixer->chip->dev->dev, "applying DragonFly dB scale quirk\n");
706 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
707 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
710 void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
711 struct usb_mixer_elem_info *cval, int unitid,
712 struct snd_kcontrol *kctl)
714 switch (mixer->chip->usb_id) {
715 case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
716 if (unitid == 7 && cval->min == 0 && cval->max == 50)
717 snd_dragonfly_quirk_db_scale(mixer, kctl);