podhd.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Line 6 Pod HD
  4. *
  5. * Copyright (C) 2011 Stefan Hajnoczi <[email protected]>
  6. * Copyright (C) 2015 Andrej Krutak <[email protected]>
  7. * Copyright (C) 2017 Hans P. Moller <[email protected]>
  8. */
  9. #include <linux/usb.h>
  10. #include <linux/slab.h>
  11. #include <linux/module.h>
  12. #include <sound/core.h>
  13. #include <sound/control.h>
  14. #include <sound/pcm.h>
  15. #include "driver.h"
  16. #include "pcm.h"
  17. #define PODHD_STARTUP_DELAY 500
  18. enum {
  19. LINE6_PODHD300,
  20. LINE6_PODHD400,
  21. LINE6_PODHD500,
  22. LINE6_PODX3,
  23. LINE6_PODX3LIVE,
  24. LINE6_PODHD500X,
  25. LINE6_PODHDDESKTOP
  26. };
  27. struct usb_line6_podhd {
  28. /* Generic Line 6 USB data */
  29. struct usb_line6 line6;
  30. /* Serial number of device */
  31. u32 serial_number;
  32. /* Firmware version */
  33. int firmware_version;
  34. /* Monitor level */
  35. int monitor_level;
  36. };
  37. #define line6_to_podhd(x) container_of(x, struct usb_line6_podhd, line6)
  38. static const struct snd_ratden podhd_ratden = {
  39. .num_min = 48000,
  40. .num_max = 48000,
  41. .num_step = 1,
  42. .den = 1,
  43. };
  44. static struct line6_pcm_properties podhd_pcm_properties = {
  45. .playback_hw = {
  46. .info = (SNDRV_PCM_INFO_MMAP |
  47. SNDRV_PCM_INFO_INTERLEAVED |
  48. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  49. SNDRV_PCM_INFO_MMAP_VALID |
  50. SNDRV_PCM_INFO_PAUSE |
  51. SNDRV_PCM_INFO_SYNC_START),
  52. .formats = SNDRV_PCM_FMTBIT_S24_3LE,
  53. .rates = SNDRV_PCM_RATE_48000,
  54. .rate_min = 48000,
  55. .rate_max = 48000,
  56. .channels_min = 2,
  57. .channels_max = 2,
  58. .buffer_bytes_max = 60000,
  59. .period_bytes_min = 64,
  60. .period_bytes_max = 8192,
  61. .periods_min = 1,
  62. .periods_max = 1024},
  63. .capture_hw = {
  64. .info = (SNDRV_PCM_INFO_MMAP |
  65. SNDRV_PCM_INFO_INTERLEAVED |
  66. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  67. SNDRV_PCM_INFO_MMAP_VALID |
  68. SNDRV_PCM_INFO_SYNC_START),
  69. .formats = SNDRV_PCM_FMTBIT_S24_3LE,
  70. .rates = SNDRV_PCM_RATE_48000,
  71. .rate_min = 48000,
  72. .rate_max = 48000,
  73. .channels_min = 2,
  74. .channels_max = 2,
  75. .buffer_bytes_max = 60000,
  76. .period_bytes_min = 64,
  77. .period_bytes_max = 8192,
  78. .periods_min = 1,
  79. .periods_max = 1024},
  80. .rates = {
  81. .nrats = 1,
  82. .rats = &podhd_ratden},
  83. .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */
  84. };
  85. static struct line6_pcm_properties podx3_pcm_properties = {
  86. .playback_hw = {
  87. .info = (SNDRV_PCM_INFO_MMAP |
  88. SNDRV_PCM_INFO_INTERLEAVED |
  89. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  90. SNDRV_PCM_INFO_MMAP_VALID |
  91. SNDRV_PCM_INFO_PAUSE |
  92. SNDRV_PCM_INFO_SYNC_START),
  93. .formats = SNDRV_PCM_FMTBIT_S24_3LE,
  94. .rates = SNDRV_PCM_RATE_48000,
  95. .rate_min = 48000,
  96. .rate_max = 48000,
  97. .channels_min = 2,
  98. .channels_max = 2,
  99. .buffer_bytes_max = 60000,
  100. .period_bytes_min = 64,
  101. .period_bytes_max = 8192,
  102. .periods_min = 1,
  103. .periods_max = 1024},
  104. .capture_hw = {
  105. .info = (SNDRV_PCM_INFO_MMAP |
  106. SNDRV_PCM_INFO_INTERLEAVED |
  107. SNDRV_PCM_INFO_BLOCK_TRANSFER |
  108. SNDRV_PCM_INFO_MMAP_VALID |
  109. SNDRV_PCM_INFO_SYNC_START),
  110. .formats = SNDRV_PCM_FMTBIT_S24_3LE,
  111. .rates = SNDRV_PCM_RATE_48000,
  112. .rate_min = 48000,
  113. .rate_max = 48000,
  114. /* 1+2: Main signal (out), 3+4: Tone 1,
  115. * 5+6: Tone 2, 7+8: raw
  116. */
  117. .channels_min = 8,
  118. .channels_max = 8,
  119. .buffer_bytes_max = 60000,
  120. .period_bytes_min = 64,
  121. .period_bytes_max = 8192,
  122. .periods_min = 1,
  123. .periods_max = 1024},
  124. .rates = {
  125. .nrats = 1,
  126. .rats = &podhd_ratden},
  127. .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */
  128. };
  129. static struct usb_driver podhd_driver;
  130. static ssize_t serial_number_show(struct device *dev,
  131. struct device_attribute *attr, char *buf)
  132. {
  133. struct snd_card *card = dev_to_snd_card(dev);
  134. struct usb_line6_podhd *pod = card->private_data;
  135. return sysfs_emit(buf, "%u\n", pod->serial_number);
  136. }
  137. static ssize_t firmware_version_show(struct device *dev,
  138. struct device_attribute *attr, char *buf)
  139. {
  140. struct snd_card *card = dev_to_snd_card(dev);
  141. struct usb_line6_podhd *pod = card->private_data;
  142. return sysfs_emit(buf, "%06x\n", pod->firmware_version);
  143. }
  144. static DEVICE_ATTR_RO(firmware_version);
  145. static DEVICE_ATTR_RO(serial_number);
  146. static struct attribute *podhd_dev_attrs[] = {
  147. &dev_attr_firmware_version.attr,
  148. &dev_attr_serial_number.attr,
  149. NULL
  150. };
  151. static const struct attribute_group podhd_dev_attr_group = {
  152. .name = "podhd",
  153. .attrs = podhd_dev_attrs,
  154. };
  155. /*
  156. * POD X3 startup procedure.
  157. *
  158. * May be compatible with other POD HD's, since it's also similar to the
  159. * previous POD setup. In any case, it doesn't seem to be required for the
  160. * audio nor bulk interfaces to work.
  161. */
  162. static int podhd_dev_start(struct usb_line6_podhd *pod)
  163. {
  164. int ret;
  165. u8 init_bytes[8];
  166. int i;
  167. struct usb_device *usbdev = pod->line6.usbdev;
  168. ret = usb_control_msg_send(usbdev, 0,
  169. 0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
  170. 0x11, 0,
  171. NULL, 0, LINE6_TIMEOUT, GFP_KERNEL);
  172. if (ret) {
  173. dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret);
  174. goto exit;
  175. }
  176. /* NOTE: looks like some kind of ping message */
  177. ret = usb_control_msg_recv(usbdev, 0, 0x67,
  178. USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
  179. 0x11, 0x0,
  180. init_bytes, 3, LINE6_TIMEOUT, GFP_KERNEL);
  181. if (ret) {
  182. dev_err(pod->line6.ifcdev,
  183. "receive length failed (error %d)\n", ret);
  184. goto exit;
  185. }
  186. pod->firmware_version =
  187. (init_bytes[0] << 16) | (init_bytes[1] << 8) | (init_bytes[2] << 0);
  188. for (i = 0; i <= 16; i++) {
  189. ret = line6_read_data(&pod->line6, 0xf000 + 0x08 * i, init_bytes, 8);
  190. if (ret < 0)
  191. goto exit;
  192. }
  193. ret = usb_control_msg_send(usbdev, 0,
  194. USB_REQ_SET_FEATURE,
  195. USB_TYPE_STANDARD | USB_RECIP_DEVICE | USB_DIR_OUT,
  196. 1, 0,
  197. NULL, 0, LINE6_TIMEOUT, GFP_KERNEL);
  198. exit:
  199. return ret;
  200. }
  201. static void podhd_startup(struct usb_line6 *line6)
  202. {
  203. struct usb_line6_podhd *pod = line6_to_podhd(line6);
  204. podhd_dev_start(pod);
  205. line6_read_serial_number(&pod->line6, &pod->serial_number);
  206. if (snd_card_register(line6->card))
  207. dev_err(line6->ifcdev, "Failed to register POD HD card.\n");
  208. }
  209. static void podhd_disconnect(struct usb_line6 *line6)
  210. {
  211. struct usb_line6_podhd *pod = line6_to_podhd(line6);
  212. if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO) {
  213. struct usb_interface *intf;
  214. intf = usb_ifnum_to_if(line6->usbdev,
  215. pod->line6.properties->ctrl_if);
  216. if (intf)
  217. usb_driver_release_interface(&podhd_driver, intf);
  218. }
  219. }
  220. static const unsigned int float_zero_to_one_lookup[] = {
  221. 0x00000000, 0x3c23d70a, 0x3ca3d70a, 0x3cf5c28f, 0x3d23d70a, 0x3d4ccccd,
  222. 0x3d75c28f, 0x3d8f5c29, 0x3da3d70a, 0x3db851ec, 0x3dcccccd, 0x3de147ae,
  223. 0x3df5c28f, 0x3e051eb8, 0x3e0f5c29, 0x3e19999a, 0x3e23d70a, 0x3e2e147b,
  224. 0x3e3851ec, 0x3e428f5c, 0x3e4ccccd, 0x3e570a3d, 0x3e6147ae, 0x3e6b851f,
  225. 0x3e75c28f, 0x3e800000, 0x3e851eb8, 0x3e8a3d71, 0x3e8f5c29, 0x3e947ae1,
  226. 0x3e99999a, 0x3e9eb852, 0x3ea3d70a, 0x3ea8f5c3, 0x3eae147b, 0x3eb33333,
  227. 0x3eb851ec, 0x3ebd70a4, 0x3ec28f5c, 0x3ec7ae14, 0x3ecccccd, 0x3ed1eb85,
  228. 0x3ed70a3d, 0x3edc28f6, 0x3ee147ae, 0x3ee66666, 0x3eeb851f, 0x3ef0a3d7,
  229. 0x3ef5c28f, 0x3efae148, 0x3f000000, 0x3f028f5c, 0x3f051eb8, 0x3f07ae14,
  230. 0x3f0a3d71, 0x3f0ccccd, 0x3f0f5c29, 0x3f11eb85, 0x3f147ae1, 0x3f170a3d,
  231. 0x3f19999a, 0x3f1c28f6, 0x3f1eb852, 0x3f2147ae, 0x3f23d70a, 0x3f266666,
  232. 0x3f28f5c3, 0x3f2b851f, 0x3f2e147b, 0x3f30a3d7, 0x3f333333, 0x3f35c28f,
  233. 0x3f3851ec, 0x3f3ae148, 0x3f3d70a4, 0x3f400000, 0x3f428f5c, 0x3f451eb8,
  234. 0x3f47ae14, 0x3f4a3d71, 0x3f4ccccd, 0x3f4f5c29, 0x3f51eb85, 0x3f547ae1,
  235. 0x3f570a3d, 0x3f59999a, 0x3f5c28f6, 0x3f5eb852, 0x3f6147ae, 0x3f63d70a,
  236. 0x3f666666, 0x3f68f5c3, 0x3f6b851f, 0x3f6e147b, 0x3f70a3d7, 0x3f733333,
  237. 0x3f75c28f, 0x3f7851ec, 0x3f7ae148, 0x3f7d70a4, 0x3f800000
  238. };
  239. static void podhd_set_monitor_level(struct usb_line6_podhd *podhd, int value)
  240. {
  241. unsigned int fl;
  242. static const unsigned char msg[16] = {
  243. /* Chunk is 0xc bytes (without first word) */
  244. 0x0c, 0x00,
  245. /* First chunk in the message */
  246. 0x01, 0x00,
  247. /* Message size is 2 4-byte words */
  248. 0x02, 0x00,
  249. /* Unknown */
  250. 0x04, 0x41,
  251. /* Unknown */
  252. 0x04, 0x00, 0x13, 0x00,
  253. /* Volume, LE float32, 0.0 - 1.0 */
  254. 0x00, 0x00, 0x00, 0x00
  255. };
  256. unsigned char *buf;
  257. buf = kmemdup(msg, sizeof(msg), GFP_KERNEL);
  258. if (!buf)
  259. return;
  260. if (value < 0)
  261. value = 0;
  262. if (value >= ARRAY_SIZE(float_zero_to_one_lookup))
  263. value = ARRAY_SIZE(float_zero_to_one_lookup) - 1;
  264. fl = float_zero_to_one_lookup[value];
  265. buf[12] = (fl >> 0) & 0xff;
  266. buf[13] = (fl >> 8) & 0xff;
  267. buf[14] = (fl >> 16) & 0xff;
  268. buf[15] = (fl >> 24) & 0xff;
  269. line6_send_raw_message(&podhd->line6, buf, sizeof(msg));
  270. kfree(buf);
  271. podhd->monitor_level = value;
  272. }
  273. /* control info callback */
  274. static int snd_podhd_control_monitor_info(struct snd_kcontrol *kcontrol,
  275. struct snd_ctl_elem_info *uinfo)
  276. {
  277. uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
  278. uinfo->count = 1;
  279. uinfo->value.integer.min = 0;
  280. uinfo->value.integer.max = 100;
  281. uinfo->value.integer.step = 1;
  282. return 0;
  283. }
  284. /* control get callback */
  285. static int snd_podhd_control_monitor_get(struct snd_kcontrol *kcontrol,
  286. struct snd_ctl_elem_value *ucontrol)
  287. {
  288. struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
  289. struct usb_line6_podhd *podhd = line6_to_podhd(line6pcm->line6);
  290. ucontrol->value.integer.value[0] = podhd->monitor_level;
  291. return 0;
  292. }
  293. /* control put callback */
  294. static int snd_podhd_control_monitor_put(struct snd_kcontrol *kcontrol,
  295. struct snd_ctl_elem_value *ucontrol)
  296. {
  297. struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
  298. struct usb_line6_podhd *podhd = line6_to_podhd(line6pcm->line6);
  299. if (ucontrol->value.integer.value[0] == podhd->monitor_level)
  300. return 0;
  301. podhd_set_monitor_level(podhd, ucontrol->value.integer.value[0]);
  302. return 1;
  303. }
  304. /* control definition */
  305. static const struct snd_kcontrol_new podhd_control_monitor = {
  306. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  307. .name = "Monitor Playback Volume",
  308. .index = 0,
  309. .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
  310. .info = snd_podhd_control_monitor_info,
  311. .get = snd_podhd_control_monitor_get,
  312. .put = snd_podhd_control_monitor_put
  313. };
  314. /*
  315. Try to init POD HD device.
  316. */
  317. static int podhd_init(struct usb_line6 *line6,
  318. const struct usb_device_id *id)
  319. {
  320. int err;
  321. struct usb_line6_podhd *pod = line6_to_podhd(line6);
  322. struct usb_interface *intf;
  323. line6->disconnect = podhd_disconnect;
  324. line6->startup = podhd_startup;
  325. if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL) {
  326. /* claim the data interface */
  327. intf = usb_ifnum_to_if(line6->usbdev,
  328. pod->line6.properties->ctrl_if);
  329. if (!intf) {
  330. dev_err(pod->line6.ifcdev, "interface %d not found\n",
  331. pod->line6.properties->ctrl_if);
  332. return -ENODEV;
  333. }
  334. err = usb_driver_claim_interface(&podhd_driver, intf, NULL);
  335. if (err != 0) {
  336. dev_err(pod->line6.ifcdev, "can't claim interface %d, error %d\n",
  337. pod->line6.properties->ctrl_if, err);
  338. return err;
  339. }
  340. }
  341. if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO) {
  342. /* create sysfs entries: */
  343. err = snd_card_add_dev_attr(line6->card, &podhd_dev_attr_group);
  344. if (err < 0)
  345. return err;
  346. }
  347. if (pod->line6.properties->capabilities & LINE6_CAP_PCM) {
  348. /* initialize PCM subsystem: */
  349. err = line6_init_pcm(line6,
  350. (id->driver_info == LINE6_PODX3 ||
  351. id->driver_info == LINE6_PODX3LIVE) ? &podx3_pcm_properties :
  352. &podhd_pcm_properties);
  353. if (err < 0)
  354. return err;
  355. }
  356. if (pod->line6.properties->capabilities & LINE6_CAP_HWMON_CTL) {
  357. podhd_set_monitor_level(pod, 100);
  358. err = snd_ctl_add(line6->card,
  359. snd_ctl_new1(&podhd_control_monitor,
  360. line6->line6pcm));
  361. if (err < 0)
  362. return err;
  363. }
  364. if (!(pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO)) {
  365. /* register USB audio system directly */
  366. return snd_card_register(line6->card);
  367. }
  368. /* init device and delay registering */
  369. schedule_delayed_work(&line6->startup_work,
  370. msecs_to_jiffies(PODHD_STARTUP_DELAY));
  371. return 0;
  372. }
  373. #define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
  374. #define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n)
  375. /* table of devices that work with this driver */
  376. static const struct usb_device_id podhd_id_table[] = {
  377. /* TODO: no need to alloc data interfaces when only audio is used */
  378. { LINE6_DEVICE(0x5057), .driver_info = LINE6_PODHD300 },
  379. { LINE6_DEVICE(0x5058), .driver_info = LINE6_PODHD400 },
  380. { LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500 },
  381. { LINE6_IF_NUM(0x414A, 0), .driver_info = LINE6_PODX3 },
  382. { LINE6_IF_NUM(0x414B, 0), .driver_info = LINE6_PODX3LIVE },
  383. { LINE6_IF_NUM(0x4159, 0), .driver_info = LINE6_PODHD500X },
  384. { LINE6_IF_NUM(0x4156, 0), .driver_info = LINE6_PODHDDESKTOP },
  385. {}
  386. };
  387. MODULE_DEVICE_TABLE(usb, podhd_id_table);
  388. static const struct line6_properties podhd_properties_table[] = {
  389. [LINE6_PODHD300] = {
  390. .id = "PODHD300",
  391. .name = "POD HD300",
  392. .capabilities = LINE6_CAP_PCM
  393. | LINE6_CAP_HWMON,
  394. .altsetting = 5,
  395. .ep_ctrl_r = 0x84,
  396. .ep_ctrl_w = 0x03,
  397. .ep_audio_r = 0x82,
  398. .ep_audio_w = 0x01,
  399. },
  400. [LINE6_PODHD400] = {
  401. .id = "PODHD400",
  402. .name = "POD HD400",
  403. .capabilities = LINE6_CAP_PCM
  404. | LINE6_CAP_HWMON,
  405. .altsetting = 5,
  406. .ep_ctrl_r = 0x84,
  407. .ep_ctrl_w = 0x03,
  408. .ep_audio_r = 0x82,
  409. .ep_audio_w = 0x01,
  410. },
  411. [LINE6_PODHD500] = {
  412. .id = "PODHD500",
  413. .name = "POD HD500",
  414. .capabilities = LINE6_CAP_PCM | LINE6_CAP_CONTROL
  415. | LINE6_CAP_HWMON | LINE6_CAP_HWMON_CTL,
  416. .altsetting = 1,
  417. .ctrl_if = 1,
  418. .ep_ctrl_r = 0x81,
  419. .ep_ctrl_w = 0x01,
  420. .ep_audio_r = 0x86,
  421. .ep_audio_w = 0x02,
  422. },
  423. [LINE6_PODX3] = {
  424. .id = "PODX3",
  425. .name = "POD X3",
  426. .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO
  427. | LINE6_CAP_PCM | LINE6_CAP_HWMON | LINE6_CAP_IN_NEEDS_OUT,
  428. .altsetting = 1,
  429. .ep_ctrl_r = 0x81,
  430. .ep_ctrl_w = 0x01,
  431. .ctrl_if = 1,
  432. .ep_audio_r = 0x86,
  433. .ep_audio_w = 0x02,
  434. },
  435. [LINE6_PODX3LIVE] = {
  436. .id = "PODX3LIVE",
  437. .name = "POD X3 LIVE",
  438. .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO
  439. | LINE6_CAP_PCM | LINE6_CAP_HWMON | LINE6_CAP_IN_NEEDS_OUT,
  440. .altsetting = 1,
  441. .ep_ctrl_r = 0x81,
  442. .ep_ctrl_w = 0x01,
  443. .ctrl_if = 1,
  444. .ep_audio_r = 0x86,
  445. .ep_audio_w = 0x02,
  446. },
  447. [LINE6_PODHD500X] = {
  448. .id = "PODHD500X",
  449. .name = "POD HD500X",
  450. .capabilities = LINE6_CAP_CONTROL
  451. | LINE6_CAP_PCM | LINE6_CAP_HWMON,
  452. .altsetting = 1,
  453. .ep_ctrl_r = 0x81,
  454. .ep_ctrl_w = 0x01,
  455. .ctrl_if = 1,
  456. .ep_audio_r = 0x86,
  457. .ep_audio_w = 0x02,
  458. },
  459. [LINE6_PODHDDESKTOP] = {
  460. .id = "PODHDDESKTOP",
  461. .name = "POD HDDESKTOP",
  462. .capabilities = LINE6_CAP_CONTROL
  463. | LINE6_CAP_PCM | LINE6_CAP_HWMON,
  464. .altsetting = 1,
  465. .ep_ctrl_r = 0x81,
  466. .ep_ctrl_w = 0x01,
  467. .ctrl_if = 1,
  468. .ep_audio_r = 0x86,
  469. .ep_audio_w = 0x02,
  470. },
  471. };
  472. /*
  473. Probe USB device.
  474. */
  475. static int podhd_probe(struct usb_interface *interface,
  476. const struct usb_device_id *id)
  477. {
  478. return line6_probe(interface, id, "Line6-PODHD",
  479. &podhd_properties_table[id->driver_info],
  480. podhd_init, sizeof(struct usb_line6_podhd));
  481. }
  482. static struct usb_driver podhd_driver = {
  483. .name = KBUILD_MODNAME,
  484. .probe = podhd_probe,
  485. .disconnect = line6_disconnect,
  486. #ifdef CONFIG_PM
  487. .suspend = line6_suspend,
  488. .resume = line6_resume,
  489. .reset_resume = line6_resume,
  490. #endif
  491. .id_table = podhd_id_table,
  492. };
  493. module_usb_driver(podhd_driver);
  494. MODULE_DESCRIPTION("Line 6 PODHD USB driver");
  495. MODULE_LICENSE("GPL");