zio.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * ZIO Motherboard USB driver
  3. *
  4. * Copyright (C) 2010 Zilogic Systems <code@zilogic.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version
  8. * 2 as published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/tty.h>
  13. #include <linux/module.h>
  14. #include <linux/usb.h>
  15. #include <linux/usb/serial.h>
  16. #include <linux/uaccess.h>
  17. static const struct usb_device_id id_table[] = {
  18. { USB_DEVICE(0x1CBE, 0x0103) },
  19. { },
  20. };
  21. MODULE_DEVICE_TABLE(usb, id_table);
  22. static struct usb_driver zio_driver = {
  23. .name = "zio",
  24. .probe = usb_serial_probe,
  25. .disconnect = usb_serial_disconnect,
  26. .id_table = id_table,
  27. .no_dynamic_id = 1,
  28. };
  29. static struct usb_serial_driver zio_device = {
  30. .driver = {
  31. .owner = THIS_MODULE,
  32. .name = "zio",
  33. },
  34. .id_table = id_table,
  35. .usb_driver = &zio_driver,
  36. .num_ports = 1,
  37. };
  38. static int __init zio_init(void)
  39. {
  40. int retval;
  41. retval = usb_serial_register(&zio_device);
  42. if (retval)
  43. return retval;
  44. retval = usb_register(&zio_driver);
  45. if (retval)
  46. usb_serial_deregister(&zio_device);
  47. return retval;
  48. }
  49. static void __exit zio_exit(void)
  50. {
  51. usb_deregister(&zio_driver);
  52. usb_serial_deregister(&zio_device);
  53. }
  54. module_init(zio_init);
  55. module_exit(zio_exit);
  56. MODULE_LICENSE("GPL");