Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

USB: ftdi_sio: Workaround for broken Matrix Orbital serial port

Workaround for the FT232RL-based, Matrix Orbital VK204-25-USB serial port
added to the ftdi_sio driver.

The device has an invalid endpoint descriptor, which must be modified
before it can be used.

Signed-off-by: Kevin Vance <kvance@kvance.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kevin Vance and committed by
Greg Kroah-Hartman
546d7eec 85fb62a0

+31
+24
drivers/usb/serial/ftdi_sio.c
··· 92 92 }; 93 93 94 94 static int ftdi_jtag_probe (struct usb_serial *serial); 95 + static int ftdi_mtxorb_hack_setup (struct usb_serial *serial); 95 96 static void ftdi_USB_UIRT_setup (struct ftdi_private *priv); 96 97 static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv); 97 98 98 99 static struct ftdi_sio_quirk ftdi_jtag_quirk = { 99 100 .probe = ftdi_jtag_probe, 101 + }; 102 + 103 + static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = { 104 + .probe = ftdi_mtxorb_hack_setup, 100 105 }; 101 106 102 107 static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { ··· 166 161 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 167 162 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 168 163 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 164 + { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID), 165 + .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 169 166 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 170 167 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 171 168 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, ··· 1090 1083 if (interface == udev->actconfig->interface[0]) { 1091 1084 info("Ignoring serial port reserved for JTAG"); 1092 1085 return -ENODEV; 1086 + } 1087 + 1088 + return 0; 1089 + } 1090 + 1091 + /* 1092 + * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. 1093 + * We have to correct it if we want to read from it. 1094 + */ 1095 + static int ftdi_mtxorb_hack_setup(struct usb_serial *serial) 1096 + { 1097 + struct usb_host_endpoint *ep = serial->dev->ep_in[1]; 1098 + struct usb_endpoint_descriptor *ep_desc = &ep->desc; 1099 + 1100 + if (ep->enabled && ep_desc->wMaxPacketSize == 0) { 1101 + ep_desc->wMaxPacketSize = 0x40; 1102 + info("Fixing invalid wMaxPacketSize on read pipe"); 1093 1103 } 1094 1104 1095 1105 return 0;
+7
drivers/usb/serial/ftdi_sio.h
··· 102 102 * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */ 103 103 #define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */ 104 104 105 + /* 106 + * The following are the values for the Matrix Orbital VK204-25-USB 107 + * display, which use the FT232RL. 108 + */ 109 + #define MTXORB_VK_VID 0x1b3d 110 + #define MTXORB_VK_PID 0x0158 111 + 105 112 /* Interbiometrics USB I/O Board */ 106 113 /* Developed for Interbiometrics by Rudolf Gugler */ 107 114 #define INTERBIOMETRICS_VID 0x1209