aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorKevin Vance <kvance@kvance.com>2008-03-01 13:49:59 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-03-04 17:57:44 -0500
commit546d7eec389a3df3173b3131d92829c14e614601 (patch)
treed4b4deb3e0e4ed7875978aeef80620aad11c700c /drivers/usb/serial/ftdi_sio.c
parent85fb62a001278270f9fffbdc3508ef23d5f3693d (diff)
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>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 76db2fef4657..17b2cc071ed8 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -92,6 +92,7 @@ struct ftdi_sio_quirk {
92}; 92};
93 93
94static int ftdi_jtag_probe (struct usb_serial *serial); 94static int ftdi_jtag_probe (struct usb_serial *serial);
95static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);
95static void ftdi_USB_UIRT_setup (struct ftdi_private *priv); 96static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);
96static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv); 97static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
97 98
@@ -99,6 +100,10 @@ static struct ftdi_sio_quirk ftdi_jtag_quirk = {
99 .probe = ftdi_jtag_probe, 100 .probe = ftdi_jtag_probe,
100}; 101};
101 102
103static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
104 .probe = ftdi_mtxorb_hack_setup,
105};
106
102static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 107static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
103 .port_probe = ftdi_USB_UIRT_setup, 108 .port_probe = ftdi_USB_UIRT_setup,
104}; 109};
@@ -161,6 +166,8 @@ static struct usb_device_id id_table_combined [] = {
161 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 166 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
162 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 167 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
163 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 168 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
169 { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
170 .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
164 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 171 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
165 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 172 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
166 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 173 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
@@ -1088,6 +1095,23 @@ static int ftdi_jtag_probe(struct usb_serial *serial)
1088 return 0; 1095 return 0;
1089} 1096}
1090 1097
1098/*
1099 * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
1100 * We have to correct it if we want to read from it.
1101 */
1102static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
1103{
1104 struct usb_host_endpoint *ep = serial->dev->ep_in[1];
1105 struct usb_endpoint_descriptor *ep_desc = &ep->desc;
1106
1107 if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
1108 ep_desc->wMaxPacketSize = 0x40;
1109 info("Fixing invalid wMaxPacketSize on read pipe");
1110 }
1111
1112 return 0;
1113}
1114
1091/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 1115/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
1092 * it is called when the usb device is disconnected 1116 * it is called when the usb device is disconnected
1093 * 1117 *