Calao use on there dev kits a FT2232 where the port 0 is used for the JTAG and port 1 for the UART They use the same VID and PID as FTDI Chip but they program the manufacturer name in the eeprom So use this information to detect it
Unified · Split
| @@ -101,6 +101,7 @@ static int ftdi_jtag_probe(struct usb_serial *serial); · 100 unmodified lines | ||
| 101 | 101 | static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); |
| 102 | 102 | static int ftdi_NDI_device_setup(struct usb_serial *serial); |
| 103 | 103 | static int ftdi_stmclite_probe(struct usb_serial *serial); |
| 104 | +static int ftdi_8u2232c_probe(struct usb_serial *serial); | |
| 104 | 105 | static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); |
| 105 | 106 | static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); |
| 106 | 107 | |
| @@ -128,6 +129,10 @@ static struct ftdi_sio_quirk ftdi_stmclite_quirk = { · 21 unmodified lines | ||
| 128 | 129 | .probe = ftdi_stmclite_probe, |
| 129 | 130 | }; |
| 130 | 131 | |
| 132 | +static struct ftdi_sio_quirk ftdi_8u2232c_quirk = { | |
| 133 | + .probe = ftdi_8u2232c_probe, | |
| 134 | +}; | |
| 135 | + | |
| 131 | 136 | /* |
| 132 | 137 | * The 8U232AM has the same API as the sio except for: |
| 133 | 138 | * - it can support MUCH higher baudrates; up to: |
| @@ -178,7 +183,8 @@ static struct usb_device_id id_table_combined [] = { · 44 unmodified lines | ||
| 178 | 183 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, |
| 179 | 184 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, |
| 180 | 185 | { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, |
| 181 | − { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, | |
| 186 | + { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) , | |
| 187 | + .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, | |
| 182 | 188 | { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, |
| 183 | 189 | { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, |
| 184 | 190 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, |
| @@ -1737,6 +1743,18 @@ static int ftdi_jtag_probe(struct usb_serial *serial) · 1552 unmodified lines | ||
| 1737 | 1743 | return 0; |
| 1738 | 1744 | } |
| 1739 | 1745 | |
| 1746 | +static int ftdi_8u2232c_probe(struct usb_serial *serial) | |
| 1747 | +{ | |
| 1748 | + struct usb_device *udev = serial->dev; | |
| 1749 | + | |
| 1750 | + dbg("%s", __func__); | |
| 1751 | + | |
| 1752 | + if (strcmp(udev->manufacturer, "CALAO Systems") == 0) | |
| 1753 | + return ftdi_jtag_probe(serial); | |
| 1754 | + | |
| 1755 | + return 0; | |
| 1756 | +} | |
| 1757 | + | |
| 1740 | 1758 | /* |
| 1741 | 1759 | * First and second port on STMCLiteadaptors is reserved for JTAG interface |
| 1742 | 1760 | * and the forth port for pio |