USB: omninet: fix write_room
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / usb / serial / moto_modem.c
blobc53a8a598b1bcf071995d8ad68f5cae23c305fce
1 /*
2 * Motorola USB Phone driver
4 * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * {sigh}
11 * Motorola should be using the CDC ACM USB spec, but instead
12 * they try to just "do their own thing"... This driver should handle a
13 * few phones in which a basic "dumb serial connection" is needed to be
14 * able to get a connection through to them.
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/tty.h>
20 #include <linux/module.h>
21 #include <linux/usb.h>
22 #include <linux/usb/serial.h>
24 static struct usb_device_id id_table [] = {
25 { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */
26 { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */
27 { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */
28 { USB_DEVICE(0x22b8, 0x2c84) }, /* Motorola VE240 phone */
29 { USB_DEVICE(0x22b8, 0x2c64) }, /* Motorola V950 phone */
30 { },
32 MODULE_DEVICE_TABLE(usb, id_table);
34 static struct usb_driver moto_driver = {
35 .name = "moto-modem",
36 .probe = usb_serial_probe,
37 .disconnect = usb_serial_disconnect,
38 .id_table = id_table,
39 .no_dynamic_id = 1,
42 static struct usb_serial_driver moto_device = {
43 .driver = {
44 .owner = THIS_MODULE,
45 .name = "moto-modem",
47 .id_table = id_table,
48 .num_ports = 1,
51 static int __init moto_init(void)
53 int retval;
55 retval = usb_serial_register(&moto_device);
56 if (retval)
57 return retval;
58 retval = usb_register(&moto_driver);
59 if (retval)
60 usb_serial_deregister(&moto_device);
61 return retval;
64 static void __exit moto_exit(void)
66 usb_deregister(&moto_driver);
67 usb_serial_deregister(&moto_device);
70 module_init(moto_init);
71 module_exit(moto_exit);
72 MODULE_LICENSE("GPL");