funsoft.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <linux/usb/serial.h>
  16. #include <linux/uaccess.h>
  17. static bool debug;
  18. static const struct usb_device_id id_table[] = {
  19. { USB_DEVICE(0x1404, 0xcddc) },
  20. { },
  21. };
  22. MODULE_DEVICE_TABLE(usb, id_table);
  23. static struct usb_driver funsoft_driver = {
  24. .name = "funsoft",
  25. .probe = usb_serial_probe,
  26. .disconnect = usb_serial_disconnect,
  27. .id_table = id_table,
  28. };
  29. static struct usb_serial_driver funsoft_device = {
  30. .driver = {
  31. .owner = THIS_MODULE,
  32. .name = "funsoft",
  33. },
  34. .id_table = id_table,
  35. .num_ports = 1,
  36. };
  37. static struct usb_serial_driver * const serial_drivers[] = {
  38. &funsoft_device, NULL
  39. };
  40. module_usb_serial_driver(funsoft_driver, serial_drivers);
  41. MODULE_LICENSE("GPL");
  42. module_param(debug, bool, S_IRUGO | S_IWUSR);
  43. MODULE_PARM_DESC(debug, "Debug enabled or not");