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

USB: ftdi_sio: add support for FT-X series devices

Add PID 0x6015, corresponding to the new series of FT-X chips
(FT220XD, FT201X, FT220X, FT221X, FT230X, FT231X, FT240X). They all
appear as serial devices, and seem indistinguishable except for the
default product string stored in their EEPROM. The baudrate
generation matches FT232RL devices.

Tested with a FT201X and FT230X at various baudrates (100 - 3000000).

Sample dmesg:
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
usb 2-1: new full-speed USB device number 6 using ohci_hcd
usb 2-1: New USB device found, idVendor=0403, idProduct=6015
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: FT230X USB Half UART
usb 2-1: Manufacturer: FTDI
usb 2-1: SerialNumber: DC001WI6
ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: ftdi_sio_port_probe
drivers/usb/serial/ftdi_sio.c: ftdi_determine_type: bcdDevice = 0x1000, bNumInterfaces = 1
usb 2-1: Detected FT-X
usb 2-1: Number of endpoints 2
usb 2-1: Endpoint 1 MaxPacketSize 64
usb 2-1: Endpoint 2 MaxPacketSize 64
usb 2-1: Setting MaxPacketSize 64
drivers/usb/serial/ftdi_sio.c: read_latency_timer
drivers/usb/serial/ftdi_sio.c: write_latency_timer: setting latency timer = 1
drivers/usb/serial/ftdi_sio.c: create_sysfs_attrs
drivers/usb/serial/ftdi_sio.c: sysfs attributes for FT-X
usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0

Signed-off-by: Jim Paris <jim@jtan.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jim Paris and committed by
Greg Kroah-Hartman
dc0827c1 093ea2d3

+18 -6
+15 -5
drivers/usb/serial/ftdi_sio.c
··· 188 188 .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, 189 189 { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 190 190 { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, 191 + { USB_DEVICE(FTDI_VID, FTDI_FTX_PID) }, 191 192 { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 192 193 { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 193 194 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, ··· 874 873 [FT232RL] = "FT232RL", 875 874 [FT2232H] = "FT2232H", 876 875 [FT4232H] = "FT4232H", 877 - [FT232H] = "FT232H" 876 + [FT232H] = "FT232H", 877 + [FTX] = "FT-X" 878 878 }; 879 879 880 880 ··· 1179 1177 break; 1180 1178 case FT232BM: /* FT232BM chip */ 1181 1179 case FT2232C: /* FT2232C chip */ 1182 - case FT232RL: 1180 + case FT232RL: /* FT232RL chip */ 1181 + case FTX: /* FT-X series */ 1183 1182 if (baud <= 3000000) { 1184 1183 __u16 product_id = le16_to_cpu( 1185 1184 port->serial->dev->descriptor.idProduct); ··· 1469 1466 } else if (version < 0x900) { 1470 1467 /* Assume it's an FT232RL */ 1471 1468 priv->chip_type = FT232RL; 1472 - } else { 1469 + } else if (version < 0x1000) { 1473 1470 /* Assume it's an FT232H */ 1474 1471 priv->chip_type = FT232H; 1472 + } else { 1473 + /* Assume it's an FT-X series device */ 1474 + priv->chip_type = FTX; 1475 1475 } 1476 + 1476 1477 dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 1477 1478 } 1478 1479 ··· 1604 1597 priv->chip_type == FT232RL || 1605 1598 priv->chip_type == FT2232H || 1606 1599 priv->chip_type == FT4232H || 1607 - priv->chip_type == FT232H)) { 1600 + priv->chip_type == FT232H || 1601 + priv->chip_type == FTX)) { 1608 1602 retval = device_create_file(&port->dev, 1609 1603 &dev_attr_latency_timer); 1610 1604 } ··· 1627 1619 priv->chip_type == FT232RL || 1628 1620 priv->chip_type == FT2232H || 1629 1621 priv->chip_type == FT4232H || 1630 - priv->chip_type == FT232H) { 1622 + priv->chip_type == FT232H || 1623 + priv->chip_type == FTX) { 1631 1624 device_remove_file(&port->dev, &dev_attr_latency_timer); 1632 1625 } 1633 1626 } ··· 2306 2297 case FT2232H: 2307 2298 case FT4232H: 2308 2299 case FT232H: 2300 + case FTX: 2309 2301 len = 2; 2310 2302 break; 2311 2303 default:
+2 -1
drivers/usb/serial/ftdi_sio.h
··· 157 157 FT232RL = 5, 158 158 FT2232H = 6, 159 159 FT4232H = 7, 160 - FT232H = 8 160 + FT232H = 8, 161 + FTX = 9, 161 162 }; 162 163 163 164 enum ftdi_sio_baudrate {
+1
drivers/usb/serial/ftdi_sio_ids.h
··· 23 23 #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ 24 24 #define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */ 25 25 #define FTDI_232H_PID 0x6014 /* Single channel hi-speed device */ 26 + #define FTDI_FTX_PID 0x6015 /* FT-X series (FT201X, FT230X, FT231X, etc) */ 26 27 #define FTDI_SIO_PID 0x8372 /* Product Id SIO application of 8U100AX */ 27 28 #define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */ 28 29