1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Qualcomm USB Auxiliary Serial Port driver
4  *
5  * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
6  * Copyright (C) 2010 Dan Williams <dcbw@redhat.com>
7  *
8  * Devices listed here usually provide a CDC ACM port on which normal modem
9  * AT commands and PPP can be used.  But when that port is in-use by PPP it
10  * cannot be used simultaneously for status or signal strength.  Instead, the
11  * ports here can be queried for that information using the Qualcomm DM
12  * protocol.
13  */
14 
15 #include <linux/kernel.h>
16 #include <linux/tty.h>
17 #include <linux/module.h>
18 #include <linux/usb.h>
19 #include <linux/usb/serial.h>
20 
21 /* NOTE: for now, only use this driver for devices that provide a CDC-ACM port
22  * for normal AT commands, but also provide secondary USB interfaces for the
23  * QCDM-capable ports.  Devices that do not provide a CDC-ACM port should
24  * probably be driven by option.ko.
25  */
26 
27 /* UTStarcom/Pantech/Curitel devices */
28 #define UTSTARCOM_VENDOR_ID			0x106c
29 #define UTSTARCOM_PRODUCT_PC5740		0x3701
30 #define UTSTARCOM_PRODUCT_PC5750		0x3702 /* aka Pantech PX-500 */
31 #define UTSTARCOM_PRODUCT_UM150			0x3711
32 #define UTSTARCOM_PRODUCT_UM175_V1		0x3712
33 #define UTSTARCOM_PRODUCT_UM175_V2		0x3714
34 #define UTSTARCOM_PRODUCT_UM175_ALLTEL		0x3715
35 
36 /* CMOTECH devices */
37 #define CMOTECH_VENDOR_ID			0x16d8
38 #define CMOTECH_PRODUCT_CDU550			0x5553
39 #define CMOTECH_PRODUCT_CDX650			0x6512
40 
41 /* LG devices */
42 #define LG_VENDOR_ID				0x1004
43 #define LG_PRODUCT_VX4400_6000			0x6000 /* VX4400/VX6000/Rumor */
44 
45 /* Sanyo devices */
46 #define SANYO_VENDOR_ID				0x0474
47 #define SANYO_PRODUCT_KATANA_LX			0x0754 /* SCP-3800 (Katana LX) */
48 
49 /* Samsung devices */
50 #define SAMSUNG_VENDOR_ID			0x04e8
51 #define SAMSUNG_PRODUCT_U520			0x6640 /* SCH-U520 */
52 
53 static const struct usb_device_id id_table[] = {
54 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) },
55 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) },
56 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM150, 0xff, 0x00, 0x00) },
57 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V1, 0xff, 0x00, 0x00) },
58 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V2, 0xff, 0x00, 0x00) },
59 	{ USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) },
60 	{ USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) },
61 	{ USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) },
62 	{ USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) },
63 	{ USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) },
64 	{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) },
65 	{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfd, 0xff) },  /* NMEA */
66 	{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfe, 0xff) },  /* WMC */
67 	{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xff, 0xff) },  /* DIAG */
68 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1fac, 0x0151, 0xff, 0xff, 0xff) },
69 	{ },
70 };
71 MODULE_DEVICE_TABLE(usb, id_table);
72 
73 static struct usb_serial_driver qcaux_device = {
74 	.driver = {
75 		.owner =	THIS_MODULE,
76 		.name =		"qcaux",
77 	},
78 	.id_table =		id_table,
79 	.num_ports =		1,
80 };
81 
82 static struct usb_serial_driver * const serial_drivers[] = {
83 	&qcaux_device, NULL
84 };
85 
86 module_usb_serial_driver(serial_drivers, id_table);
87 MODULE_LICENSE("GPL v2");
88