Skip to contentSkip to conversation

Add Marvell ML352 to drivers/usb/serial/option.c

PATCH In review Michael Wyraz 2 participants 6 messages Jun 18, 2025 – Oct 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add Marvell ML352 to drivers/usb/serial/option.c

Add the device id of the Marvell ML352 to option.c so that the device is recognized as usb-serial device.

---
 drivers/usb/serial/option.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/serial/option.c +5 -0
index 5cd26dac2069..3bfdab641369 100644
@@ -619,6 +619,10 @@ static void option_instat_callback(struct urb *urb);
 /* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */
 #define LUAT_PRODUCT_AIR720U			0x4e00
 
+/* Marvell products */
+#define MARVELL_VENDOR_ID			0x1286
+#define MARVELL_PRODUCT_ML352		0x4e3c
+
 /* Device flags */
 
 /* Highest interface number which can be used with NCTRL() and RSVD() */
@@ -2434,6 +2438,7 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
+	{ USB_DEVICE(MARVELL_VENDOR_ID, MARVELL_PRODUCT_ML352) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0530, 0xff),			/* TCL IK512 MBIM */
 	  .driver_info = NCTRL(1) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff),			/* TCL IK512 ECM */
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 4 lines · Michael Wyraz

Add the device id of the Marvell ML352 to option.c so that the device is recognized as usb-serial device.

Thanks for the patch. Looks good, but we may not want to bind to every interface of the device.

Can you please post the output of 'usb-devices' for this device? I assume it has more than one interface, do what each interface is used for?

If you end up resending, please use the common prefix in Subject, for example:

USB: serial: option: add support for Marvell ML352

(e.g. as can been seen by running 'git log --oneline' on the files you're changing).

Johan

#2 lore raw

Hello Johan,

sorry, I totally missed this mail. "usb-devices" is not available on that device. Hope this does it too:

lsusb  -d 1286:4e3c  -v

Bus 001 Device 002: ID 1286:4e3c ASR Mobile Composite Device Bus Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x1286
  idProduct          0x4e3c
  bcdDevice            1.00
  iManufacturer           1 ASR
  iProduct                2 Mobile Composite Device Bus iSerial                 3 200806006809080000 bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00c4
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass        224
      bFunctionSubClass       1
      bFunctionProtocol       3
      iFunction               5 Mobile RNDIS Network Adapter Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       224
      bInterfaceSubClass      1
      bInterfaceProtocol      3
      iInterface              5 Mobile RNDIS Network Adapter ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 01
      ** UNRECOGNIZED:  04 24 02 00
      ** UNRECOGNIZED:  05 24 06 00 01
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes bInterval              16
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              5 Mobile RNDIS Network Adapter Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              8 Mobile Diag Interface Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface             11 Mobile AT Interface
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8c  EP 12 IN bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes bInterval              16
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8e  EP 14 IN bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0d  EP 13 OUT bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface             11 Mobile AT Interface
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8a  EP 10 IN bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes bInterval              16
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        16
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Am 18.06.25 um 16:27 schrieb Johan Hovold:

Quoted 21 lines · Michael Wyraz
Quoted 4 lines

Add the device id of the Marvell ML352 to option.c so that the device is recognized as usb-serial device.

Thanks for the patch. Looks good, but we may not want to bind to every interface of the device.

Can you please post the output of 'usb-devices' for this device? I assume it has more than one interface, do what each interface is used for?

If you end up resending, please use the common prefix in Subject, for example:

USB: serial: option: add support for Marvell ML352

(e.g. as can been seen by running 'git log --oneline' on the files you're changing).

Johan

maintainer
#3 lore raw

[ Please avoid top-posting when replying on the lists. ]

Quoted 2 lines · Michael Wyraz

sorry, I totally missed this mail. "usb-devices" is not available on that device. Hope this does it too:

Sure, thanks.

Quoted 48 lines

lsusb  -d 1286:4e3c  -v

Bus 001 Device 002: ID 1286:4e3c ASR Mobile Composite Device Bus

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       224
      bInterfaceSubClass      1
      bInterfaceProtocol      3
      iInterface              5 Mobile RNDIS Network Adapter

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              5 Mobile RNDIS Network Adapter

    Interface Descriptor:
      bLength                 9 bDescriptorType         4 bInterfaceNumber        2 bAlternateSetting       0 bNumEndpoints           2 bInterfaceClass       255 bInterfaceSubClass      0 bInterfaceProtocol      0
      iInterface              8 Mobile Diag Interface

    Interface Descriptor:
      bLength                 9 bDescriptorType         4 bInterfaceNumber        3 bAlternateSetting       0 bNumEndpoints           3 bInterfaceClass       255 bInterfaceSubClass      0 bInterfaceProtocol      0
      iInterface             11 Mobile AT Interface

Quoted 10 lines

    Interface Descriptor:
      bLength                 9 bDescriptorType         4 bInterfaceNumber        4 bAlternateSetting       0 bNumEndpoints           3 bInterfaceClass       255 bInterfaceSubClass      0 bInterfaceProtocol      0
      iInterface             11 Mobile AT Interface

The device has five interfaces and the serial driver should only bind to the last three so you should use USB_DEVICE_INTERFACE_CLASS() and only match on the vendor class (0xff).

Please also include a description of what each interface is used for in the commit message. Including a compact usb-devices output (it's just a script you can copy to the host) would be good. Otherwise you can add a link to your last mail in the archives:

Quoted 12 lines

Am 18.06.25 um 16:27 schrieb Johan Hovold:

Quoted 11 lines · Michael Wyraz
Quoted 4 lines

Add the device id of the Marvell ML352 to option.c so that the device is recognized as usb-serial device.

Thanks for the patch. Looks good, but we may not want to bind to every interface of the device.

Can you please post the output of 'usb-devices' for this device? I assume it has more than one interface, do what each interface is used for?

And remember to update Subject when sending your v2:

Quoted 7 lines
Quoted 7 lines

If you end up resending, please use the common prefix in Subject, for example:

USB: serial: option: add support for Marvell ML352

(e.g. as can been seen by running 'git log --oneline' on the files you're changing).

Johan

#4 lore raw

PATCH v2 1/1 USB: serial: option: add support for ASR 1286:4e3c modem

In reply to Michael Wyraz

The ASR modem used in the Tuoshi LT22M exposes an RNDIS function on interfaces 0 and 1, a diagnostic port on interface 2, and AT ports on interfaces 3 and 4. Match only the vendor-specific serial interfaces so option does not bind to the RNDIS function.

---
 drivers/usb/serial/option.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/serial/option.c +1 -0
index 828b1be..f95788f 100644
@@ -2556,6 +2556,7 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, UNISOC_PRODUCT_UIS7720, 0xff, 0, 0) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
+	{ USB_DEVICE_INTERFACE_CLASS(0x1286, 0x4e3c, 0xff) },	/* ASR modem */
 	{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0530, 0xff),			/* TCL IK512 MBIM */
 	  .driver_info = NCTRL(1) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff),			/* TCL IK512 ECM */
maintainer
#5 lore raw

Re: [PATCH v2] USB: serial: option: add support for ASR 1286:4e3c modem

Quoted 8 lines · Michael Wyraz

The ASR modem used in the Tuoshi LT22M exposes an RNDIS function on interfaces 0 and 1, a diagnostic port on interface 2, and AT ports on interfaces 3 and 4. Match only the vendor-specific serial interfaces so option does not bind to the RNDIS function.

---

Thanks for the v2. In the future when revising patches, please remember to include a short change log here under the cut-off (---) line.

Now applied.

Johan