Skip to content

Commit

Permalink
Merge tag 'usb-serial-5.14-rc5' of https://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for 5.14-rc5

Here are two type-detection regression fixes for pl2303 and a patch to
increase the receive buffer size for for ch341 to avoid lost characters
at high line speeds.

Included are also some new device ids.

All but the last three commits have been in linux-next and with no
reported issues.

* tag 'usb-serial-5.14-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
  USB: serial: ftdi_sio: add device ID for Auto-M3 OP-COM v2
  USB: serial: pl2303: fix GT type detection
  USB: serial: option: add Telit FD980 composition 0x1056
  USB: serial: pl2303: fix HX type detection
  USB: serial: ch341: fix character loss at high transfer rates
  • Loading branch information
Greg Kroah-Hartman committed Aug 5, 2021
2 parents a154c43 + 8da0e55 commit b47b0b6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 16 deletions.
1 change: 1 addition & 0 deletions drivers/usb/serial/ch341.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static struct usb_serial_driver ch341_device = {
.owner = THIS_MODULE,
.name = "ch341-uart",
},
.bulk_in_size = 512,
.id_table = id_table,
.num_ports = 1,
.open = ch341_open,
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) },
{ USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_AUTO_M3_OP_COM_V2_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) },
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/serial/ftdi_sio_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
/* Vardaan Enterprises Serial Interface VEUSB422R3 */
#define FTDI_VARDAAN_PID 0xF070

/* Auto-M3 Ltd. - OP-COM USB V2 - OBD interface Adapter */
#define FTDI_AUTO_M3_OP_COM_V2_PID 0x4f50

/*
* Xsens Technologies BV products (http://www.xsens.com).
*/
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,8 @@ static const struct usb_device_id option_ids[] = {
.driver_info = NCTRL(2) | RSVD(3) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1055, 0xff), /* Telit FN980 (PCIe) */
.driver_info = NCTRL(0) | RSVD(1) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */
.driver_info = NCTRL(2) | RSVD(3) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
Expand Down
42 changes: 26 additions & 16 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,24 +418,34 @@ static int pl2303_detect_type(struct usb_serial *serial)
bcdDevice = le16_to_cpu(desc->bcdDevice);
bcdUSB = le16_to_cpu(desc->bcdUSB);

switch (bcdDevice) {
case 0x100:
/*
* Assume it's an HXN-type if the device doesn't support the old read
* request value.
*/
if (bcdUSB == 0x200 && !pl2303_supports_hx_status(serial))
return TYPE_HXN;
switch (bcdUSB) {
case 0x110:
switch (bcdDevice) {
case 0x300:
return TYPE_HX;
case 0x400:
return TYPE_HXD;
default:
return TYPE_HX;
}
break;
case 0x300:
if (bcdUSB == 0x200)
case 0x200:
switch (bcdDevice) {
case 0x100:
case 0x305:
/*
* Assume it's an HXN-type if the device doesn't
* support the old read request value.
*/
if (!pl2303_supports_hx_status(serial))
return TYPE_HXN;
break;
case 0x300:
return TYPE_TA;

return TYPE_HX;
case 0x400:
return TYPE_HXD;
case 0x500:
return TYPE_TB;
case 0x500:
return TYPE_TB;
}
break;
}

dev_err(&serial->interface->dev,
Expand Down

0 comments on commit b47b0b6

Please sign in to comment.