summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/moto_modem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-14 10:52:40 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-14 10:52:40 -0700
commite90a4e475a8b34adbefe189c9d0932fa0b7b750f (patch)
tree9547183741c7361edd9e329d8a000ae432378a87 /drivers/usb/serial/moto_modem.c
parent6aa5fc434958d15a4d66d922d0416dfb03c07def (diff)
parent405177070614f35133304d4daa1332afeb83ffa2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (22 commits) USB: atmel_usba_udc fixes, mostly disconnect() USB: pxa27x_udc: minor fixes usbtest: comment on why this code "expects" negative and positive errnos USB: remove PICDEM FS USB demo (04d8:000c) device from ldusb USB: option: add new Dell 5520 HSDPA variant USB: unusual_devs: Add support for GI 0401 SD-Card interface USB: serial gadget: descriptor cleanup USB: serial gadget: simplify endpoint handling USB: serial gadget: remove needless data structure USB: serial gadget: cleanup/reorg usb: fix compile warning in isp1760 USB: do not handle device 1410:5010 in 'option' driver USB: Fix unusual_devs.h ordering USB: add Zoom Telephonics Model 3095F V.92 USB Mini External modem to cdc-acm USB: Support for the ET502HS HDSPA modem in option driver USB: Support for the ET502HS HDSPA modem usb: fix integer as NULL pointer warnings found by sparse USB: isp1760: fix printk format USB: add Telstra NextG CDMA id to option driver USB: add association.h ...
Diffstat (limited to 'drivers/usb/serial/moto_modem.c')
-rw-r--r--drivers/usb/serial/moto_modem.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c
new file mode 100644
index 000000000000..2e8e05462ef7
--- /dev/null
+++ b/drivers/usb/serial/moto_modem.c
@@ -0,0 +1,70 @@
+/*
+ * Motorola USB Phone driver
+ *
+ * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * {sigh}
+ * Mororola should be using the CDC ACM USB spec, but instead
+ * they try to just "do their own thing"... This driver should handle a
+ * few phones in which a basic "dumb serial connection" is needed to be
+ * able to get a connection through to them.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/tty.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/serial.h>
+
+static struct usb_device_id id_table [] = {
+ { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */
+ { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */
+ { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */
+ { },
+};
+MODULE_DEVICE_TABLE(usb, id_table);
+
+static struct usb_driver moto_driver = {
+ .name = "moto-modem",
+ .probe = usb_serial_probe,
+ .disconnect = usb_serial_disconnect,
+ .id_table = id_table,
+ .no_dynamic_id = 1,
+};
+
+static struct usb_serial_driver moto_device = {
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "moto-modem",
+ },
+ .id_table = id_table,
+ .num_ports = 1,
+};
+
+static int __init moto_init(void)
+{
+ int retval;
+
+ retval = usb_serial_register(&moto_device);
+ if (retval)
+ return retval;
+ retval = usb_register(&moto_driver);
+ if (retval)
+ usb_serial_deregister(&moto_device);
+ return retval;
+}
+
+static void __exit moto_exit(void)
+{
+ usb_deregister(&moto_driver);
+ usb_serial_deregister(&moto_device);
+}
+
+module_init(moto_init);
+module_exit(moto_exit);
+MODULE_LICENSE("GPL");