radio-mr800.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. * A driver for the AverMedia MR 800 USB FM radio. This device plugs
  3. * into both the USB and an analog audio input, so this thing
  4. * only deals with initialization and frequency setting, the
  5. * audio data has to be handled by a sound driver.
  6. *
  7. * Copyright (c) 2008 Alexey Klimov <klimov.linux@gmail.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. /*
  24. * Big thanks to authors and contributors of dsbr100.c and radio-si470x.c
  25. *
  26. * When work was looked pretty good, i discover this:
  27. * http://av-usbradio.sourceforge.net/index.php
  28. * http://sourceforge.net/projects/av-usbradio/
  29. * Latest release of theirs project was in 2005.
  30. * Probably, this driver could be improved through using their
  31. * achievements (specifications given).
  32. * Also, Faidon Liambotis <paravoid@debian.org> wrote nice driver for this radio
  33. * in 2007. He allowed to use his driver to improve current mr800 radio driver.
  34. * http://kerneltrap.org/mailarchive/linux-usb-devel/2007/10/11/342492
  35. *
  36. * Version 0.01: First working version.
  37. * It's required to blacklist AverMedia USB Radio
  38. * in usbhid/hid-quirks.c
  39. * Version 0.10: A lot of cleanups and fixes: unpluging the device,
  40. * few mutex locks were added, codinstyle issues, etc.
  41. * Added stereo support. Thanks to
  42. * Douglas Schilling Landgraf <dougsland@gmail.com> and
  43. * David Ellingsworth <david@identd.dyndns.org>
  44. * for discussion, help and support.
  45. * Version 0.11: Converted to v4l2_device.
  46. *
  47. * Many things to do:
  48. * - Correct power management of device (suspend & resume)
  49. * - Add code for scanning and smooth tuning
  50. * - Add code for sensitivity value
  51. * - Correct mistakes
  52. * - In Japan another FREQ_MIN and FREQ_MAX
  53. */
  54. /* kernel includes */
  55. #include <linux/kernel.h>
  56. #include <linux/module.h>
  57. #include <linux/init.h>
  58. #include <linux/slab.h>
  59. #include <linux/input.h>
  60. #include <linux/videodev2.h>
  61. #include <media/v4l2-device.h>
  62. #include <media/v4l2-ioctl.h>
  63. #include <media/v4l2-ctrls.h>
  64. #include <media/v4l2-event.h>
  65. #include <linux/usb.h>
  66. #include <linux/mutex.h>
  67. /* driver and module definitions */
  68. #define DRIVER_AUTHOR "Alexey Klimov <klimov.linux@gmail.com>"
  69. #define DRIVER_DESC "AverMedia MR 800 USB FM radio driver"
  70. #define DRIVER_VERSION "0.1.2"
  71. MODULE_AUTHOR(DRIVER_AUTHOR);
  72. MODULE_DESCRIPTION(DRIVER_DESC);
  73. MODULE_LICENSE("GPL");
  74. MODULE_VERSION(DRIVER_VERSION);
  75. #define USB_AMRADIO_VENDOR 0x07ca
  76. #define USB_AMRADIO_PRODUCT 0xb800
  77. /* dev_warn macro with driver name */
  78. #define MR800_DRIVER_NAME "radio-mr800"
  79. #define amradio_dev_warn(dev, fmt, arg...) \
  80. dev_warn(dev, MR800_DRIVER_NAME " - " fmt, ##arg)
  81. #define amradio_dev_err(dev, fmt, arg...) \
  82. dev_err(dev, MR800_DRIVER_NAME " - " fmt, ##arg)
  83. /* Probably USB_TIMEOUT should be modified in module parameter */
  84. #define BUFFER_LENGTH 8
  85. #define USB_TIMEOUT 500
  86. /* Frequency limits in MHz -- these are European values. For Japanese
  87. devices, that would be 76 and 91. */
  88. #define FREQ_MIN 87.5
  89. #define FREQ_MAX 108.0
  90. #define FREQ_MUL 16000
  91. /*
  92. * Commands that device should understand
  93. * List isn't full and will be updated with implementation of new functions
  94. */
  95. #define AMRADIO_SET_FREQ 0xa4
  96. #define AMRADIO_GET_SIGNAL 0xa7
  97. #define AMRADIO_SET_MUTE 0xab
  98. #define AMRADIO_SET_MONO 0xae
  99. /* Comfortable defines for amradio_set_mute */
  100. #define AMRADIO_START 0x00
  101. #define AMRADIO_STOP 0x01
  102. /* Comfortable defines for amradio_set_stereo */
  103. #define WANT_STEREO 0x00
  104. #define WANT_MONO 0x01
  105. /* module parameter */
  106. static int radio_nr = -1;
  107. module_param(radio_nr, int, 0);
  108. MODULE_PARM_DESC(radio_nr, "Radio Nr");
  109. /* Data for one (physical) device */
  110. struct amradio_device {
  111. /* reference to USB and video device */
  112. struct usb_device *usbdev;
  113. struct usb_interface *intf;
  114. struct video_device vdev;
  115. struct v4l2_device v4l2_dev;
  116. struct v4l2_ctrl_handler hdl;
  117. unsigned char *buffer;
  118. struct mutex lock; /* buffer locking */
  119. int curfreq;
  120. int stereo;
  121. int muted;
  122. };
  123. static inline struct amradio_device *to_amradio_dev(struct v4l2_device *v4l2_dev)
  124. {
  125. return container_of(v4l2_dev, struct amradio_device, v4l2_dev);
  126. }
  127. /* switch on/off the radio. Send 8 bytes to device */
  128. static int amradio_set_mute(struct amradio_device *radio, char argument)
  129. {
  130. int retval;
  131. int size;
  132. radio->buffer[0] = 0x00;
  133. radio->buffer[1] = 0x55;
  134. radio->buffer[2] = 0xaa;
  135. radio->buffer[3] = 0x00;
  136. radio->buffer[4] = AMRADIO_SET_MUTE;
  137. radio->buffer[5] = argument;
  138. radio->buffer[6] = 0x00;
  139. radio->buffer[7] = 0x00;
  140. retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
  141. (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
  142. if (retval < 0 || size != BUFFER_LENGTH) {
  143. amradio_dev_warn(&radio->vdev.dev, "set mute failed\n");
  144. return retval < 0 ? retval : -EIO;
  145. }
  146. radio->muted = argument;
  147. return 0;
  148. }
  149. /* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
  150. static int amradio_setfreq(struct amradio_device *radio, int freq)
  151. {
  152. unsigned short freq_send = 0x10 + (freq >> 3) / 25;
  153. int retval;
  154. int size;
  155. radio->buffer[0] = 0x00;
  156. radio->buffer[1] = 0x55;
  157. radio->buffer[2] = 0xaa;
  158. radio->buffer[3] = 0x03;
  159. radio->buffer[4] = AMRADIO_SET_FREQ;
  160. radio->buffer[5] = 0x00;
  161. radio->buffer[6] = 0x00;
  162. radio->buffer[7] = 0x08;
  163. retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
  164. (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
  165. if (retval < 0 || size != BUFFER_LENGTH)
  166. goto out;
  167. /* frequency is calculated from freq_send and placed in first 2 bytes */
  168. radio->buffer[0] = (freq_send >> 8) & 0xff;
  169. radio->buffer[1] = freq_send & 0xff;
  170. radio->buffer[2] = 0x01;
  171. radio->buffer[3] = 0x00;
  172. radio->buffer[4] = 0x00;
  173. /* 5 and 6 bytes of buffer already = 0x00 */
  174. radio->buffer[7] = 0x00;
  175. retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
  176. (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
  177. if (retval >= 0 && size == BUFFER_LENGTH) {
  178. radio->curfreq = freq;
  179. return 0;
  180. }
  181. out:
  182. amradio_dev_warn(&radio->vdev.dev, "set frequency failed\n");
  183. return retval < 0 ? retval : -EIO;
  184. }
  185. static int amradio_set_stereo(struct amradio_device *radio, char argument)
  186. {
  187. int retval;
  188. int size;
  189. radio->buffer[0] = 0x00;
  190. radio->buffer[1] = 0x55;
  191. radio->buffer[2] = 0xaa;
  192. radio->buffer[3] = 0x00;
  193. radio->buffer[4] = AMRADIO_SET_MONO;
  194. radio->buffer[5] = argument;
  195. radio->buffer[6] = 0x00;
  196. radio->buffer[7] = 0x00;
  197. retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
  198. (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
  199. if (retval < 0 || size != BUFFER_LENGTH) {
  200. amradio_dev_warn(&radio->vdev.dev, "set stereo failed\n");
  201. return retval < 0 ? retval : -EIO;
  202. }
  203. radio->stereo = (argument == WANT_STEREO);
  204. return 0;
  205. }
  206. static int amradio_get_stat(struct amradio_device *radio, bool *is_stereo, u32 *signal)
  207. {
  208. int retval;
  209. int size;
  210. radio->buffer[0] = 0x00;
  211. radio->buffer[1] = 0x55;
  212. radio->buffer[2] = 0xaa;
  213. radio->buffer[3] = 0x00;
  214. radio->buffer[4] = AMRADIO_GET_SIGNAL;
  215. radio->buffer[5] = 0x00;
  216. radio->buffer[6] = 0x00;
  217. radio->buffer[7] = 0x08;
  218. retval = usb_bulk_msg(radio->usbdev, usb_sndbulkpipe(radio->usbdev, 0x02),
  219. radio->buffer, BUFFER_LENGTH, &size, USB_TIMEOUT);
  220. if (!retval)
  221. retval = usb_bulk_msg(radio->usbdev, usb_rcvbulkpipe(radio->usbdev, 0x81),
  222. radio->buffer, BUFFER_LENGTH, &size, USB_TIMEOUT);
  223. if (retval || size != BUFFER_LENGTH) {
  224. amradio_dev_warn(&radio->vdev.dev, "get stat failed\n");
  225. return retval;
  226. }
  227. *is_stereo = radio->buffer[2] >> 7;
  228. *signal = (radio->buffer[3] & 0xf0) << 8;
  229. return 0;
  230. }
  231. /* Handle unplugging the device.
  232. * We call video_unregister_device in any case.
  233. * The last function called in this procedure is
  234. * usb_amradio_device_release.
  235. */
  236. static void usb_amradio_disconnect(struct usb_interface *intf)
  237. {
  238. struct amradio_device *radio = to_amradio_dev(usb_get_intfdata(intf));
  239. mutex_lock(&radio->lock);
  240. usb_set_intfdata(intf, NULL);
  241. video_unregister_device(&radio->vdev);
  242. v4l2_device_disconnect(&radio->v4l2_dev);
  243. mutex_unlock(&radio->lock);
  244. v4l2_device_put(&radio->v4l2_dev);
  245. }
  246. /* vidioc_querycap - query device capabilities */
  247. static int vidioc_querycap(struct file *file, void *priv,
  248. struct v4l2_capability *v)
  249. {
  250. struct amradio_device *radio = video_drvdata(file);
  251. strlcpy(v->driver, "radio-mr800", sizeof(v->driver));
  252. strlcpy(v->card, "AverMedia MR 800 USB FM Radio", sizeof(v->card));
  253. usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
  254. v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER;
  255. v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
  256. return 0;
  257. }
  258. /* vidioc_g_tuner - get tuner attributes */
  259. static int vidioc_g_tuner(struct file *file, void *priv,
  260. struct v4l2_tuner *v)
  261. {
  262. struct amradio_device *radio = video_drvdata(file);
  263. bool is_stereo = false;
  264. int retval;
  265. if (v->index > 0)
  266. return -EINVAL;
  267. v->signal = 0;
  268. retval = amradio_get_stat(radio, &is_stereo, &v->signal);
  269. if (retval)
  270. return retval;
  271. strcpy(v->name, "FM");
  272. v->type = V4L2_TUNER_RADIO;
  273. v->rangelow = FREQ_MIN * FREQ_MUL;
  274. v->rangehigh = FREQ_MAX * FREQ_MUL;
  275. v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
  276. v->rxsubchans = is_stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
  277. v->audmode = radio->stereo ?
  278. V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO;
  279. return 0;
  280. }
  281. /* vidioc_s_tuner - set tuner attributes */
  282. static int vidioc_s_tuner(struct file *file, void *priv,
  283. struct v4l2_tuner *v)
  284. {
  285. struct amradio_device *radio = video_drvdata(file);
  286. if (v->index > 0)
  287. return -EINVAL;
  288. /* mono/stereo selector */
  289. switch (v->audmode) {
  290. case V4L2_TUNER_MODE_MONO:
  291. return amradio_set_stereo(radio, WANT_MONO);
  292. default:
  293. return amradio_set_stereo(radio, WANT_STEREO);
  294. }
  295. }
  296. /* vidioc_s_frequency - set tuner radio frequency */
  297. static int vidioc_s_frequency(struct file *file, void *priv,
  298. struct v4l2_frequency *f)
  299. {
  300. struct amradio_device *radio = video_drvdata(file);
  301. if (f->tuner != 0)
  302. return -EINVAL;
  303. return amradio_setfreq(radio, clamp_t(unsigned, f->frequency,
  304. FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL));
  305. }
  306. /* vidioc_g_frequency - get tuner radio frequency */
  307. static int vidioc_g_frequency(struct file *file, void *priv,
  308. struct v4l2_frequency *f)
  309. {
  310. struct amradio_device *radio = video_drvdata(file);
  311. if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
  312. return -EINVAL;
  313. f->type = V4L2_TUNER_RADIO;
  314. f->frequency = radio->curfreq;
  315. return 0;
  316. }
  317. static int usb_amradio_s_ctrl(struct v4l2_ctrl *ctrl)
  318. {
  319. struct amradio_device *radio =
  320. container_of(ctrl->handler, struct amradio_device, hdl);
  321. switch (ctrl->id) {
  322. case V4L2_CID_AUDIO_MUTE:
  323. return amradio_set_mute(radio,
  324. ctrl->val ? AMRADIO_STOP : AMRADIO_START);
  325. }
  326. return -EINVAL;
  327. }
  328. static int usb_amradio_init(struct amradio_device *radio)
  329. {
  330. int retval;
  331. retval = amradio_set_mute(radio, AMRADIO_STOP);
  332. if (retval)
  333. goto out_err;
  334. retval = amradio_set_stereo(radio, WANT_STEREO);
  335. if (retval)
  336. goto out_err;
  337. goto out;
  338. out_err:
  339. amradio_dev_err(&radio->vdev.dev, "initialization failed\n");
  340. out:
  341. return retval;
  342. }
  343. /* Suspend device - stop device. Need to be checked and fixed */
  344. static int usb_amradio_suspend(struct usb_interface *intf, pm_message_t message)
  345. {
  346. struct amradio_device *radio = to_amradio_dev(usb_get_intfdata(intf));
  347. mutex_lock(&radio->lock);
  348. if (!radio->muted) {
  349. amradio_set_mute(radio, AMRADIO_STOP);
  350. radio->muted = 0;
  351. }
  352. mutex_unlock(&radio->lock);
  353. dev_info(&intf->dev, "going into suspend..\n");
  354. return 0;
  355. }
  356. /* Resume device - start device. Need to be checked and fixed */
  357. static int usb_amradio_resume(struct usb_interface *intf)
  358. {
  359. struct amradio_device *radio = to_amradio_dev(usb_get_intfdata(intf));
  360. mutex_lock(&radio->lock);
  361. if (radio->stereo)
  362. amradio_set_stereo(radio, WANT_STEREO);
  363. else
  364. amradio_set_stereo(radio, WANT_MONO);
  365. amradio_setfreq(radio, radio->curfreq);
  366. if (!radio->muted)
  367. amradio_set_mute(radio, AMRADIO_START);
  368. mutex_unlock(&radio->lock);
  369. dev_info(&intf->dev, "coming out of suspend..\n");
  370. return 0;
  371. }
  372. static const struct v4l2_ctrl_ops usb_amradio_ctrl_ops = {
  373. .s_ctrl = usb_amradio_s_ctrl,
  374. };
  375. /* File system interface */
  376. static const struct v4l2_file_operations usb_amradio_fops = {
  377. .owner = THIS_MODULE,
  378. .open = v4l2_fh_open,
  379. .release = v4l2_fh_release,
  380. .poll = v4l2_ctrl_poll,
  381. .unlocked_ioctl = video_ioctl2,
  382. };
  383. static const struct v4l2_ioctl_ops usb_amradio_ioctl_ops = {
  384. .vidioc_querycap = vidioc_querycap,
  385. .vidioc_g_tuner = vidioc_g_tuner,
  386. .vidioc_s_tuner = vidioc_s_tuner,
  387. .vidioc_g_frequency = vidioc_g_frequency,
  388. .vidioc_s_frequency = vidioc_s_frequency,
  389. .vidioc_log_status = v4l2_ctrl_log_status,
  390. .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
  391. .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
  392. };
  393. static void usb_amradio_release(struct v4l2_device *v4l2_dev)
  394. {
  395. struct amradio_device *radio = to_amradio_dev(v4l2_dev);
  396. /* free rest memory */
  397. v4l2_ctrl_handler_free(&radio->hdl);
  398. v4l2_device_unregister(&radio->v4l2_dev);
  399. kfree(radio->buffer);
  400. kfree(radio);
  401. }
  402. /* check if the device is present and register with v4l and usb if it is */
  403. static int usb_amradio_probe(struct usb_interface *intf,
  404. const struct usb_device_id *id)
  405. {
  406. struct amradio_device *radio;
  407. int retval = 0;
  408. radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);
  409. if (!radio) {
  410. dev_err(&intf->dev, "kmalloc for amradio_device failed\n");
  411. retval = -ENOMEM;
  412. goto err;
  413. }
  414. radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);
  415. if (!radio->buffer) {
  416. dev_err(&intf->dev, "kmalloc for radio->buffer failed\n");
  417. retval = -ENOMEM;
  418. goto err_nobuf;
  419. }
  420. retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
  421. if (retval < 0) {
  422. dev_err(&intf->dev, "couldn't register v4l2_device\n");
  423. goto err_v4l2;
  424. }
  425. v4l2_ctrl_handler_init(&radio->hdl, 1);
  426. v4l2_ctrl_new_std(&radio->hdl, &usb_amradio_ctrl_ops,
  427. V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
  428. if (radio->hdl.error) {
  429. retval = radio->hdl.error;
  430. dev_err(&intf->dev, "couldn't register control\n");
  431. goto err_ctrl;
  432. }
  433. mutex_init(&radio->lock);
  434. radio->v4l2_dev.ctrl_handler = &radio->hdl;
  435. radio->v4l2_dev.release = usb_amradio_release;
  436. strlcpy(radio->vdev.name, radio->v4l2_dev.name,
  437. sizeof(radio->vdev.name));
  438. radio->vdev.v4l2_dev = &radio->v4l2_dev;
  439. radio->vdev.fops = &usb_amradio_fops;
  440. radio->vdev.ioctl_ops = &usb_amradio_ioctl_ops;
  441. radio->vdev.release = video_device_release_empty;
  442. radio->vdev.lock = &radio->lock;
  443. set_bit(V4L2_FL_USE_FH_PRIO, &radio->vdev.flags);
  444. radio->usbdev = interface_to_usbdev(intf);
  445. radio->intf = intf;
  446. usb_set_intfdata(intf, &radio->v4l2_dev);
  447. radio->curfreq = 95.16 * FREQ_MUL;
  448. video_set_drvdata(&radio->vdev, radio);
  449. retval = usb_amradio_init(radio);
  450. if (retval)
  451. goto err_vdev;
  452. retval = video_register_device(&radio->vdev, VFL_TYPE_RADIO,
  453. radio_nr);
  454. if (retval < 0) {
  455. dev_err(&intf->dev, "could not register video device\n");
  456. goto err_vdev;
  457. }
  458. return 0;
  459. err_vdev:
  460. v4l2_ctrl_handler_free(&radio->hdl);
  461. err_ctrl:
  462. v4l2_device_unregister(&radio->v4l2_dev);
  463. err_v4l2:
  464. kfree(radio->buffer);
  465. err_nobuf:
  466. kfree(radio);
  467. err:
  468. return retval;
  469. }
  470. /* USB Device ID List */
  471. static struct usb_device_id usb_amradio_device_table[] = {
  472. { USB_DEVICE_AND_INTERFACE_INFO(USB_AMRADIO_VENDOR, USB_AMRADIO_PRODUCT,
  473. USB_CLASS_HID, 0, 0) },
  474. { } /* Terminating entry */
  475. };
  476. MODULE_DEVICE_TABLE(usb, usb_amradio_device_table);
  477. /* USB subsystem interface */
  478. static struct usb_driver usb_amradio_driver = {
  479. .name = MR800_DRIVER_NAME,
  480. .probe = usb_amradio_probe,
  481. .disconnect = usb_amradio_disconnect,
  482. .suspend = usb_amradio_suspend,
  483. .resume = usb_amradio_resume,
  484. .reset_resume = usb_amradio_resume,
  485. .id_table = usb_amradio_device_table,
  486. };
  487. module_usb_driver(usb_amradio_driver);