blob: e2bfecc46402468096a93b83e4b60139e58a5638 [file] [log] [blame]
Greg Kroah-Hartman6986a972008-05-02 12:02:20 -07001/*
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}
Maxin John981e60f2009-07-20 15:16:42 +053011 * Motorola should be using the CDC ACM USB spec, but instead
Greg Kroah-Hartman6986a972008-05-02 12:02:20 -070012 * 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
Németh Márton7d40d7e2010-01-10 15:34:24 +010024static const struct usb_device_id id_table[] = {
Greg Kroah-Hartman6986a972008-05-02 12:02:20 -070025 { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */
26 { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */
27 { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */
Elizabeth Jennifer Myers3938a0b2011-04-16 14:49:51 -040028 { USB_DEVICE(0x22b8, 0x2c84) }, /* Motorola VE240 phone */
Dr. Greg Wettsteind45e2302009-04-11 09:12:08 -050029 { USB_DEVICE(0x22b8, 0x2c64) }, /* Motorola V950 phone */
Greg Kroah-Hartman6986a972008-05-02 12:02:20 -070030 { },
31};
32MODULE_DEVICE_TABLE(usb, id_table);
33
34static 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,
40};
41
42static struct usb_serial_driver moto_device = {
43 .driver = {
44 .owner = THIS_MODULE,
45 .name = "moto-modem",
46 },
47 .id_table = id_table,
Alan Stern5620b5f2011-01-11 14:16:50 -050048 .usb_driver = &moto_driver,
Greg Kroah-Hartman6986a972008-05-02 12:02:20 -070049 .num_ports = 1,
50};
51
52static int __init moto_init(void)
53{
54 int retval;
55
56 retval = usb_serial_register(&moto_device);
57 if (retval)
58 return retval;
59 retval = usb_register(&moto_driver);
60 if (retval)
61 usb_serial_deregister(&moto_device);
62 return retval;
63}
64
65static void __exit moto_exit(void)
66{
67 usb_deregister(&moto_driver);
68 usb_serial_deregister(&moto_device);
69}
70
71module_init(moto_init);
72module_exit(moto_exit);
73MODULE_LICENSE("GPL");