device.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * caiaq.c: ALSA driver for caiaq/NativeInstruments devices
  3. *
  4. * Copyright (c) 2007 Daniel Mack <daniel@caiaq.de>
  5. * Karsten Wiese <fzu@wemgehoertderstaat.de>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/moduleparam.h>
  22. #include <linux/device.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/module.h>
  25. #include <linux/init.h>
  26. #include <linux/gfp.h>
  27. #include <linux/usb.h>
  28. #include <sound/initval.h>
  29. #include <sound/core.h>
  30. #include <sound/pcm.h>
  31. #include "device.h"
  32. #include "audio.h"
  33. #include "midi.h"
  34. #include "control.h"
  35. #include "input.h"
  36. MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
  37. MODULE_DESCRIPTION("caiaq USB audio");
  38. MODULE_LICENSE("GPL");
  39. MODULE_SUPPORTED_DEVICE("{{Native Instruments,RigKontrol2},"
  40. "{Native Instruments,RigKontrol3},"
  41. "{Native Instruments,Kore Controller},"
  42. "{Native Instruments,Kore Controller 2},"
  43. "{Native Instruments,Audio Kontrol 1},"
  44. "{Native Instruments,Audio 2 DJ},"
  45. "{Native Instruments,Audio 4 DJ},"
  46. "{Native Instruments,Audio 8 DJ},"
  47. "{Native Instruments,Traktor Audio 2},"
  48. "{Native Instruments,Session I/O},"
  49. "{Native Instruments,GuitarRig mobile},"
  50. "{Native Instruments,Traktor Kontrol X1},"
  51. "{Native Instruments,Traktor Kontrol S4},"
  52. "{Native Instruments,Maschine Controller}}");
  53. static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
  54. static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
  55. static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
  56. module_param_array(index, int, NULL, 0444);
  57. MODULE_PARM_DESC(index, "Index value for the caiaq sound device");
  58. module_param_array(id, charp, NULL, 0444);
  59. MODULE_PARM_DESC(id, "ID string for the caiaq soundcard.");
  60. module_param_array(enable, bool, NULL, 0444);
  61. MODULE_PARM_DESC(enable, "Enable the caiaq soundcard.");
  62. enum {
  63. SAMPLERATE_44100 = 0,
  64. SAMPLERATE_48000 = 1,
  65. SAMPLERATE_96000 = 2,
  66. SAMPLERATE_192000 = 3,
  67. SAMPLERATE_88200 = 4,
  68. SAMPLERATE_INVALID = 0xff
  69. };
  70. enum {
  71. DEPTH_NONE = 0,
  72. DEPTH_16 = 1,
  73. DEPTH_24 = 2,
  74. DEPTH_32 = 3
  75. };
  76. static struct usb_device_id snd_usb_id_table[] = {
  77. {
  78. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  79. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  80. .idProduct = USB_PID_RIGKONTROL2
  81. },
  82. {
  83. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  84. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  85. .idProduct = USB_PID_RIGKONTROL3
  86. },
  87. {
  88. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  89. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  90. .idProduct = USB_PID_KORECONTROLLER
  91. },
  92. {
  93. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  94. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  95. .idProduct = USB_PID_KORECONTROLLER2
  96. },
  97. {
  98. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  99. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  100. .idProduct = USB_PID_AK1
  101. },
  102. {
  103. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  104. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  105. .idProduct = USB_PID_AUDIO8DJ
  106. },
  107. {
  108. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  109. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  110. .idProduct = USB_PID_SESSIONIO
  111. },
  112. {
  113. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  114. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  115. .idProduct = USB_PID_GUITARRIGMOBILE
  116. },
  117. {
  118. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  119. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  120. .idProduct = USB_PID_AUDIO4DJ
  121. },
  122. {
  123. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  124. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  125. .idProduct = USB_PID_AUDIO2DJ
  126. },
  127. {
  128. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  129. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  130. .idProduct = USB_PID_TRAKTORKONTROLX1
  131. },
  132. {
  133. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  134. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  135. .idProduct = USB_PID_TRAKTORKONTROLS4
  136. },
  137. {
  138. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  139. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  140. .idProduct = USB_PID_TRAKTORAUDIO2
  141. },
  142. {
  143. .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
  144. .idVendor = USB_VID_NATIVEINSTRUMENTS,
  145. .idProduct = USB_PID_MASCHINECONTROLLER
  146. },
  147. { /* terminator */ }
  148. };
  149. static void usb_ep1_command_reply_dispatch (struct urb* urb)
  150. {
  151. int ret;
  152. struct device *dev = &urb->dev->dev;
  153. struct snd_usb_caiaqdev *cdev = urb->context;
  154. unsigned char *buf = urb->transfer_buffer;
  155. if (urb->status || !cdev) {
  156. dev_warn(dev, "received EP1 urb->status = %i\n", urb->status);
  157. return;
  158. }
  159. switch(buf[0]) {
  160. case EP1_CMD_GET_DEVICE_INFO:
  161. memcpy(&cdev->spec, buf+1, sizeof(struct caiaq_device_spec));
  162. cdev->spec.fw_version = le16_to_cpu(cdev->spec.fw_version);
  163. dev_dbg(dev, "device spec (firmware %d): audio: %d in, %d out, "
  164. "MIDI: %d in, %d out, data alignment %d\n",
  165. cdev->spec.fw_version,
  166. cdev->spec.num_analog_audio_in,
  167. cdev->spec.num_analog_audio_out,
  168. cdev->spec.num_midi_in,
  169. cdev->spec.num_midi_out,
  170. cdev->spec.data_alignment);
  171. cdev->spec_received++;
  172. wake_up(&cdev->ep1_wait_queue);
  173. break;
  174. case EP1_CMD_AUDIO_PARAMS:
  175. cdev->audio_parm_answer = buf[1];
  176. wake_up(&cdev->ep1_wait_queue);
  177. break;
  178. case EP1_CMD_MIDI_READ:
  179. snd_usb_caiaq_midi_handle_input(cdev, buf[1], buf + 3, buf[2]);
  180. break;
  181. case EP1_CMD_READ_IO:
  182. if (cdev->chip.usb_id ==
  183. USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ)) {
  184. if (urb->actual_length > sizeof(cdev->control_state))
  185. urb->actual_length = sizeof(cdev->control_state);
  186. memcpy(cdev->control_state, buf + 1, urb->actual_length);
  187. wake_up(&cdev->ep1_wait_queue);
  188. break;
  189. }
  190. #ifdef CONFIG_SND_USB_CAIAQ_INPUT
  191. case EP1_CMD_READ_ERP:
  192. case EP1_CMD_READ_ANALOG:
  193. snd_usb_caiaq_input_dispatch(cdev, buf, urb->actual_length);
  194. #endif
  195. break;
  196. }
  197. cdev->ep1_in_urb.actual_length = 0;
  198. ret = usb_submit_urb(&cdev->ep1_in_urb, GFP_ATOMIC);
  199. if (ret < 0)
  200. dev_err(dev, "unable to submit urb. OOM!?\n");
  201. }
  202. int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *cdev,
  203. unsigned char command,
  204. const unsigned char *buffer,
  205. int len)
  206. {
  207. int actual_len;
  208. struct usb_device *usb_dev = cdev->chip.dev;
  209. if (!usb_dev)
  210. return -EIO;
  211. if (len > EP1_BUFSIZE - 1)
  212. len = EP1_BUFSIZE - 1;
  213. if (buffer && len > 0)
  214. memcpy(cdev->ep1_out_buf+1, buffer, len);
  215. cdev->ep1_out_buf[0] = command;
  216. return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1),
  217. cdev->ep1_out_buf, len+1, &actual_len, 200);
  218. }
  219. int snd_usb_caiaq_send_command_bank(struct snd_usb_caiaqdev *cdev,
  220. unsigned char command,
  221. unsigned char bank,
  222. const unsigned char *buffer,
  223. int len)
  224. {
  225. int actual_len;
  226. struct usb_device *usb_dev = cdev->chip.dev;
  227. if (!usb_dev)
  228. return -EIO;
  229. if (len > EP1_BUFSIZE - 2)
  230. len = EP1_BUFSIZE - 2;
  231. if (buffer && len > 0)
  232. memcpy(cdev->ep1_out_buf+2, buffer, len);
  233. cdev->ep1_out_buf[0] = command;
  234. cdev->ep1_out_buf[1] = bank;
  235. return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1),
  236. cdev->ep1_out_buf, len+2, &actual_len, 200);
  237. }
  238. int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *cdev,
  239. int rate, int depth, int bpp)
  240. {
  241. int ret;
  242. char tmp[5];
  243. struct device *dev = caiaqdev_to_dev(cdev);
  244. switch (rate) {
  245. case 44100: tmp[0] = SAMPLERATE_44100; break;
  246. case 48000: tmp[0] = SAMPLERATE_48000; break;
  247. case 88200: tmp[0] = SAMPLERATE_88200; break;
  248. case 96000: tmp[0] = SAMPLERATE_96000; break;
  249. case 192000: tmp[0] = SAMPLERATE_192000; break;
  250. default: return -EINVAL;
  251. }
  252. switch (depth) {
  253. case 16: tmp[1] = DEPTH_16; break;
  254. case 24: tmp[1] = DEPTH_24; break;
  255. default: return -EINVAL;
  256. }
  257. tmp[2] = bpp & 0xff;
  258. tmp[3] = bpp >> 8;
  259. tmp[4] = 1; /* packets per microframe */
  260. dev_dbg(dev, "setting audio params: %d Hz, %d bits, %d bpp\n",
  261. rate, depth, bpp);
  262. cdev->audio_parm_answer = -1;
  263. ret = snd_usb_caiaq_send_command(cdev, EP1_CMD_AUDIO_PARAMS,
  264. tmp, sizeof(tmp));
  265. if (ret)
  266. return ret;
  267. if (!wait_event_timeout(cdev->ep1_wait_queue,
  268. cdev->audio_parm_answer >= 0, HZ))
  269. return -EPIPE;
  270. if (cdev->audio_parm_answer != 1)
  271. dev_dbg(dev, "unable to set the device's audio params\n");
  272. else
  273. cdev->bpp = bpp;
  274. return cdev->audio_parm_answer == 1 ? 0 : -EINVAL;
  275. }
  276. int snd_usb_caiaq_set_auto_msg(struct snd_usb_caiaqdev *cdev,
  277. int digital, int analog, int erp)
  278. {
  279. char tmp[3] = { digital, analog, erp };
  280. return snd_usb_caiaq_send_command(cdev, EP1_CMD_AUTO_MSG,
  281. tmp, sizeof(tmp));
  282. }
  283. static void setup_card(struct snd_usb_caiaqdev *cdev)
  284. {
  285. int ret;
  286. char val[4];
  287. struct device *dev = caiaqdev_to_dev(cdev);
  288. /* device-specific startup specials */
  289. switch (cdev->chip.usb_id) {
  290. case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2):
  291. /* RigKontrol2 - display centered dash ('-') */
  292. val[0] = 0x00;
  293. val[1] = 0x00;
  294. val[2] = 0x01;
  295. snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 3);
  296. break;
  297. case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
  298. /* RigKontrol2 - display two centered dashes ('--') */
  299. val[0] = 0x00;
  300. val[1] = 0x40;
  301. val[2] = 0x40;
  302. val[3] = 0x00;
  303. snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 4);
  304. break;
  305. case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
  306. /* Audio Kontrol 1 - make USB-LED stop blinking */
  307. val[0] = 0x00;
  308. snd_usb_caiaq_send_command(cdev, EP1_CMD_WRITE_IO, val, 1);
  309. break;
  310. case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
  311. /* Audio 8 DJ - trigger read of current settings */
  312. cdev->control_state[0] = 0xff;
  313. snd_usb_caiaq_set_auto_msg(cdev, 1, 0, 0);
  314. snd_usb_caiaq_send_command(cdev, EP1_CMD_READ_IO, NULL, 0);
  315. if (!wait_event_timeout(cdev->ep1_wait_queue,
  316. cdev->control_state[0] != 0xff, HZ))
  317. return;
  318. /* fix up some defaults */
  319. if ((cdev->control_state[1] != 2) ||
  320. (cdev->control_state[2] != 3) ||
  321. (cdev->control_state[4] != 2)) {
  322. cdev->control_state[1] = 2;
  323. cdev->control_state[2] = 3;
  324. cdev->control_state[4] = 2;
  325. snd_usb_caiaq_send_command(cdev,
  326. EP1_CMD_WRITE_IO, cdev->control_state, 6);
  327. }
  328. break;
  329. }
  330. if (cdev->spec.num_analog_audio_out +
  331. cdev->spec.num_analog_audio_in +
  332. cdev->spec.num_digital_audio_out +
  333. cdev->spec.num_digital_audio_in > 0) {
  334. ret = snd_usb_caiaq_audio_init(cdev);
  335. if (ret < 0)
  336. dev_err(dev, "Unable to set up audio system (ret=%d)\n", ret);
  337. }
  338. if (cdev->spec.num_midi_in +
  339. cdev->spec.num_midi_out > 0) {
  340. ret = snd_usb_caiaq_midi_init(cdev);
  341. if (ret < 0)
  342. dev_err(dev, "Unable to set up MIDI system (ret=%d)\n", ret);
  343. }
  344. #ifdef CONFIG_SND_USB_CAIAQ_INPUT
  345. ret = snd_usb_caiaq_input_init(cdev);
  346. if (ret < 0)
  347. dev_err(dev, "Unable to set up input system (ret=%d)\n", ret);
  348. #endif
  349. /* finally, register the card and all its sub-instances */
  350. ret = snd_card_register(cdev->chip.card);
  351. if (ret < 0) {
  352. dev_err(dev, "snd_card_register() returned %d\n", ret);
  353. snd_card_free(cdev->chip.card);
  354. }
  355. ret = snd_usb_caiaq_control_init(cdev);
  356. if (ret < 0)
  357. dev_err(dev, "Unable to set up control system (ret=%d)\n", ret);
  358. }
  359. static int create_card(struct usb_device *usb_dev,
  360. struct usb_interface *intf,
  361. struct snd_card **cardp)
  362. {
  363. int devnum;
  364. int err;
  365. struct snd_card *card;
  366. struct snd_usb_caiaqdev *cdev;
  367. for (devnum = 0; devnum < SNDRV_CARDS; devnum++)
  368. if (enable[devnum])
  369. break;
  370. if (devnum >= SNDRV_CARDS)
  371. return -ENODEV;
  372. err = snd_card_new(&intf->dev,
  373. index[devnum], id[devnum], THIS_MODULE,
  374. sizeof(struct snd_usb_caiaqdev), &card);
  375. if (err < 0)
  376. return err;
  377. cdev = caiaqdev(card);
  378. cdev->chip.dev = usb_dev;
  379. cdev->chip.card = card;
  380. cdev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor),
  381. le16_to_cpu(usb_dev->descriptor.idProduct));
  382. spin_lock_init(&cdev->spinlock);
  383. *cardp = card;
  384. return 0;
  385. }
  386. static int init_card(struct snd_usb_caiaqdev *cdev)
  387. {
  388. char *c, usbpath[32];
  389. struct usb_device *usb_dev = cdev->chip.dev;
  390. struct snd_card *card = cdev->chip.card;
  391. struct device *dev = caiaqdev_to_dev(cdev);
  392. int err, len;
  393. if (usb_set_interface(usb_dev, 0, 1) != 0) {
  394. dev_err(dev, "can't set alt interface.\n");
  395. return -EIO;
  396. }
  397. usb_init_urb(&cdev->ep1_in_urb);
  398. usb_init_urb(&cdev->midi_out_urb);
  399. usb_fill_bulk_urb(&cdev->ep1_in_urb, usb_dev,
  400. usb_rcvbulkpipe(usb_dev, 0x1),
  401. cdev->ep1_in_buf, EP1_BUFSIZE,
  402. usb_ep1_command_reply_dispatch, cdev);
  403. usb_fill_bulk_urb(&cdev->midi_out_urb, usb_dev,
  404. usb_sndbulkpipe(usb_dev, 0x1),
  405. cdev->midi_out_buf, EP1_BUFSIZE,
  406. snd_usb_caiaq_midi_output_done, cdev);
  407. init_waitqueue_head(&cdev->ep1_wait_queue);
  408. init_waitqueue_head(&cdev->prepare_wait_queue);
  409. if (usb_submit_urb(&cdev->ep1_in_urb, GFP_KERNEL) != 0)
  410. return -EIO;
  411. err = snd_usb_caiaq_send_command(cdev, EP1_CMD_GET_DEVICE_INFO, NULL, 0);
  412. if (err)
  413. return err;
  414. if (!wait_event_timeout(cdev->ep1_wait_queue, cdev->spec_received, HZ))
  415. return -ENODEV;
  416. usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
  417. cdev->vendor_name, CAIAQ_USB_STR_LEN);
  418. usb_string(usb_dev, usb_dev->descriptor.iProduct,
  419. cdev->product_name, CAIAQ_USB_STR_LEN);
  420. strlcpy(card->driver, MODNAME, sizeof(card->driver));
  421. strlcpy(card->shortname, cdev->product_name, sizeof(card->shortname));
  422. strlcpy(card->mixername, cdev->product_name, sizeof(card->mixername));
  423. /* if the id was not passed as module option, fill it with a shortened
  424. * version of the product string which does not contain any
  425. * whitespaces */
  426. if (*card->id == '\0') {
  427. char id[sizeof(card->id)];
  428. memset(id, 0, sizeof(id));
  429. for (c = card->shortname, len = 0;
  430. *c && len < sizeof(card->id); c++)
  431. if (*c != ' ')
  432. id[len++] = *c;
  433. snd_card_set_id(card, id);
  434. }
  435. usb_make_path(usb_dev, usbpath, sizeof(usbpath));
  436. snprintf(card->longname, sizeof(card->longname), "%s %s (%s)",
  437. cdev->vendor_name, cdev->product_name, usbpath);
  438. setup_card(cdev);
  439. return 0;
  440. }
  441. static int snd_probe(struct usb_interface *intf,
  442. const struct usb_device_id *id)
  443. {
  444. int ret;
  445. struct snd_card *card = NULL;
  446. struct usb_device *usb_dev = interface_to_usbdev(intf);
  447. ret = create_card(usb_dev, intf, &card);
  448. if (ret < 0)
  449. return ret;
  450. usb_set_intfdata(intf, card);
  451. ret = init_card(caiaqdev(card));
  452. if (ret < 0) {
  453. dev_err(&usb_dev->dev, "unable to init card! (ret=%d)\n", ret);
  454. snd_card_free(card);
  455. return ret;
  456. }
  457. return 0;
  458. }
  459. static void snd_disconnect(struct usb_interface *intf)
  460. {
  461. struct snd_card *card = usb_get_intfdata(intf);
  462. struct device *dev = intf->usb_dev;
  463. struct snd_usb_caiaqdev *cdev;
  464. if (!card)
  465. return;
  466. cdev = caiaqdev(card);
  467. dev_dbg(dev, "%s(%p)\n", __func__, intf);
  468. snd_card_disconnect(card);
  469. #ifdef CONFIG_SND_USB_CAIAQ_INPUT
  470. snd_usb_caiaq_input_free(cdev);
  471. #endif
  472. snd_usb_caiaq_audio_free(cdev);
  473. usb_kill_urb(&cdev->ep1_in_urb);
  474. usb_kill_urb(&cdev->midi_out_urb);
  475. snd_card_free(card);
  476. usb_reset_device(interface_to_usbdev(intf));
  477. }
  478. MODULE_DEVICE_TABLE(usb, snd_usb_id_table);
  479. static struct usb_driver snd_usb_driver = {
  480. .name = MODNAME,
  481. .probe = snd_probe,
  482. .disconnect = snd_disconnect,
  483. .id_table = snd_usb_id_table,
  484. };
  485. module_usb_driver(snd_usb_driver);