diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 15:02:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-14 13:00:25 -0400 |
commit | 6986a978eec70c867717fe6bee736f0bd1db1508 (patch) | |
tree | 9097d926464dfd86161a96240b2e4e7a34c20ddb | |
parent | 9604006d283fb67dda5ee9e0e15b7cc6c62e1557 (diff) |
USB: add new moto_modem driver for some Morotola phones
This should work on a KRZR K1m, and some other Motorola phones that do
not use the "standard" cdc ACM protocol to talk to USB hosts.
Tested-by: Jeff Garzik <jeff@garzik.org>
Cc: Jiang Dejun <a5652c@motorola.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/Kconfig | 9 | ||||
-rw-r--r-- | drivers/usb/serial/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/serial/moto_modem.c | 70 |
3 files changed, 80 insertions, 0 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 2cffec85ee7e..9ba64ccc1359 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -447,6 +447,15 @@ config USB_SERIAL_MOS7840 | |||
447 | To compile this driver as a module, choose M here: the | 447 | To compile this driver as a module, choose M here: the |
448 | module will be called mos7840. If unsure, choose N. | 448 | module will be called mos7840. If unsure, choose N. |
449 | 449 | ||
450 | config USB_SERIAL_MOTOROLA | ||
451 | tristate "USB Motorola Phone modem driver" | ||
452 | ---help--- | ||
453 | Say Y here if you want to use a Motorola phone with a USB | ||
454 | connector as a modem link. | ||
455 | |||
456 | To compile this driver as a module, choose M here: the | ||
457 | module will be called moto_modem. If unsure, choose N. | ||
458 | |||
450 | config USB_SERIAL_NAVMAN | 459 | config USB_SERIAL_NAVMAN |
451 | tristate "USB Navman GPS device" | 460 | tristate "USB Navman GPS device" |
452 | help | 461 | help |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index 756859510d8c..17a762ab6769 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o | |||
39 | obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o | 39 | obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o |
40 | obj-$(CONFIG_USB_SERIAL_MOS7720) += mos7720.o | 40 | obj-$(CONFIG_USB_SERIAL_MOS7720) += mos7720.o |
41 | obj-$(CONFIG_USB_SERIAL_MOS7840) += mos7840.o | 41 | obj-$(CONFIG_USB_SERIAL_MOS7840) += mos7840.o |
42 | obj-$(CONFIG_USB_SERIAL_MOTOROLA) += moto_modem.o | ||
42 | obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o | 43 | obj-$(CONFIG_USB_SERIAL_NAVMAN) += navman.o |
43 | obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o | 44 | obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o |
44 | obj-$(CONFIG_USB_SERIAL_OPTION) += option.o | 45 | obj-$(CONFIG_USB_SERIAL_OPTION) += option.o |
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 @@ | |||
1 | /* | ||
2 | * Motorola USB Phone driver | ||
3 | * | ||
4 | * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com> | ||
5 | * | ||
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. | ||
9 | * | ||
10 | * {sigh} | ||
11 | * Mororola 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. | ||
15 | */ | ||
16 | |||
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> | ||
23 | |||
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 | { }, | ||
29 | }; | ||
30 | MODULE_DEVICE_TABLE(usb, id_table); | ||
31 | |||
32 | static struct usb_driver moto_driver = { | ||
33 | .name = "moto-modem", | ||
34 | .probe = usb_serial_probe, | ||
35 | .disconnect = usb_serial_disconnect, | ||
36 | .id_table = id_table, | ||
37 | .no_dynamic_id = 1, | ||
38 | }; | ||
39 | |||
40 | static struct usb_serial_driver moto_device = { | ||
41 | .driver = { | ||
42 | .owner = THIS_MODULE, | ||
43 | .name = "moto-modem", | ||
44 | }, | ||
45 | .id_table = id_table, | ||
46 | .num_ports = 1, | ||
47 | }; | ||
48 | |||
49 | static int __init moto_init(void) | ||
50 | { | ||
51 | int retval; | ||
52 | |||
53 | retval = usb_serial_register(&moto_device); | ||
54 | if (retval) | ||
55 | return retval; | ||
56 | retval = usb_register(&moto_driver); | ||
57 | if (retval) | ||
58 | usb_serial_deregister(&moto_device); | ||
59 | return retval; | ||
60 | } | ||
61 | |||
62 | static void __exit moto_exit(void) | ||
63 | { | ||
64 | usb_deregister(&moto_driver); | ||
65 | usb_serial_deregister(&moto_device); | ||
66 | } | ||
67 | |||
68 | module_init(moto_init); | ||
69 | module_exit(moto_exit); | ||
70 | MODULE_LICENSE("GPL"); | ||