Platform: RK3288
OS: Android 7.1
Kernel: 4.4.143
一.添加PID、VID
usb设备有VID(vendor ID,供应商识别码)和PID(Product ID,产品识别码)
同一个厂商的模块vid是一样的,不同的是pid
diff --git a/kernel/drivers/usb/serial/option.c b/kernel/drivers/usb/serial/option.c index af6154d..e1db191 100755 --- a/kernel/drivers/usb/serial/option.c +++ b/kernel/drivers/usb/serial/option.c @@ -571,6 +571,10 @@ static void option_instat_callback(struct urb *urb); static const struct usb_device_id option_ids[] = { + + //+add for WH-G405tf + { USB_DEVICE(0x19d2, 0x0579) }, + //-add for WH-G405tf { USB_DEVICE(NODECOM_VENDOR_ID, NODECOM_PRODUCT_ID) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, @@ -623,6 +627,7 @@ static const struct usb_device_id option_ids[] = { .driver_info = RSVD(1) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), .driver_info = RSVD(1) | RSVD(2) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0579, 0xff, 0xff, 0xff) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x01) }, { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x02) }, @@ -1996,6 +2001,9 @@ static struct usb_serial_driver option_1port_device = { #ifdef CONFIG_PM .suspend = usb_wwan_suspend, .resume = usb_wwan_resume, + //+add for WH-G405tf + .reset_resume = usb_wwan_resume, + //-add for WH-G405tf #endif };
原文:https://www.cnblogs.com/crushgirl/p/13995044.html