LTE: add HauWei 4G model support
authorTerry <terry@khadas.com>
Wed, 28 Aug 2019 10:42:23 +0000 (18:42 +0800)
committerNick Xie <nick@khadas.com>
Mon, 23 Sep 2019 06:25:16 +0000 (14:25 +0800)
Signed-off-by: Nick Xie <nick@khadas.com>
arch/arm64/configs/kvims_defconfig
drivers/net/usb/usbnet.c
drivers/usb/core/usb.c
drivers/usb/serial/option.c

index a930e38..2c2d139 100644 (file)
@@ -472,9 +472,11 @@ CONFIG_PPPOL2TP=y
 CONFIG_PPPOLAC=y
 CONFIG_PPPOPNS=y
 CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
 CONFIG_USB_USBNET=y
 CONFIG_USB_NET_CDC_EEM=y
 CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_QMI_WWAN=y
 CONFIG_ATH10K=m
 CONFIG_ATH10K_PCI=m
 CONFIG_BCMDHD=m
@@ -570,6 +572,7 @@ CONFIG_USB_SERIAL_CH341=y
 CONFIG_USB_SERIAL_CP210X=y
 CONFIG_USB_SERIAL_FTDI_SIO=y
 CONFIG_USB_SERIAL_PL2303=y
+CONFIG_USB_SERIAL_OPTION=y
 CONFIG_USB_ISP1301=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_CONFIGFS=y
index a5acbcb..18b93e4 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/pm_runtime.h>
 
 #define DRIVER_VERSION         "22-Aug-2005"
+#define HUAWEI_VENDOR_ID 0x12d1
 
 
 /*-------------------------------------------------------------------------*/
@@ -1767,6 +1768,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
        // ok, it's ready to go.
        usb_set_intfdata (udev, dev);
 
+       if(xdev->descriptor.idVendor == HUAWEI_VENDOR_ID){
+               if( 0 != (xdev->config->desc.bmAttributes & 0x20)){
+                       usb_enable_autosuspend(xdev);
+               }
+       }
        netif_device_attach (net);
 
        if (dev->driver_info->flags & FLAG_LINK_INTR)
index e8ba500..ad4fead 100644 (file)
@@ -62,7 +62,7 @@ int usb_disabled(void)
 EXPORT_SYMBOL_GPL(usb_disabled);
 
 #ifdef CONFIG_PM
-static int usb_autosuspend_delay = 2;          /* Default delay value,
+static int usb_autosuspend_delay = 5;          /* Default delay value,
                                                 * in seconds */
 module_param_named(autosuspend, usb_autosuspend_delay, int, 0644);
 MODULE_PARM_DESC(autosuspend, "default autosuspend delay");
index 1bceb11..c78b368 100644 (file)
@@ -1912,6 +1912,7 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) },
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) },
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) },
+       { USB_DEVICE(0x12d1, 0x15c1) },
        { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
        { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */