USB: serial: option: add MEDIATEK FM350-GL module usb mode support

This commit is contained in:
coolsnowwolf 2024-04-13 11:03:00 +08:00
parent 9e29b15c05
commit 784b562e90
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,26 @@
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -589,6 +589,7 @@
static const struct usb_device_id option_ids[] = {
+ { USB_DEVICE(MEDIATEK_VENDOR_ID, 0x7127) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
@@ -2210,6 +2211,15 @@
if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)
return -ENODEV;
+ if(id->idVendor == MEDIATEK_VENDOR_ID &&
+ (id->idProduct == cpu_to_le16(0x7127) &&
+ ((serial->interface->cur_altsetting->desc.bInterfaceNumber <= 5) ||
+ (serial->interface->cur_altsetting->desc.bInterfaceNumber >= 7))))
+ {
+ printk(KERN_INFO "Discovery the interface for Fibocom & MEDIATEK.");
+ return -ENODEV;
+ }
+
/* Store the device flags so we can use them during attach. */
usb_set_serial_data(serial, (void *)device_flags);

View File

@ -0,0 +1,26 @@
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -589,6 +589,7 @@
static const struct usb_device_id option_ids[] = {
+ { USB_DEVICE(MEDIATEK_VENDOR_ID, 0x7127) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
@@ -2210,6 +2211,15 @@
if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)
return -ENODEV;
+ if(id->idVendor == MEDIATEK_VENDOR_ID &&
+ (id->idProduct == cpu_to_le16(0x7127) &&
+ ((serial->interface->cur_altsetting->desc.bInterfaceNumber <= 5) ||
+ (serial->interface->cur_altsetting->desc.bInterfaceNumber >= 7))))
+ {
+ printk(KERN_INFO "Discovery the interface for Fibocom & MEDIATEK.");
+ return -ENODEV;
+ }
+
/* Store the device flags so we can use them during attach. */
usb_set_serial_data(serial, (void *)device_flags);