Add linux-next specific files for 20110421
[linux-2.6/next.git] / drivers / usb / serial / vivopay-serial.c
blobf719d00972fc1ba0b9914ed021bf7992019f8c47
1 /*
2 * Copyright (C) 2001-2005 Greg Kroah-Hartman (greg@kroah.com)
3 * Copyright (C) 2009 Outpost Embedded, LLC
4 */
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/tty.h>
9 #include <linux/module.h>
10 #include <linux/usb.h>
11 #include <linux/usb/serial.h>
14 #define DRIVER_VERSION "v1.0"
15 #define DRIVER_DESC "ViVOpay USB Serial Driver"
17 #define VIVOPAY_VENDOR_ID 0x1d5f
20 static struct usb_device_id id_table [] = {
21 /* ViVOpay 8800 */
22 { USB_DEVICE(VIVOPAY_VENDOR_ID, 0x1004) },
23 { },
26 MODULE_DEVICE_TABLE(usb, id_table);
28 static struct usb_driver vivopay_serial_driver = {
29 .name = "vivopay-serial",
30 .probe = usb_serial_probe,
31 .disconnect = usb_serial_disconnect,
32 .id_table = id_table,
33 .no_dynamic_id = 1,
36 static struct usb_serial_driver vivopay_serial_device = {
37 .driver = {
38 .owner = THIS_MODULE,
39 .name = "vivopay-serial",
41 .id_table = id_table,
42 .usb_driver = &vivopay_serial_driver,
43 .num_ports = 1,
46 static int __init vivopay_serial_init(void)
48 int retval;
49 retval = usb_serial_register(&vivopay_serial_device);
50 if (retval)
51 goto failed_usb_serial_register;
52 retval = usb_register(&vivopay_serial_driver);
53 if (retval)
54 goto failed_usb_register;
55 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
56 DRIVER_DESC "\n");
57 return 0;
58 failed_usb_register:
59 usb_serial_deregister(&vivopay_serial_device);
60 failed_usb_serial_register:
61 return retval;
64 static void __exit vivopay_serial_exit(void)
66 usb_deregister(&vivopay_serial_driver);
67 usb_serial_deregister(&vivopay_serial_device);
70 module_init(vivopay_serial_init);
71 module_exit(vivopay_serial_exit);
73 MODULE_AUTHOR("Forest Bond <forest.bond@outpostembedded.com>");
74 MODULE_DESCRIPTION(DRIVER_DESC);
75 MODULE_VERSION(DRIVER_VERSION);
76 MODULE_LICENSE("GPL");