Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Qualcomm USB Auxiliary Serial Port driver |
| 3 | * |
| 4 | * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com> |
| 5 | * Copyright (C) 2010 Dan Williams <dcbw@redhat.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * Devices listed here usually provide a CDC ACM port on which normal modem |
| 12 | * AT commands and PPP can be used. But when that port is in-use by PPP it |
| 13 | * cannot be used simultaneously for status or signal strength. Instead, the |
| 14 | * ports here can be queried for that information using the Qualcomm DM |
| 15 | * protocol. |
| 16 | */ |
| 17 | |
| 18 | #include <linux/kernel.h> |
| 19 | #include <linux/init.h> |
| 20 | #include <linux/tty.h> |
| 21 | #include <linux/module.h> |
| 22 | #include <linux/usb.h> |
| 23 | #include <linux/usb/serial.h> |
| 24 | |
| 25 | /* NOTE: for now, only use this driver for devices that provide a CDC-ACM port |
| 26 | * for normal AT commands, but also provide secondary USB interfaces for the |
| 27 | * QCDM-capable ports. Devices that do not provide a CDC-ACM port should |
| 28 | * probably be driven by option.ko. |
| 29 | */ |
| 30 | |
| 31 | /* UTStarcom/Pantech/Curitel devices */ |
| 32 | #define UTSTARCOM_VENDOR_ID 0x106c |
| 33 | #define UTSTARCOM_PRODUCT_PC5740 0x3701 |
| 34 | #define UTSTARCOM_PRODUCT_PC5750 0x3702 /* aka Pantech PX-500 */ |
| 35 | #define UTSTARCOM_PRODUCT_UM150 0x3711 |
| 36 | #define UTSTARCOM_PRODUCT_UM175_V1 0x3712 |
| 37 | #define UTSTARCOM_PRODUCT_UM175_V2 0x3714 |
| 38 | #define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715 |
Dan Williams | 074cc73 | 2012-01-24 17:16:54 -0600 | [diff] [blame] | 39 | #define PANTECH_PRODUCT_UML190_VZW 0x3716 |
Dan Williams | a58861f | 2010-12-31 10:51:51 -0600 | [diff] [blame] | 40 | #define PANTECH_PRODUCT_UML290_VZW 0x3718 |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 41 | |
| 42 | /* CMOTECH devices */ |
| 43 | #define CMOTECH_VENDOR_ID 0x16d8 |
| 44 | #define CMOTECH_PRODUCT_CDU550 0x5553 |
| 45 | #define CMOTECH_PRODUCT_CDX650 0x6512 |
| 46 | |
Dan Williams | 898f89c | 2010-03-23 03:08:48 -0700 | [diff] [blame] | 47 | /* LG devices */ |
| 48 | #define LG_VENDOR_ID 0x1004 |
| 49 | #define LG_PRODUCT_VX4400_6000 0x6000 /* VX4400/VX6000/Rumor */ |
| 50 | |
| 51 | /* Sanyo devices */ |
| 52 | #define SANYO_VENDOR_ID 0x0474 |
| 53 | #define SANYO_PRODUCT_KATANA_LX 0x0754 /* SCP-3800 (Katana LX) */ |
| 54 | |
Dan Williams | f5cddcd | 2010-05-03 13:41:01 -0700 | [diff] [blame] | 55 | /* Samsung devices */ |
| 56 | #define SAMSUNG_VENDOR_ID 0x04e8 |
| 57 | #define SAMSUNG_PRODUCT_U520 0x6640 /* SCH-U520 */ |
| 58 | |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 59 | static struct usb_device_id id_table[] = { |
| 60 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) }, |
| 61 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) }, |
| 62 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM150, 0xff, 0x00, 0x00) }, |
| 63 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V1, 0xff, 0x00, 0x00) }, |
| 64 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V2, 0xff, 0x00, 0x00) }, |
| 65 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) }, |
| 66 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) }, |
| 67 | { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) }, |
Dan Williams | 898f89c | 2010-03-23 03:08:48 -0700 | [diff] [blame] | 68 | { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) }, |
| 69 | { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) }, |
Dan Williams | f5cddcd | 2010-05-03 13:41:01 -0700 | [diff] [blame] | 70 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) }, |
Dan Williams | 074cc73 | 2012-01-24 17:16:54 -0600 | [diff] [blame] | 71 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xff, 0xff) }, |
| 72 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML190_VZW, 0xff, 0xfe, 0xff) }, |
| 73 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfd, 0xff) }, /* NMEA */ |
| 74 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xfe, 0xff) }, /* WMC */ |
| 75 | { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, PANTECH_PRODUCT_UML290_VZW, 0xff, 0xff, 0xff) }, /* DIAG */ |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 76 | { }, |
| 77 | }; |
| 78 | MODULE_DEVICE_TABLE(usb, id_table); |
| 79 | |
| 80 | static struct usb_driver qcaux_driver = { |
| 81 | .name = "qcaux", |
| 82 | .probe = usb_serial_probe, |
| 83 | .disconnect = usb_serial_disconnect, |
| 84 | .id_table = id_table, |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | static struct usb_serial_driver qcaux_device = { |
| 88 | .driver = { |
| 89 | .owner = THIS_MODULE, |
| 90 | .name = "qcaux", |
| 91 | }, |
| 92 | .id_table = id_table, |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 93 | .num_ports = 1, |
| 94 | }; |
| 95 | |
Alan Stern | d860322 | 2012-02-23 14:57:25 -0500 | [diff] [blame^] | 96 | static struct usb_serial_driver * const serial_drivers[] = { |
| 97 | &qcaux_device, NULL |
| 98 | }; |
| 99 | |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 100 | static int __init qcaux_init(void) |
| 101 | { |
Alan Stern | d860322 | 2012-02-23 14:57:25 -0500 | [diff] [blame^] | 102 | return usb_serial_register_drivers(&qcaux_driver, serial_drivers); |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | static void __exit qcaux_exit(void) |
| 106 | { |
Alan Stern | d860322 | 2012-02-23 14:57:25 -0500 | [diff] [blame^] | 107 | usb_serial_deregister_drivers(&qcaux_driver, serial_drivers); |
Dan Williams | 019ccc7 | 2010-02-25 10:39:20 -0800 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | module_init(qcaux_init); |
| 111 | module_exit(qcaux_exit); |
| 112 | MODULE_LICENSE("GPL"); |