Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Qualcomm USB Auxiliary Serial Port driver
0004  *
0005  * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
0006  * Copyright (C) 2010 Dan Williams <dcbw@redhat.com>
0007  *
0008  * Devices listed here usually provide a CDC ACM port on which normal modem
0009  * AT commands and PPP can be used.  But when that port is in-use by PPP it
0010  * cannot be used simultaneously for status or signal strength.  Instead, the
0011  * ports here can be queried for that information using the Qualcomm DM
0012  * protocol.
0013  */
0014 
0015 #include <linux/kernel.h>
0016 #include <linux/tty.h>
0017 #include <linux/module.h>
0018 #include <linux/usb.h>
0019 #include <linux/usb/serial.h>
0020 
0021 /* NOTE: for now, only use this driver for devices that provide a CDC-ACM port
0022  * for normal AT commands, but also provide secondary USB interfaces for the
0023  * QCDM-capable ports.  Devices that do not provide a CDC-ACM port should
0024  * probably be driven by option.ko.
0025  */
0026 
0027 /* UTStarcom/Pantech/Curitel devices */
0028 #define UTSTARCOM_VENDOR_ID         0x106c
0029 #define UTSTARCOM_PRODUCT_PC5740        0x3701
0030 #define UTSTARCOM_PRODUCT_PC5750        0x3702 /* aka Pantech PX-500 */
0031 #define UTSTARCOM_PRODUCT_UM150         0x3711
0032 #define UTSTARCOM_PRODUCT_UM175_V1      0x3712
0033 #define UTSTARCOM_PRODUCT_UM175_V2      0x3714
0034 #define UTSTARCOM_PRODUCT_UM175_ALLTEL      0x3715
0035 
0036 /* CMOTECH devices */
0037 #define CMOTECH_VENDOR_ID           0x16d8
0038 #define CMOTECH_PRODUCT_CDU550          0x5553
0039 #define CMOTECH_PRODUCT_CDX650          0x6512
0040 
0041 /* LG devices */
0042 #define LG_VENDOR_ID                0x1004
0043 #define LG_PRODUCT_VX4400_6000          0x6000 /* VX4400/VX6000/Rumor */
0044 
0045 /* Sanyo devices */
0046 #define SANYO_VENDOR_ID             0x0474
0047 #define SANYO_PRODUCT_KATANA_LX         0x0754 /* SCP-3800 (Katana LX) */
0048 
0049 /* Samsung devices */
0050 #define SAMSUNG_VENDOR_ID           0x04e8
0051 #define SAMSUNG_PRODUCT_U520            0x6640 /* SCH-U520 */
0052 
0053 static const struct usb_device_id id_table[] = {
0054     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) },
0055     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) },
0056     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM150, 0xff, 0x00, 0x00) },
0057     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V1, 0xff, 0x00, 0x00) },
0058     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V2, 0xff, 0x00, 0x00) },
0059     { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) },
0060     { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) },
0061     { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) },
0062     { USB_DEVICE_AND_INTERFACE_INFO(LG_VENDOR_ID, LG_PRODUCT_VX4400_6000, 0xff, 0xff, 0x00) },
0063     { USB_DEVICE_AND_INTERFACE_INFO(SANYO_VENDOR_ID, SANYO_PRODUCT_KATANA_LX, 0xff, 0xff, 0x00) },
0064     { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_U520, 0xff, 0x00, 0x00) },
0065     { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfd, 0xff) },  /* NMEA */
0066     { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfe, 0xff) },  /* WMC */
0067     { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xff, 0xff) },  /* DIAG */
0068     { USB_DEVICE_AND_INTERFACE_INFO(0x1fac, 0x0151, 0xff, 0xff, 0xff) },
0069     { },
0070 };
0071 MODULE_DEVICE_TABLE(usb, id_table);
0072 
0073 static struct usb_serial_driver qcaux_device = {
0074     .driver = {
0075         .owner =    THIS_MODULE,
0076         .name =     "qcaux",
0077     },
0078     .id_table =     id_table,
0079     .num_ports =        1,
0080 };
0081 
0082 static struct usb_serial_driver * const serial_drivers[] = {
0083     &qcaux_device, NULL
0084 };
0085 
0086 module_usb_serial_driver(serial_drivers, id_table);
0087 MODULE_LICENSE("GPL v2");