mixer_quirks.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * USB Audio Driver for ALSA
  3. *
  4. * Quirks and vendor-specific extensions for mixer interfaces
  5. *
  6. * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
  7. *
  8. * Many codes borrowed from audio.c by
  9. * Alan Cox (alan@lxorguk.ukuu.org.uk)
  10. * Thomas Sailer (sailer@ife.ee.ethz.ch)
  11. *
  12. *
  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.
  17. *
  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.
  22. *
  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
  26. */
  27. #include <linux/init.h>
  28. #include <linux/slab.h>
  29. #include <linux/usb.h>
  30. #include <linux/usb/audio.h>
  31. #include <sound/core.h>
  32. #include <sound/control.h>
  33. #include <sound/hwdep.h>
  34. #include <sound/info.h>
  35. #include "usbaudio.h"
  36. #include "mixer.h"
  37. #include "mixer_quirks.h"
  38. #include "helper.h"
  39. /*
  40. * Sound Blaster remote control configuration
  41. *
  42. * format of remote control data:
  43. * Extigy: xx 00
  44. * Audigy 2 NX: 06 80 xx 00 00 00
  45. * Live! 24-bit: 06 80 xx yy 22 83
  46. */
  47. static const struct rc_config {
  48. u32 usb_id;
  49. u8 offset;
  50. u8 length;
  51. u8 packet_length;
  52. u8 min_packet_length; /* minimum accepted length of the URB result */
  53. u8 mute_mixer_id;
  54. u32 mute_code;
  55. } rc_configs[] = {
  56. { USB_ID(0x041e, 0x3000), 0, 1, 2, 1, 18, 0x0013 }, /* Extigy */
  57. { USB_ID(0x041e, 0x3020), 2, 1, 6, 6, 18, 0x0013 }, /* Audigy 2 NX */
  58. { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */
  59. { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 */
  60. { USB_ID(0x041e, 0x30df), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */
  61. { USB_ID(0x041e, 0x3048), 2, 2, 6, 6, 2, 0x6e91 }, /* Toshiba SB0500 */
  62. };
  63. static void snd_usb_soundblaster_remote_complete(struct urb *urb)
  64. {
  65. struct usb_mixer_interface *mixer = urb->context;
  66. const struct rc_config *rc = mixer->rc_cfg;
  67. u32 code;
  68. if (urb->status < 0 || urb->actual_length < rc->min_packet_length)
  69. return;
  70. code = mixer->rc_buffer[rc->offset];
  71. if (rc->length == 2)
  72. code |= mixer->rc_buffer[rc->offset + 1] << 8;
  73. /* the Mute button actually changes the mixer control */
  74. if (code == rc->mute_code)
  75. snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id);
  76. mixer->rc_code = code;
  77. wmb();
  78. wake_up(&mixer->rc_waitq);
  79. }
  80. static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf,
  81. long count, loff_t *offset)
  82. {
  83. struct usb_mixer_interface *mixer = hw->private_data;
  84. int err;
  85. u32 rc_code;
  86. if (count != 1 && count != 4)
  87. return -EINVAL;
  88. err = wait_event_interruptible(mixer->rc_waitq,
  89. (rc_code = xchg(&mixer->rc_code, 0)) != 0);
  90. if (err == 0) {
  91. if (count == 1)
  92. err = put_user(rc_code, buf);
  93. else
  94. err = put_user(rc_code, (u32 __user *)buf);
  95. }
  96. return err < 0 ? err : count;
  97. }
  98. static unsigned int snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file,
  99. poll_table *wait)
  100. {
  101. struct usb_mixer_interface *mixer = hw->private_data;
  102. poll_wait(file, &mixer->rc_waitq, wait);
  103. return mixer->rc_code ? POLLIN | POLLRDNORM : 0;
  104. }
  105. static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
  106. {
  107. struct snd_hwdep *hwdep;
  108. int err, len, i;
  109. for (i = 0; i < ARRAY_SIZE(rc_configs); ++i)
  110. if (rc_configs[i].usb_id == mixer->chip->usb_id)
  111. break;
  112. if (i >= ARRAY_SIZE(rc_configs))
  113. return 0;
  114. mixer->rc_cfg = &rc_configs[i];
  115. len = mixer->rc_cfg->packet_length;
  116. init_waitqueue_head(&mixer->rc_waitq);
  117. err = snd_hwdep_new(mixer->chip->card, "SB remote control", 0, &hwdep);
  118. if (err < 0)
  119. return err;
  120. snprintf(hwdep->name, sizeof(hwdep->name),
  121. "%s remote control", mixer->chip->card->shortname);
  122. hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC;
  123. hwdep->private_data = mixer;
  124. hwdep->ops.read = snd_usb_sbrc_hwdep_read;
  125. hwdep->ops.poll = snd_usb_sbrc_hwdep_poll;
  126. hwdep->exclusive = 1;
  127. mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL);
  128. if (!mixer->rc_urb)
  129. return -ENOMEM;
  130. mixer->rc_setup_packet = kmalloc(sizeof(*mixer->rc_setup_packet), GFP_KERNEL);
  131. if (!mixer->rc_setup_packet) {
  132. usb_free_urb(mixer->rc_urb);
  133. mixer->rc_urb = NULL;
  134. return -ENOMEM;
  135. }
  136. mixer->rc_setup_packet->bRequestType =
  137. USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
  138. mixer->rc_setup_packet->bRequest = UAC_GET_MEM;
  139. mixer->rc_setup_packet->wValue = cpu_to_le16(0);
  140. mixer->rc_setup_packet->wIndex = cpu_to_le16(0);
  141. mixer->rc_setup_packet->wLength = cpu_to_le16(len);
  142. usb_fill_control_urb(mixer->rc_urb, mixer->chip->dev,
  143. usb_rcvctrlpipe(mixer->chip->dev, 0),
  144. (u8*)mixer->rc_setup_packet, mixer->rc_buffer, len,
  145. snd_usb_soundblaster_remote_complete, mixer);
  146. return 0;
  147. }
  148. #define snd_audigy2nx_led_info snd_ctl_boolean_mono_info
  149. static int snd_audigy2nx_led_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  150. {
  151. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  152. int index = kcontrol->private_value;
  153. ucontrol->value.integer.value[0] = mixer->audigy2nx_leds[index];
  154. return 0;
  155. }
  156. static int snd_audigy2nx_led_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
  157. {
  158. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  159. int index = kcontrol->private_value;
  160. int value = ucontrol->value.integer.value[0];
  161. int err, changed;
  162. if (value > 1)
  163. return -EINVAL;
  164. changed = value != mixer->audigy2nx_leds[index];
  165. if (mixer->chip->usb_id == USB_ID(0x041e, 0x3042))
  166. err = snd_usb_ctl_msg(mixer->chip->dev,
  167. usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
  168. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
  169. !value, 0, NULL, 0, 100);
  170. /* USB X-Fi S51 Pro */
  171. if (mixer->chip->usb_id == USB_ID(0x041e, 0x30df))
  172. err = snd_usb_ctl_msg(mixer->chip->dev,
  173. usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
  174. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
  175. !value, 0, NULL, 0, 100);
  176. else
  177. err = snd_usb_ctl_msg(mixer->chip->dev,
  178. usb_sndctrlpipe(mixer->chip->dev, 0), 0x24,
  179. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
  180. value, index + 2, NULL, 0, 100);
  181. if (err < 0)
  182. return err;
  183. mixer->audigy2nx_leds[index] = value;
  184. return changed;
  185. }
  186. static struct snd_kcontrol_new snd_audigy2nx_controls[] = {
  187. {
  188. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  189. .name = "CMSS LED Switch",
  190. .info = snd_audigy2nx_led_info,
  191. .get = snd_audigy2nx_led_get,
  192. .put = snd_audigy2nx_led_put,
  193. .private_value = 0,
  194. },
  195. {
  196. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  197. .name = "Power LED Switch",
  198. .info = snd_audigy2nx_led_info,
  199. .get = snd_audigy2nx_led_get,
  200. .put = snd_audigy2nx_led_put,
  201. .private_value = 1,
  202. },
  203. {
  204. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  205. .name = "Dolby Digital LED Switch",
  206. .info = snd_audigy2nx_led_info,
  207. .get = snd_audigy2nx_led_get,
  208. .put = snd_audigy2nx_led_put,
  209. .private_value = 2,
  210. },
  211. };
  212. static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer)
  213. {
  214. int i, err;
  215. for (i = 0; i < ARRAY_SIZE(snd_audigy2nx_controls); ++i) {
  216. /* USB X-Fi S51 doesn't have a CMSS LED */
  217. if ((mixer->chip->usb_id == USB_ID(0x041e, 0x3042)) && i == 0)
  218. continue;
  219. /* USB X-Fi S51 Pro doesn't have one either */
  220. if ((mixer->chip->usb_id == USB_ID(0x041e, 0x30df)) && i == 0)
  221. continue;
  222. if (i > 1 && /* Live24ext has 2 LEDs only */
  223. (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
  224. mixer->chip->usb_id == USB_ID(0x041e, 0x3042) ||
  225. mixer->chip->usb_id == USB_ID(0x041e, 0x30df) ||
  226. mixer->chip->usb_id == USB_ID(0x041e, 0x3048)))
  227. break;
  228. err = snd_ctl_add(mixer->chip->card,
  229. snd_ctl_new1(&snd_audigy2nx_controls[i], mixer));
  230. if (err < 0)
  231. return err;
  232. }
  233. mixer->audigy2nx_leds[1] = 1; /* Power LED is on by default */
  234. return 0;
  235. }
  236. static void snd_audigy2nx_proc_read(struct snd_info_entry *entry,
  237. struct snd_info_buffer *buffer)
  238. {
  239. static const struct sb_jack {
  240. int unitid;
  241. const char *name;
  242. } jacks_audigy2nx[] = {
  243. {4, "dig in "},
  244. {7, "line in"},
  245. {19, "spk out"},
  246. {20, "hph out"},
  247. {-1, NULL}
  248. }, jacks_live24ext[] = {
  249. {4, "line in"}, /* &1=Line, &2=Mic*/
  250. {3, "hph out"}, /* headphones */
  251. {0, "RC "}, /* last command, 6 bytes see rc_config above */
  252. {-1, NULL}
  253. };
  254. const struct sb_jack *jacks;
  255. struct usb_mixer_interface *mixer = entry->private_data;
  256. int i, err;
  257. u8 buf[3];
  258. snd_iprintf(buffer, "%s jacks\n\n", mixer->chip->card->shortname);
  259. if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020))
  260. jacks = jacks_audigy2nx;
  261. else if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
  262. mixer->chip->usb_id == USB_ID(0x041e, 0x3048))
  263. jacks = jacks_live24ext;
  264. else
  265. return;
  266. for (i = 0; jacks[i].name; ++i) {
  267. snd_iprintf(buffer, "%s: ", jacks[i].name);
  268. err = snd_usb_ctl_msg(mixer->chip->dev,
  269. usb_rcvctrlpipe(mixer->chip->dev, 0),
  270. UAC_GET_MEM, USB_DIR_IN | USB_TYPE_CLASS |
  271. USB_RECIP_INTERFACE, 0,
  272. jacks[i].unitid << 8, buf, 3, 100);
  273. if (err == 3 && (buf[0] == 3 || buf[0] == 6))
  274. snd_iprintf(buffer, "%02x %02x\n", buf[1], buf[2]);
  275. else
  276. snd_iprintf(buffer, "?\n");
  277. }
  278. }
  279. static int snd_xonar_u1_switch_get(struct snd_kcontrol *kcontrol,
  280. struct snd_ctl_elem_value *ucontrol)
  281. {
  282. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  283. ucontrol->value.integer.value[0] = !!(mixer->xonar_u1_status & 0x02);
  284. return 0;
  285. }
  286. static int snd_xonar_u1_switch_put(struct snd_kcontrol *kcontrol,
  287. struct snd_ctl_elem_value *ucontrol)
  288. {
  289. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  290. u8 old_status, new_status;
  291. int err, changed;
  292. old_status = mixer->xonar_u1_status;
  293. if (ucontrol->value.integer.value[0])
  294. new_status = old_status | 0x02;
  295. else
  296. new_status = old_status & ~0x02;
  297. changed = new_status != old_status;
  298. err = snd_usb_ctl_msg(mixer->chip->dev,
  299. usb_sndctrlpipe(mixer->chip->dev, 0), 0x08,
  300. USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
  301. 50, 0, &new_status, 1, 100);
  302. if (err < 0)
  303. return err;
  304. mixer->xonar_u1_status = new_status;
  305. return changed;
  306. }
  307. static struct snd_kcontrol_new snd_xonar_u1_output_switch = {
  308. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  309. .name = "Digital Playback Switch",
  310. .info = snd_ctl_boolean_mono_info,
  311. .get = snd_xonar_u1_switch_get,
  312. .put = snd_xonar_u1_switch_put,
  313. };
  314. static int snd_xonar_u1_controls_create(struct usb_mixer_interface *mixer)
  315. {
  316. int err;
  317. err = snd_ctl_add(mixer->chip->card,
  318. snd_ctl_new1(&snd_xonar_u1_output_switch, mixer));
  319. if (err < 0)
  320. return err;
  321. mixer->xonar_u1_status = 0x05;
  322. return 0;
  323. }
  324. /* Native Instruments device quirks */
  325. #define _MAKE_NI_CONTROL(bRequest,wIndex) ((bRequest) << 16 | (wIndex))
  326. static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,
  327. struct snd_ctl_elem_value *ucontrol)
  328. {
  329. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  330. struct usb_device *dev = mixer->chip->dev;
  331. u8 bRequest = (kcontrol->private_value >> 16) & 0xff;
  332. u16 wIndex = kcontrol->private_value & 0xffff;
  333. u8 tmp;
  334. int ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
  335. USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
  336. 0, cpu_to_le16(wIndex),
  337. &tmp, sizeof(tmp), 1000);
  338. if (ret < 0) {
  339. snd_printk(KERN_ERR
  340. "unable to issue vendor read request (ret = %d)", ret);
  341. return ret;
  342. }
  343. ucontrol->value.integer.value[0] = tmp;
  344. return 0;
  345. }
  346. static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
  347. struct snd_ctl_elem_value *ucontrol)
  348. {
  349. struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
  350. struct usb_device *dev = mixer->chip->dev;
  351. u8 bRequest = (kcontrol->private_value >> 16) & 0xff;
  352. u16 wIndex = kcontrol->private_value & 0xffff;
  353. u16 wValue = ucontrol->value.integer.value[0];
  354. int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), bRequest,
  355. USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
  356. cpu_to_le16(wValue), cpu_to_le16(wIndex),
  357. NULL, 0, 1000);
  358. if (ret < 0) {
  359. snd_printk(KERN_ERR
  360. "unable to issue vendor write request (ret = %d)", ret);
  361. return ret;
  362. }
  363. return 0;
  364. }
  365. static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = {
  366. {
  367. .name = "Direct Thru Channel A",
  368. .private_value = _MAKE_NI_CONTROL(0x01, 0x03),
  369. },
  370. {
  371. .name = "Direct Thru Channel B",
  372. .private_value = _MAKE_NI_CONTROL(0x01, 0x05),
  373. },
  374. {
  375. .name = "Phono Input Channel A",
  376. .private_value = _MAKE_NI_CONTROL(0x02, 0x03),
  377. },
  378. {
  379. .name = "Phono Input Channel B",
  380. .private_value = _MAKE_NI_CONTROL(0x02, 0x05),
  381. },
  382. };
  383. static struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = {
  384. {
  385. .name = "Direct Thru Channel A",
  386. .private_value = _MAKE_NI_CONTROL(0x01, 0x03),
  387. },
  388. {
  389. .name = "Direct Thru Channel B",
  390. .private_value = _MAKE_NI_CONTROL(0x01, 0x05),
  391. },
  392. {
  393. .name = "Direct Thru Channel C",
  394. .private_value = _MAKE_NI_CONTROL(0x01, 0x07),
  395. },
  396. {
  397. .name = "Direct Thru Channel D",
  398. .private_value = _MAKE_NI_CONTROL(0x01, 0x09),
  399. },
  400. {
  401. .name = "Phono Input Channel A",
  402. .private_value = _MAKE_NI_CONTROL(0x02, 0x03),
  403. },
  404. {
  405. .name = "Phono Input Channel B",
  406. .private_value = _MAKE_NI_CONTROL(0x02, 0x05),
  407. },
  408. {
  409. .name = "Phono Input Channel C",
  410. .private_value = _MAKE_NI_CONTROL(0x02, 0x07),
  411. },
  412. {
  413. .name = "Phono Input Channel D",
  414. .private_value = _MAKE_NI_CONTROL(0x02, 0x09),
  415. },
  416. };
  417. static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer,
  418. const struct snd_kcontrol_new *kc,
  419. unsigned int count)
  420. {
  421. int i, err = 0;
  422. struct snd_kcontrol_new template = {
  423. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  424. .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
  425. .get = snd_nativeinstruments_control_get,
  426. .put = snd_nativeinstruments_control_put,
  427. .info = snd_ctl_boolean_mono_info,
  428. };
  429. for (i = 0; i < count; i++) {
  430. struct snd_kcontrol *c;
  431. template.name = kc[i].name;
  432. template.private_value = kc[i].private_value;
  433. c = snd_ctl_new1(&template, mixer);
  434. err = snd_ctl_add(mixer->chip->card, c);
  435. if (err < 0)
  436. break;
  437. }
  438. return err;
  439. }
  440. void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
  441. unsigned char samplerate_id)
  442. {
  443. struct usb_mixer_interface *mixer;
  444. struct usb_mixer_elem_info *cval;
  445. int unitid = 12; /* SamleRate ExtensionUnit ID */
  446. list_for_each_entry(mixer, &chip->mixer_list, list) {
  447. cval = mixer->id_elems[unitid];
  448. if (cval) {
  449. snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR,
  450. cval->control << 8,
  451. samplerate_id);
  452. snd_usb_mixer_notify_id(mixer, unitid);
  453. }
  454. break;
  455. }
  456. }
  457. int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
  458. {
  459. int err = 0;
  460. struct snd_info_entry *entry;
  461. if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0)
  462. return err;
  463. switch (mixer->chip->usb_id) {
  464. case USB_ID(0x041e, 0x3020):
  465. case USB_ID(0x041e, 0x3040):
  466. case USB_ID(0x041e, 0x3042):
  467. case USB_ID(0x041e, 0x30df):
  468. case USB_ID(0x041e, 0x3048):
  469. err = snd_audigy2nx_controls_create(mixer);
  470. if (err < 0)
  471. break;
  472. if (!snd_card_proc_new(mixer->chip->card, "audigy2nx", &entry))
  473. snd_info_set_text_ops(entry, mixer,
  474. snd_audigy2nx_proc_read);
  475. break;
  476. case USB_ID(0x0b05, 0x1739):
  477. case USB_ID(0x0b05, 0x1743):
  478. err = snd_xonar_u1_controls_create(mixer);
  479. break;
  480. case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */
  481. err = snd_nativeinstruments_create_mixer(mixer,
  482. snd_nativeinstruments_ta6_mixers,
  483. ARRAY_SIZE(snd_nativeinstruments_ta6_mixers));
  484. break;
  485. case USB_ID(0x17cc, 0x1021): /* Traktor Audio 10 */
  486. err = snd_nativeinstruments_create_mixer(mixer,
  487. snd_nativeinstruments_ta10_mixers,
  488. ARRAY_SIZE(snd_nativeinstruments_ta10_mixers));
  489. break;
  490. }
  491. return err;
  492. }
  493. void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
  494. int unitid)
  495. {
  496. if (!mixer->rc_cfg)
  497. return;
  498. /* unit ids specific to Extigy/Audigy 2 NX: */
  499. switch (unitid) {
  500. case 0: /* remote control */
  501. mixer->rc_urb->dev = mixer->chip->dev;
  502. usb_submit_urb(mixer->rc_urb, GFP_ATOMIC);
  503. break;
  504. case 4: /* digital in jack */
  505. case 7: /* line in jacks */
  506. case 19: /* speaker out jacks */
  507. case 20: /* headphones out jack */
  508. break;
  509. /* live24ext: 4 = line-in jack */
  510. case 3: /* hp-out jack (may actuate Mute) */
  511. if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) ||
  512. mixer->chip->usb_id == USB_ID(0x041e, 0x3048))
  513. snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id);
  514. break;
  515. default:
  516. snd_printd(KERN_DEBUG "memory change in unknown unit %d\n", unitid);
  517. break;
  518. }
  519. }