funsoft.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Funsoft Serial USB driver
  3. *
  4. * Copyright (C) 2006 Greg Kroah-Hartman <gregkh@suse.de>
  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 "usb-serial.h"
  16. static struct usb_device_id id_table [] = {
  17. { USB_DEVICE(0x1404, 0xcddc) },
  18. { },
  19. };
  20. MODULE_DEVICE_TABLE(usb, id_table);
  21. static struct usb_driver funsoft_driver = {
  22. .name = "funsoft",
  23. .probe = usb_serial_probe,
  24. .disconnect = usb_serial_disconnect,
  25. .id_table = id_table,
  26. .no_dynamic_id = 1,
  27. };
  28. static struct usb_serial_driver funsoft_device = {
  29. .driver = {
  30. .owner = THIS_MODULE,
  31. .name = "funsoft",
  32. },
  33. .id_table = id_table,
  34. .num_interrupt_in = NUM_DONT_CARE,
  35. .num_bulk_in = NUM_DONT_CARE,
  36. .num_bulk_out = NUM_DONT_CARE,
  37. .num_ports = 1,
  38. };
  39. static int __init funsoft_init(void)
  40. {
  41. int retval;
  42. retval = usb_serial_register(&funsoft_device);
  43. if (retval)
  44. return retval;
  45. retval = usb_register(&funsoft_driver);
  46. if (retval)
  47. usb_serial_deregister(&funsoft_device);
  48. return retval;
  49. }
  50. static void __exit funsoft_exit(void)
  51. {
  52. usb_deregister(&funsoft_driver);
  53. usb_serial_deregister(&funsoft_device);
  54. }
  55. module_init(funsoft_init);
  56. module_exit(funsoft_exit);
  57. MODULE_LICENSE("GPL");