15fd54aceSGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0+ 21da177e4SLinus Torvalds /* 31da177e4SLinus Torvalds * USB FTDI SIO driver 41da177e4SLinus Torvalds * 5659597b7SJohan Hovold * Copyright (C) 2009 - 2013 6d3901a06SJohan Hovold * Johan Hovold (jhovold@gmail.com) 71da177e4SLinus Torvalds * Copyright (C) 1999 - 2001 81da177e4SLinus Torvalds * Greg Kroah-Hartman (greg@kroah.com) 91da177e4SLinus Torvalds * Bill Ryder (bryder@sgi.com) 101da177e4SLinus Torvalds * Copyright (C) 2002 111da177e4SLinus Torvalds * Kuba Ober (kuba@mareimbrium.org) 121da177e4SLinus Torvalds * 13464cbb24SAlan Cox * See Documentation/usb/usb-serial.txt for more information on using this 14464cbb24SAlan Cox * driver 151da177e4SLinus Torvalds * 161da177e4SLinus Torvalds * See http://ftdi-usb-sio.sourceforge.net for up to date testing info 171da177e4SLinus Torvalds * and extra documentation 181da177e4SLinus Torvalds * 19504b55ccSGreg Kroah-Hartman * Change entries from 2004 and earlier can be found in versions of this 20504b55ccSGreg Kroah-Hartman * file in kernel versions prior to the 2.6.24 release. 211da177e4SLinus Torvalds * 221da177e4SLinus Torvalds */ 231da177e4SLinus Torvalds 241da177e4SLinus Torvalds /* Bill Ryder - bryder@sgi.com - wrote the FTDI_SIO implementation */ 251da177e4SLinus Torvalds /* Thanx to FTDI for so kindly providing details of the protocol required */ 261da177e4SLinus Torvalds /* to talk to the device */ 27464cbb24SAlan Cox /* Thanx to gkh and the rest of the usb dev group for all code I have 28464cbb24SAlan Cox assimilated :-) */ 291da177e4SLinus Torvalds 301da177e4SLinus Torvalds #include <linux/kernel.h> 311da177e4SLinus Torvalds #include <linux/errno.h> 321da177e4SLinus Torvalds #include <linux/slab.h> 331da177e4SLinus Torvalds #include <linux/tty.h> 341da177e4SLinus Torvalds #include <linux/tty_driver.h> 351da177e4SLinus Torvalds #include <linux/tty_flip.h> 361da177e4SLinus Torvalds #include <linux/module.h> 371da177e4SLinus Torvalds #include <linux/spinlock.h> 38bd09a9f5SAlessio Igor Bogani #include <linux/mutex.h> 39464cbb24SAlan Cox #include <linux/uaccess.h> 401da177e4SLinus Torvalds #include <linux/usb.h> 411da177e4SLinus Torvalds #include <linux/serial.h> 42a969888cSGreg Kroah-Hartman #include <linux/usb/serial.h> 431da177e4SLinus Torvalds #include "ftdi_sio.h" 4431844d55SAndreas Mohr #include "ftdi_sio_ids.h" 451da177e4SLinus Torvalds 46d3901a06SJohan Hovold #define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>, Andreas Mohr, Johan Hovold <jhovold@gmail.com>" 471da177e4SLinus Torvalds #define DRIVER_DESC "USB FTDI Serial Converters Driver" 481da177e4SLinus Torvalds 491da177e4SLinus Torvalds 500ffbbe25SOliver Neukum struct ftdi_private { 513bb36aa2SGreg Kroah-Hartman enum ftdi_chip_type chip_type; 52464cbb24SAlan Cox /* type of device, either SIO or FT8U232AM */ 530ffbbe25SOliver Neukum int baud_base; /* baud base clock for divisor setting */ 54464cbb24SAlan Cox int custom_divisor; /* custom_divisor kludge, this is for 55464cbb24SAlan Cox baud_base (different from what goes to the 56464cbb24SAlan Cox chip!) */ 57*16410115SJohan Hovold u16 last_set_data_value; /* the last data state set - needed for doing 58464cbb24SAlan Cox * a break 59464cbb24SAlan Cox */ 600ffbbe25SOliver Neukum int flags; /* some ASYNC_xxxx flags are supported */ 610ffbbe25SOliver Neukum unsigned long last_dtr_rts; /* saved modem control outputs */ 62fca5430dSSimon Arlott char prev_status; /* Used for TIOCMIWAIT */ 63c466cd2bSGreg Kroah-Hartman char transmit_empty; /* If transmitter is empty or not */ 64fd54a99aSJohan Hovold u16 interface; /* FT2232C, FT2232H or FT4232H port interface 65094c2e6dSMark Adamson (0 for FT232/245) */ 660ffbbe25SOliver Neukum 67464cbb24SAlan Cox speed_t force_baud; /* if non-zero, force the baud rate to 68464cbb24SAlan Cox this value */ 69464cbb24SAlan Cox int force_rtscts; /* if non-zero, force RTS-CTS to always 70464cbb24SAlan Cox be enabled */ 710ffbbe25SOliver Neukum 72557aaa7fSAlan Cox unsigned int latency; /* latency setting in use */ 73895f28baSMark Adamson unsigned short max_packet_size; 749c67d28eSAlessio Igor Bogani struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ 750ffbbe25SOliver Neukum }; 760ffbbe25SOliver Neukum 778f977e42SIan Abbott /* struct ftdi_sio_quirk is used by devices requiring special attention. */ 788f977e42SIan Abbott struct ftdi_sio_quirk { 79fa91d43bSTony Lindgren int (*probe)(struct usb_serial *); 80464cbb24SAlan Cox /* Special settings for probed ports. */ 81464cbb24SAlan Cox void (*port_probe)(struct ftdi_private *); 828f977e42SIan Abbott }; 838f977e42SIan Abbott 8420734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial); 85b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial); 866ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial); 87c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial); 880ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 890ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 908f977e42SIan Abbott 913c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_jtag_quirk = { 9220734345SHarald Welte .probe = ftdi_jtag_probe, 93fa91d43bSTony Lindgren }; 94fa91d43bSTony Lindgren 953c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_NDI_device_quirk = { 96b760dac2SMartin Geleynse .probe = ftdi_NDI_device_setup, 97b760dac2SMartin Geleynse }; 98b760dac2SMartin Geleynse 993c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 1000ffbbe25SOliver Neukum .port_probe = ftdi_USB_UIRT_setup, 1018f977e42SIan Abbott }; 1028f977e42SIan Abbott 1033c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { 1040ffbbe25SOliver Neukum .port_probe = ftdi_HE_TIRA1_setup, 1051da177e4SLinus Torvalds }; 1061da177e4SLinus Torvalds 1073c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_stmclite_quirk = { 1086ec2f46cSJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_stmclite_probe, 1096ec2f46cSJean-Christophe PLAGNIOL-VILLARD }; 1106ec2f46cSJean-Christophe PLAGNIOL-VILLARD 1113c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_8u2232c_quirk = { 112c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_8u2232c_probe, 113c96fbdd0SJean-Christophe PLAGNIOL-VILLARD }; 114c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1151da177e4SLinus Torvalds /* 1161da177e4SLinus Torvalds * The 8U232AM has the same API as the sio except for: 1171da177e4SLinus Torvalds * - it can support MUCH higher baudrates; up to: 1181da177e4SLinus Torvalds * o 921600 for RS232 and 2000000 for RS422/485 at 48MHz 1191da177e4SLinus Torvalds * o 230400 at 12MHz 1201da177e4SLinus Torvalds * so .. 8U232AM's baudrate setting codes are different 1211da177e4SLinus Torvalds * - it has a two byte status code. 1221da177e4SLinus Torvalds * - it returns characters every 16ms (the FTDI does it every 40ms) 1231da177e4SLinus Torvalds * 1241da177e4SLinus Torvalds * the bcdDevice value is used to differentiate FT232BM and FT245BM from 1251da177e4SLinus Torvalds * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 1261da177e4SLinus Torvalds * combinations in both tables. 1278f977e42SIan Abbott * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices, 1288f977e42SIan Abbott * but I don't know if those ever went into mass production. [Ian Abbott] 1291da177e4SLinus Torvalds */ 1301da177e4SLinus Torvalds 1311da177e4SLinus Torvalds 1321da177e4SLinus Torvalds 13365e1ec67SAndreas Mohr /* 134e17c1aa2SJohan Hovold * Device ID not listed? Test it using 135e17c1aa2SJohan Hovold * /sys/bus/usb-serial/drivers/ftdi_sio/new_id and send a patch or report. 13665e1ec67SAndreas Mohr */ 1375c6b98ddSJohan Hovold static const struct usb_device_id id_table_combined[] = { 1387f2719f0SPerry Hung { USB_DEVICE(FTDI_VID, FTDI_BRICK_PID) }, 139ce7e9065SArtur Zimmer { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, 1405a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) }, 1415a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) }, 1422011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 1432011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 14401ba0856SAndrew Ewert { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 1456552cc7fSJohan Hovold { USB_DEVICE(FTDI_VID, FTDI_BM_ATOM_NANO_PID) }, 14665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 14767847baeSBjørn Mork { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, 1486e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, 1496e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, 1506e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, 1516e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) }, 1526e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) }, 1536e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, 1546e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, 1556e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, 156b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, 157b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, 158b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, 15972a9f958SRazvan Gavril { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 1601da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 16169737dfaSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 162d099321bSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, 163fad14a0dSFrank Sievertsen { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, 1641da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 1651da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 1661da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 167d8b21606SGard Spreemann { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, 168c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) , 169c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, 170094c2e6dSMark Adamson { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 171309427b6SUwe Bonnes { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, 172dc0827c1SJim Paris { USB_DEVICE(FTDI_VID, FTDI_FTX_PID) }, 173c0f8d561SChristophe Mariac { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 1741da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 1752adb80e9SGuido Scholz { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, 176ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) }, 177ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 178ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 17999c1e4f8SRainer Keller { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, 18058f8b6c4SStefani Seibold { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, 181d7e14b37SMartin Teichmann { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, 18271381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_CC_PID) }, 18371381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) }, 1841da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 1851da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 186f2ee6955SAlan Cox { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 18776f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, 18876f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, 189ea233f80SGalen Seitz { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, 1901da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 1911da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, 1921da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, 1931da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_633_PID) }, 1941da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_631_PID) }, 1951da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_635_PID) }, 1961da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_640_PID) }, 1971da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_642_PID) }, 1981da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) }, 19974bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_0_PID) }, 20074bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_1_PID) }, 2011da177e4SLinus Torvalds { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) }, 2021da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) }, 2038f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_0_PID) }, 2048f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_1_PID) }, 2058f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_2_PID) }, 2068f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_3_PID) }, 2078f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 2088f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 2098f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 210b34efeeaSFolkert van Heusden { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, 2116fdbad80SJacques Viviers { USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) }, 212ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 213ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 214ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 215ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0103_PID) }, 216ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0104_PID) }, 217ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0105_PID) }, 218ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0106_PID) }, 219ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0107_PID) }, 220ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0108_PID) }, 221ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0109_PID) }, 222ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010A_PID) }, 223ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010B_PID) }, 224ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010C_PID) }, 225ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010D_PID) }, 226ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010E_PID) }, 227ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010F_PID) }, 228ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0110_PID) }, 229ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0111_PID) }, 230ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0112_PID) }, 231ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0113_PID) }, 232ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0114_PID) }, 233ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0115_PID) }, 234ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0116_PID) }, 235ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0117_PID) }, 236ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0118_PID) }, 237ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0119_PID) }, 238ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011A_PID) }, 239ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011B_PID) }, 240ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011C_PID) }, 241ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011D_PID) }, 242ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011E_PID) }, 243ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011F_PID) }, 244ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0120_PID) }, 245ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0121_PID) }, 246ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0122_PID) }, 247ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0123_PID) }, 248ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0124_PID) }, 249ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0125_PID) }, 250ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0126_PID) }, 25119de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID) }, 252ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 253ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 254ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 255ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 25619de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID) }, 257ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 258ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 259ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, 260ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0130_PID) }, 261ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0131_PID) }, 262ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0132_PID) }, 263ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0133_PID) }, 264ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0134_PID) }, 265ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0135_PID) }, 266ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0136_PID) }, 267ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0137_PID) }, 268ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0138_PID) }, 269ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0139_PID) }, 270ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013A_PID) }, 271ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013B_PID) }, 272ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013C_PID) }, 273ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013D_PID) }, 274ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013E_PID) }, 275ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013F_PID) }, 276ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0140_PID) }, 277ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0141_PID) }, 278ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0142_PID) }, 279ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0143_PID) }, 280ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0144_PID) }, 281ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0145_PID) }, 282ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0146_PID) }, 283ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0147_PID) }, 284ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0148_PID) }, 285ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0149_PID) }, 286ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014A_PID) }, 287ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014B_PID) }, 288ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014C_PID) }, 289ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014D_PID) }, 290ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014E_PID) }, 291ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014F_PID) }, 292ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 293ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 294ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 29519de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID) }, 29619de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID) }, 29719de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID) }, 29819de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID) }, 29919de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID) }, 30019de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID) }, 301ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 302ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 303ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, 304ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015C_PID) }, 305ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015D_PID) }, 306ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015E_PID) }, 307ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015F_PID) }, 308ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0160_PID) }, 309ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0161_PID) }, 310ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0162_PID) }, 311ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0163_PID) }, 312ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0164_PID) }, 313ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0165_PID) }, 314ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0166_PID) }, 315ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0167_PID) }, 316ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0168_PID) }, 317ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0169_PID) }, 318ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016A_PID) }, 319ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016B_PID) }, 320ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016C_PID) }, 321ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016D_PID) }, 322ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016E_PID) }, 323ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016F_PID) }, 324ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0170_PID) }, 325ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0171_PID) }, 326ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0172_PID) }, 327ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0173_PID) }, 328ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0174_PID) }, 329ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0175_PID) }, 330ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0176_PID) }, 331ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0177_PID) }, 332ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0178_PID) }, 333ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0179_PID) }, 334ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017A_PID) }, 335ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017B_PID) }, 336ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017C_PID) }, 337ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017D_PID) }, 338ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017E_PID) }, 339ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017F_PID) }, 340ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0180_PID) }, 341ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0181_PID) }, 342ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0182_PID) }, 343ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0183_PID) }, 344ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0184_PID) }, 345ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0185_PID) }, 346ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0186_PID) }, 347ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0187_PID) }, 348ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0188_PID) }, 349ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0189_PID) }, 350ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018A_PID) }, 351ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018B_PID) }, 352ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018C_PID) }, 353ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018D_PID) }, 354ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018E_PID) }, 355ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018F_PID) }, 356ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0190_PID) }, 357ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0191_PID) }, 358ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0192_PID) }, 359ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0193_PID) }, 360ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0194_PID) }, 361ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0195_PID) }, 362ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0196_PID) }, 363ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0197_PID) }, 364ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0198_PID) }, 365ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0199_PID) }, 366ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019A_PID) }, 367ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019B_PID) }, 368ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019C_PID) }, 369ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019D_PID) }, 370ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019E_PID) }, 371ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019F_PID) }, 372ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A0_PID) }, 373ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A1_PID) }, 374ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A2_PID) }, 375ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A3_PID) }, 376ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A4_PID) }, 377ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A5_PID) }, 378ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A6_PID) }, 379ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A7_PID) }, 380ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A8_PID) }, 381ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A9_PID) }, 382ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AA_PID) }, 383ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AB_PID) }, 384ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AC_PID) }, 385ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AD_PID) }, 386ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AE_PID) }, 387ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AF_PID) }, 388ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B0_PID) }, 389ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B1_PID) }, 390ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B2_PID) }, 391ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B3_PID) }, 392ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B4_PID) }, 393ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B5_PID) }, 394ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B6_PID) }, 395ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B7_PID) }, 396ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B8_PID) }, 397ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B9_PID) }, 398ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BA_PID) }, 399ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BB_PID) }, 400ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BC_PID) }, 401ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BD_PID) }, 402ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BE_PID) }, 403ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BF_PID) }, 404ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C0_PID) }, 405ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C1_PID) }, 406ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C2_PID) }, 407ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C3_PID) }, 408ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C4_PID) }, 409ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C5_PID) }, 410ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C6_PID) }, 411ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C7_PID) }, 412ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C8_PID) }, 413ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C9_PID) }, 414ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CA_PID) }, 415ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CB_PID) }, 416ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CC_PID) }, 417ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CD_PID) }, 418ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CE_PID) }, 419ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CF_PID) }, 420ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D0_PID) }, 421ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D1_PID) }, 422ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D2_PID) }, 423ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D3_PID) }, 424ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D4_PID) }, 425ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D5_PID) }, 426ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D6_PID) }, 427ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D7_PID) }, 428ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D8_PID) }, 429ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D9_PID) }, 430ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DA_PID) }, 431ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DB_PID) }, 432ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DC_PID) }, 433ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DD_PID) }, 434ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DE_PID) }, 435ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DF_PID) }, 436ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E0_PID) }, 437ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E1_PID) }, 438ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E2_PID) }, 439ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E3_PID) }, 440ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E4_PID) }, 441ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E5_PID) }, 442ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E6_PID) }, 443ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E7_PID) }, 444ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E8_PID) }, 445ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E9_PID) }, 446ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EA_PID) }, 447ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EB_PID) }, 448ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EC_PID) }, 449ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01ED_PID) }, 450ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EE_PID) }, 451ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EF_PID) }, 452ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F0_PID) }, 453ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F1_PID) }, 454ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F2_PID) }, 455ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F3_PID) }, 456ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F4_PID) }, 457ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F5_PID) }, 458ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F6_PID) }, 459ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F7_PID) }, 460ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F8_PID) }, 461ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F9_PID) }, 462ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FA_PID) }, 463ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FB_PID) }, 464ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FC_PID) }, 465ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 466ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 467ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 468204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) }, 469204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) }, 470204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) }, 471204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) }, 472204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) }, 473204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) }, 474204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) }, 475204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) }, 476204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) }, 477204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) }, 478204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) }, 479204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) }, 480204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) }, 481204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) }, 482204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) }, 483204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) }, 484204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) }, 485204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) }, 486204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) }, 487204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) }, 488204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) }, 489204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) }, 490204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) }, 491204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) }, 492204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) }, 493204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) }, 494204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) }, 495204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) }, 496204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) }, 497204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) }, 498204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) }, 499204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) }, 500204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) }, 5018f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 5021da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 503274a4bbcSDave Platt { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 504868e440dSJelle Foks { USB_DEVICE(FTDI_VID, FTDI_USBX_707_PID) }, 5051da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 5061da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 5071da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 5081da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, 509a1484827SJustin Carlson { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, 5101da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, 5111da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, 5121da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, 5131da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_2_PID) }, 5141da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_1_PID) }, 5151da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_2_PID) }, 5161da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_1_PID) }, 5171da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_2_PID) }, 5181da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_3_PID) }, 5191da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_4_PID) }, 5201da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_1_PID) }, 5211da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_2_PID) }, 5221da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_3_PID) }, 5231da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_4_PID) }, 5241da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_1_PID) }, 5251da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_2_PID) }, 5261da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_3_PID) }, 5271da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_4_PID) }, 5281da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_1_PID) }, 5291da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_2_PID) }, 5301da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_3_PID) }, 5311da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_4_PID) }, 5321da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_5_PID) }, 5331da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_6_PID) }, 5341da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_7_PID) }, 5351da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_8_PID) }, 5361da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_1_PID) }, 5371da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_2_PID) }, 5381da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_3_PID) }, 5391da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_4_PID) }, 5401da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_5_PID) }, 5411da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_6_PID) }, 5421da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_7_PID) }, 5431da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_8_PID) }, 5441da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_1_PID) }, 5451da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_2_PID) }, 5461da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_3_PID) }, 5471da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_4_PID) }, 5481da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_5_PID) }, 5491da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) }, 5501da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) }, 5511da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 5526d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_1_PID) }, 5536d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_2_PID) }, 5546d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_3_PID) }, 5556d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_4_PID) }, 5561da177e4SLinus Torvalds { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 5571da177e4SLinus Torvalds { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 55811a31d84SJohan Hovold { USB_DEVICE(OCT_VID, OCT_DK201_PID) }, 5598f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID), 5608f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk }, 5618f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID), 5628f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk }, 5631da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 5641da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 5651da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 5661da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 5678f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) }, 5688f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) }, 5698f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) }, 5708f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) }, 5718f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) }, 5728f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) }, 5738f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) }, 5748f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) }, 5758f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) }, 5768f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) }, 5778f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) }, 5788f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) }, 5798f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) }, 5808f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) }, 5818f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) }, 5828f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) }, 5831da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 58447900743SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 585e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UR100_PID) }, 586e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 587207c47e1SThomas Riewe { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 588bde62185SMartin Hagelin { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 5894eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, 5904eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, 5914eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, 5924eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, 5934eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, 5944eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, 5954eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, 5964eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, 59737909fe5SBenedek László { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) }, 59854575b05SAntonio Ospite { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID), 59954575b05SAntonio Ospite .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 600d0839d75SGeorge McCollister { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID), 601d0839d75SGeorge McCollister .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 6024899c054SDoug Goldstein { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, 6031fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) }, 6041fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) }, 6051fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) }, 6061fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) }, 607e6ac4a40SIan Abbott /* 60865e1ec67SAndreas Mohr * ELV devices: 609e6ac4a40SIan Abbott */ 610c249f911SSven Killig { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, 61165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 61265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 61365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, 61465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) }, 61565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) }, 61665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) }, 61765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) }, 61865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) }, 61942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) }, 62042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) }, 62142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) }, 62242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDF77_PID) }, 62342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UIO88_PID) }, 62442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UAD8_PID) }, 62542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDA7_PID) }, 62642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_USI2_PID) }, 62742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_T1100_PID) }, 62842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCD200_PID) }, 62942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_ULA200_PID) }, 63042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CSI8_PID) }, 63142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1000DL_PID) }, 63242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) }, 63342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) }, 63442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, 63565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) }, 63642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, 63765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) }, 63842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, 6394ae897dfSSven Andersen { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, 64042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, 641b5894a50SAndré Schenk { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) }, 64265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) }, 64365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) }, 64465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) }, 64565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) }, 6466977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_PALMSENS_PID) }, 6476977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_IVIUM_XSTAT_PID) }, 6488f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, 6498f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, 6508f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) }, 6518f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) }, 6528f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) }, 6531da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 6541da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 655ec434e9bSJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 6569d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) }, 6579d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) }, 6589d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) }, 6591da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 6601da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 6611da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 6621da177e4SLinus Torvalds { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 663e6ac4a40SIan Abbott { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 6641da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 665c3d36c45SVladimir Vukicevic { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, 666ef31fec0SMichael Olberg { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, 6676f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 66828fe2eb0SMichael Williamson { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, 66946b72d78SDaniel Sangorrin { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, 670482b0b5dSKonstantin Holoborodko { USB_DEVICE(MITSUBISHI_VID, MITSUBISHI_FXUSB_PID) }, 6711da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 6721da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 6731da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, 674a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) }, 675a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) }, 676a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) }, 677a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) }, 678a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) }, 679a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) }, 680a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) }, 681a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) }, 682a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) }, 683a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) }, 684a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) }, 685a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) }, 686a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) }, 687a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) }, 6881da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 6896f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 6906f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 691a26d31ceSSteffen Sledz { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) }, 692e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 693e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 694e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 695e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_3_PID) }, 696e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_4_PID) }, 697e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 698e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 699e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 700edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) }, 701edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, 7024bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, 7031df5b888SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, 7044bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 7050ba3b2ccSPetr Kubánek { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 7066f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 7078f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 70834d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 70934d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 7109b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 7119b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 71234d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 71334d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 71434d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 71534d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 716740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 717740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 7189b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 719c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 720c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 721c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 722c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 72309c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 724c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 72509c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 72634910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 727b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 728b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 729effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 730641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 7317e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 732a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 733a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 734ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 735cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 7367e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 73726a538b9SHorst Schirmeier { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 738a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 739a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 740a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 741a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 742a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 743a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 744a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 745a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 746a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 747a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 748a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 74920a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 750eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 75148437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 7525a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_1_PID) }, 7535a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_3_PID) }, 754eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 7559978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 7569978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 7579978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 75840c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 759b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 760b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 761b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 762b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 763b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 764b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 765b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 766b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 767b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 768b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 769822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 770ee444609SJohan Hovold { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) }, 7719608e5c0SMajor Hayden { USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) }, 772fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, 773fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, 774fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, 775fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, 776fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, 777fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, 778fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, 779fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, 780fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, 781fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, 782fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, 783fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, 784fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, 785fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, 786fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, 787fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, 788fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, 789fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, 790fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, 791fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, 792fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, 793fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, 794fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, 795fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, 796fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, 797fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, 798fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, 799fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, 800762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 801a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 802d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 8034bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 80411171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 805307369b0SMarcin Kościelnicki { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 806c7d373c3SMax Mansfield { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), 807c7d373c3SMax Mansfield .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8085f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, 8095f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, 8105f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, 8115f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, 81220734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 81320734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 81420734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 81520734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 816a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 817a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 818a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 819a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8203687f641SPeter Stuge { USB_DEVICE(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID), 8213687f641SPeter Stuge .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82214511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 82314511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82426ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 825e03cdf22SGreg Kroah-Hartman { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, 8262542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 82759c6ccd9SDaniel Suchy 82859c6ccd9SDaniel Suchy /* Papouch devices based on FTDI chip */ 82959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) }, 83059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) }, 83159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) }, 83259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) }, 83359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) }, 83459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) }, 83559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) }, 83659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) }, 83759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) }, 83859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) }, 83959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 84059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) }, 84159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) }, 84259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) }, 843a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 84459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) }, 84559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) }, 84659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) }, 84759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) }, 84859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) }, 84959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) }, 85059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) }, 85159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) }, 85259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) }, 85359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) }, 854a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 85559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) }, 85659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) }, 85759c6ccd9SDaniel Suchy 85896285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 85996285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 86045eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 861ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 8627f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 8637f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 8647f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 865b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 866b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 86711eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 86811eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 869f08dea73SBjørn Mork { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 870f08dea73SBjørn Mork USB_CLASS_VENDOR_SPEC, 871f08dea73SBjørn Mork USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 87231c5d192SMarek Vasut { USB_DEVICE_INTERFACE_NUMBER(ACTEL_VID, MICROSEMI_ARROW_SF2PLUS_BOARD_PID, 2) }, 873ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 8741002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 8751002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 876d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 877fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 878dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 879dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 880dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C866_PID) }, 881dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C663_PID) }, 882dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C725_PID) }, 883dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E517_PID) }, 884dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C863_PID) }, 885b69cc672SÉric Piel { USB_DEVICE(PI_VID, PI_E861_PID) }, 886dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C867_PID) }, 887dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E609_PID) }, 888dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E709_PID) }, 889dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_100F_PID) }, 890dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1011_PID) }, 891dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1012_PID) }, 892dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1013_PID) }, 893dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1014_PID) }, 894dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1015_PID) }, 895dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1016_PID) }, 8967724a1edSOzan Çağlayan { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 897c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 89850d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 89950d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 90055f13aeaSPeter Korsgaard { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID), 90155f13aeaSPeter Korsgaard .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 902e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 903c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, 904c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, 905e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 9069714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 9079714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 9089714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 9099714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 91077dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 91177dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91277dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 91377dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91477dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 91577dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91677dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 91777dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 918afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 9193126d823SRich Mattes { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) }, 920666cc076SMartin Michlmayr { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), 921666cc076SMartin Michlmayr .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92265737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, 92365737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, 92465737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, 92565737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, 92665737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, 92765737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, 92865737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, 92965737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, 9300f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, 9310f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, 9320f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, 93390451e69SMilan Kocian { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, 9346555ad13SClemens Werther { USB_DEVICE(FTDI_VID, FTDI_FHE_PID) }, 9355363cdc3SFlorian Faber { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, 9367fea0f71SSebastien Bourdeauducq { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), 9377fea0f71SSebastien Bourdeauducq .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9389f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), 9399f06d15fSAdrian Thomasset .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9409f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), 9416ec2f46cSJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, 942fc216ec3SPeter Naulls { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, 94347594d55SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 94447594d55SMichał Wróbel .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 94557e596f3SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 9468cf65dc3STomasz Mloduchowski /* Crucible Devices */ 9478cf65dc3STomasz Mloduchowski { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 948e1466ad5SАлексей Крамаренко { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, 9496dbd46c8SJoerg Dorchain /* Cressi Devices */ 9506dbd46c8SJoerg Dorchain { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, 951efe26e16SMichele Baldessari /* Brainboxes Devices */ 952efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_001_PID) }, 953efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_012_PID) }, 954efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) }, 955efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) }, 956efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) }, 957efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) }, 958efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) }, 959efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) }, 960efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_4_PID) }, 961efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_5_PID) }, 962efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) }, 963efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) }, 964efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) }, 965efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) }, 966efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) }, 967efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) }, 968efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) }, 969efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) }, 970efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) }, 971efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) }, 972efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) }, 973efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) }, 974efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_357_PID) }, 975efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_1_PID) }, 976efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_2_PID) }, 977efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_3_PID) }, 978efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_1_PID) }, 979efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_2_PID) }, 980efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_1_PID) }, 981efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, 982efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, 983efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, 984646907f5SJaša Bartelj /* ekey Devices */ 985646907f5SJaša Bartelj { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) }, 986d8279a40SMichal Sojka /* Infineon Devices */ 987ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) }, 988ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) }, 9899c491c37STaylor Braun-Jones /* GE Healthcare devices */ 9909c491c37STaylor Braun-Jones { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) }, 991f6950344SMark Glover /* Active Research (Actisense) devices */ 992f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NDC_PID) }, 993f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) }, 994f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) }, 995f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) }, 996f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) }, 997f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) }, 998f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) }, 999f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) }, 1000f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) }, 1001f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) }, 1002f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_NMEA2000_PID) }, 1003f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ETHERNET_PID) }, 1004f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_WIFI_PID) }, 1005f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 1006f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 1007f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 1008ea6db90eSJosh Boyer /* ICP DAS I-756xU devices */ 1009ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, 1010ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, 1011ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, 1012ae34d12cSSheng-Hui J. Chu { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, 10139bfef729SDoug Brown { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), 10149bfef729SDoug Brown .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 1015a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, 1016a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, 1017c6a36ad3SMax Schulze { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) }, 10181da177e4SLinus Torvalds { } /* Terminating entry */ 10191da177e4SLinus Torvalds }; 10201da177e4SLinus Torvalds 10211da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 10221da177e4SLinus Torvalds 10234c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 10241da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 10251da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 10261da177e4SLinus Torvalds [FT232BM] = "FT232BM", 10271da177e4SLinus Torvalds [FT2232C] = "FT2232C", 1028d8b21606SGard Spreemann [FT232RL] = "FT232RL", 1029094c2e6dSMark Adamson [FT2232H] = "FT2232H", 1030309427b6SUwe Bonnes [FT4232H] = "FT4232H", 1031dc0827c1SJim Paris [FT232H] = "FT232H", 1032dc0827c1SJim Paris [FTX] = "FT-X" 10331da177e4SLinus Torvalds }; 10341da177e4SLinus Torvalds 10351da177e4SLinus Torvalds 10361da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 10371da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 10381da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 10391da177e4SLinus Torvalds /* End TIOCMIWAIT */ 10401da177e4SLinus Torvalds 10411da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 1042464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1043464cbb24SAlan Cox const struct usb_device_id *id); 104412bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 104512bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 1046a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 1047335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 10481b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 1049d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1050c23e5fc1SJohan Hovold void *dest, size_t size); 1051464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 1052464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 105360b33c13SAlan Cox static int ftdi_tiocmget(struct tty_struct *tty); 105420b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 1055464cbb24SAlan Cox unsigned int set, unsigned int clear); 105600a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 1057464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 105895da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 1059a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port); 1060c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 10615fb0432eSJohan Hovold unsigned char status[2]); 10621da177e4SLinus Torvalds 10631da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 10641da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 1065fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 1066fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud); 1067fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 1068fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud); 10691da177e4SLinus Torvalds 1070ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 107118fcac35SGreg Kroah-Hartman .driver = { 10721da177e4SLinus Torvalds .owner = THIS_MODULE, 1073269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 107418fcac35SGreg Kroah-Hartman }, 1075269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 10768f977e42SIan Abbott .id_table = id_table_combined, 10771da177e4SLinus Torvalds .num_ports = 1, 1078bbcb2b90SJohan Hovold .bulk_in_size = 512, 1079c23e5fc1SJohan Hovold .bulk_out_size = 256, 10808f977e42SIan Abbott .probe = ftdi_sio_probe, 108112bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 108212bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 10831da177e4SLinus Torvalds .open = ftdi_open, 1084335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 10851b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 10861b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 10871b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 1088d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 10891da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 10901da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 1091f307e5cdSJohan Hovold .tiocmiwait = usb_serial_generic_tiocmiwait, 10926f86fec9SJohan Hovold .get_icount = usb_serial_generic_get_icount, 10931da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 10941da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 10951da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 1096a37025b5SJohan Hovold .tx_empty = ftdi_tx_empty, 10971da177e4SLinus Torvalds }; 10981da177e4SLinus Torvalds 109997b6b6d2SAlan Stern static struct usb_serial_driver * const serial_drivers[] = { 110097b6b6d2SAlan Stern &ftdi_sio_device, NULL 110197b6b6d2SAlan Stern }; 110297b6b6d2SAlan Stern 11031da177e4SLinus Torvalds 11041da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 1105279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 11061da177e4SLinus Torvalds 11071da177e4SLinus Torvalds /* 11081da177e4SLinus Torvalds * *************************************************************************** 1109fa91d43bSTony Lindgren * Utility functions 11101da177e4SLinus Torvalds * *************************************************************************** 11111da177e4SLinus Torvalds */ 11121da177e4SLinus Torvalds 11131da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 11141da177e4SLinus Torvalds { 11151da177e4SLinus Torvalds unsigned short int divisor; 1116464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 1117464cbb24SAlan Cox int divisor3 = base / 2 / baud; 1118464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 1119464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 11201da177e4SLinus Torvalds divisor = divisor3 >> 3; 11211da177e4SLinus Torvalds divisor3 &= 0x7; 1122464cbb24SAlan Cox if (divisor3 == 1) 1123464cbb24SAlan Cox divisor |= 0xc000; 1124464cbb24SAlan Cox else if (divisor3 >= 4) 1125464cbb24SAlan Cox divisor |= 0x4000; 1126464cbb24SAlan Cox else if (divisor3 != 0) 1127464cbb24SAlan Cox divisor |= 0x8000; 1128464cbb24SAlan Cox else if (divisor == 1) 1129464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 11301da177e4SLinus Torvalds return divisor; 11311da177e4SLinus Torvalds } 11321da177e4SLinus Torvalds 11331da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 11341da177e4SLinus Torvalds { 1135464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 11361da177e4SLinus Torvalds } 11371da177e4SLinus Torvalds 1138fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 11391da177e4SLinus Torvalds { 11401da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1141fd54a99aSJohan Hovold u32 divisor; 1142464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 1143464cbb24SAlan Cox int divisor3 = base / 2 / baud; 11441da177e4SLinus Torvalds divisor = divisor3 >> 3; 1145fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 11461da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 1147464cbb24SAlan Cox if (divisor == 1) 1148464cbb24SAlan Cox divisor = 0; 1149464cbb24SAlan Cox else if (divisor == 0x4001) 1150464cbb24SAlan Cox divisor = 1; 11511da177e4SLinus Torvalds return divisor; 11521da177e4SLinus Torvalds } 11531da177e4SLinus Torvalds 1154fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud) 11551da177e4SLinus Torvalds { 1156464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 11571da177e4SLinus Torvalds } 11581da177e4SLinus Torvalds 1159fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 1160094c2e6dSMark Adamson { 1161094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1162fd54a99aSJohan Hovold u32 divisor; 1163094c2e6dSMark Adamson int divisor3; 1164094c2e6dSMark Adamson 1165094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 1166f6c259a3SDaniel Glöckner divisor3 = base * 8 / (baud * 10); 1167094c2e6dSMark Adamson 1168094c2e6dSMark Adamson divisor = divisor3 >> 3; 1169fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 1170094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 1171094c2e6dSMark Adamson if (divisor == 1) 1172094c2e6dSMark Adamson divisor = 0; 1173094c2e6dSMark Adamson else if (divisor == 0x4001) 1174094c2e6dSMark Adamson divisor = 1; 1175094c2e6dSMark Adamson /* 1176094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 1177094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 1178094c2e6dSMark Adamson * baud with this bit set 1179094c2e6dSMark Adamson */ 1180094c2e6dSMark Adamson divisor |= 0x00020000; 1181094c2e6dSMark Adamson return divisor; 1182094c2e6dSMark Adamson } 1183094c2e6dSMark Adamson 1184fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud) 1185094c2e6dSMark Adamson { 1186094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 1187094c2e6dSMark Adamson } 1188094c2e6dSMark Adamson 118974ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 119074ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 119174ede0ffSIan Abbott 1192464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 1193464cbb24SAlan Cox unsigned int clear) 11941da177e4SLinus Torvalds { 11951da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1196bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 1197*16410115SJohan Hovold unsigned value; 11981da177e4SLinus Torvalds int rv; 11991da177e4SLinus Torvalds 120074ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 1201bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); 120274ede0ffSIan Abbott return 0; /* no change */ 12031da177e4SLinus Torvalds } 120474ede0ffSIan Abbott 120574ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 1206*16410115SJohan Hovold value = 0; 120774ede0ffSIan Abbott if (clear & TIOCM_DTR) 1208*16410115SJohan Hovold value |= FTDI_SIO_SET_DTR_LOW; 120974ede0ffSIan Abbott if (clear & TIOCM_RTS) 1210*16410115SJohan Hovold value |= FTDI_SIO_SET_RTS_LOW; 121174ede0ffSIan Abbott if (set & TIOCM_DTR) 1212*16410115SJohan Hovold value |= FTDI_SIO_SET_DTR_HIGH; 121374ede0ffSIan Abbott if (set & TIOCM_RTS) 1214*16410115SJohan Hovold value |= FTDI_SIO_SET_RTS_HIGH; 12151da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 12161da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 12171da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 12181da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 1219*16410115SJohan Hovold value, priv->interface, 122066e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 122174ede0ffSIan Abbott if (rv < 0) { 1222bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", 1223441b62c1SHarvey Harrison __func__, 1224bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1225bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12262c2ee545SJohan Hovold rv = usb_translate_errors(rv); 12271da177e4SLinus Torvalds } else { 1228bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1229bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1230bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12319b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 123274ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 12331da177e4SLinus Torvalds } 12341da177e4SLinus Torvalds return rv; 12351da177e4SLinus Torvalds } 12361da177e4SLinus Torvalds 12371da177e4SLinus Torvalds 1238fd54a99aSJohan Hovold static u32 get_ftdi_divisor(struct tty_struct *tty, 1239464cbb24SAlan Cox struct usb_serial_port *port) 1240e49bbce1SJohan Hovold { 12411da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1242bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 1243fd54a99aSJohan Hovold u32 div_value = 0; 12441da177e4SLinus Torvalds int div_okay = 1; 12451da177e4SLinus Torvalds int baud; 12461da177e4SLinus Torvalds 124795da310eSAlan Cox baud = tty_get_baud_rate(tty); 1248bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); 12491da177e4SLinus Torvalds 125083c9a2d1SJohan Hovold /* 125183c9a2d1SJohan Hovold * Observe deprecated async-compatible custom_divisor hack, update 125283c9a2d1SJohan Hovold * baudrate if needed. 125383c9a2d1SJohan Hovold */ 12541da177e4SLinus Torvalds if (baud == 38400 && 12551da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 12561da177e4SLinus Torvalds (priv->custom_divisor)) { 12571da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1258bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", 1259464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 12601da177e4SLinus Torvalds } 12611da177e4SLinus Torvalds 1262464cbb24SAlan Cox if (!baud) 1263464cbb24SAlan Cox baud = 9600; 12641da177e4SLinus Torvalds switch (priv->chip_type) { 12651da177e4SLinus Torvalds case SIO: /* SIO chip */ 12661da177e4SLinus Torvalds switch (baud) { 12671da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 12681da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 12691da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 12701da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 12711da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 12721da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 12731da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 12741da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 12751da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 12761da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 12771da177e4SLinus Torvalds } /* baud */ 12781da177e4SLinus Torvalds if (div_value == 0) { 1279bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", 1280464cbb24SAlan Cox __func__, baud); 12811da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1282669a6db1SAlan Cox baud = 9600; 12831da177e4SLinus Torvalds div_okay = 0; 12841da177e4SLinus Torvalds } 12851da177e4SLinus Torvalds break; 12861da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 12871da177e4SLinus Torvalds if (baud <= 3000000) { 12881da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 12891da177e4SLinus Torvalds } else { 1290bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1291669a6db1SAlan Cox baud = 9600; 12921da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 12931da177e4SLinus Torvalds div_okay = 0; 12941da177e4SLinus Torvalds } 12951da177e4SLinus Torvalds break; 12961da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 12971da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 1298dc0827c1SJim Paris case FT232RL: /* FT232RL chip */ 1299dc0827c1SJim Paris case FTX: /* FT-X series */ 13001da177e4SLinus Torvalds if (baud <= 3000000) { 1301fd54a99aSJohan Hovold u16 product_id = le16_to_cpu( 1302b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1303fb571101SMathieu OTHACEHE if (((product_id == FTDI_NDI_HUC_PID) || 1304fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_SPECTRA_SCU_PID) || 1305fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_2_PID) || 1306fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_3_PID) || 1307fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_AURORA_SCU_PID)) && 1308b760dac2SMartin Geleynse (baud == 19200)) { 1309b760dac2SMartin Geleynse baud = 1200000; 1310b760dac2SMartin Geleynse } 13111da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 13121da177e4SLinus Torvalds } else { 1313bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 13141da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 13151da177e4SLinus Torvalds div_okay = 0; 1316669a6db1SAlan Cox baud = 9600; 13171da177e4SLinus Torvalds } 13181da177e4SLinus Torvalds break; 1319094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1320094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1321309427b6SUwe Bonnes case FT232H: /* FT232H chip */ 13221862cdd5SIonut Nicu if ((baud <= 12000000) && (baud >= 1200)) { 1323094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1324094c2e6dSMark Adamson } else if (baud < 1200) { 1325094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1326094c2e6dSMark Adamson } else { 1327bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1328094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1329094c2e6dSMark Adamson div_okay = 0; 1330094c2e6dSMark Adamson baud = 9600; 1331094c2e6dSMark Adamson } 1332094c2e6dSMark Adamson break; 13331da177e4SLinus Torvalds } /* priv->chip_type */ 13341da177e4SLinus Torvalds 13351da177e4SLinus Torvalds if (div_okay) { 1336bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", 1337441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 13381da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 13391da177e4SLinus Torvalds } 13401da177e4SLinus Torvalds 134195da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1342464cbb24SAlan Cox return div_value; 13431da177e4SLinus Torvalds } 13441da177e4SLinus Torvalds 134595da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 134695da310eSAlan Cox { 134795da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1348*16410115SJohan Hovold u16 value; 1349*16410115SJohan Hovold u16 index; 1350*16410115SJohan Hovold u32 index_value; 135195da310eSAlan Cox int rv; 135295da310eSAlan Cox 1353*16410115SJohan Hovold index_value = get_ftdi_divisor(tty, port); 1354*16410115SJohan Hovold value = (u16)index_value; 1355*16410115SJohan Hovold index = (u16)(index_value >> 16); 13560ee404ccSUwe Bonnes if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || 13570ee404ccSUwe Bonnes (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { 13580ee404ccSUwe Bonnes /* Probably the BM type needs the MSB of the encoded fractional 13590ee404ccSUwe Bonnes * divider also moved like for the chips above. Any infos? */ 1360*16410115SJohan Hovold index = (u16)((index << 8) | priv->interface); 136195da310eSAlan Cox } 136295da310eSAlan Cox 136395da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 136495da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 136595da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 136695da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 1367*16410115SJohan Hovold value, index, 136866e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 136995da310eSAlan Cox return rv; 137095da310eSAlan Cox } 137195da310eSAlan Cox 1372557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1373557aaa7fSAlan Cox { 1374557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1375557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1376c1284d77SJohan Hovold int rv; 1377557aaa7fSAlan Cox int l = priv->latency; 137895da310eSAlan Cox 13792dea7cd7SIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 13802dea7cd7SIan Abbott return -EINVAL; 13812dea7cd7SIan Abbott 1382557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1383557aaa7fSAlan Cox l = 1; 1384557aaa7fSAlan Cox 1385bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); 1386557aaa7fSAlan Cox 1387557aaa7fSAlan Cox rv = usb_control_msg(udev, 1388557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1389557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1390557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1391557aaa7fSAlan Cox l, priv->interface, 139266e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1393557aaa7fSAlan Cox if (rv < 0) 1394557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1395557aaa7fSAlan Cox return rv; 1396557aaa7fSAlan Cox } 1397557aaa7fSAlan Cox 13987e1e6cedSIan Abbott static int _read_latency_timer(struct usb_serial_port *port) 1399557aaa7fSAlan Cox { 1400557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1401557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 140254f328d0SJohan Hovold unsigned char *buf; 1403c1284d77SJohan Hovold int rv; 1404557aaa7fSAlan Cox 140554f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 140654f328d0SJohan Hovold if (!buf) 140754f328d0SJohan Hovold return -ENOMEM; 140854f328d0SJohan Hovold 1409557aaa7fSAlan Cox rv = usb_control_msg(udev, 1410557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1411557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1412557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1413557aaa7fSAlan Cox 0, priv->interface, 141454f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 1415e3e574adSJohan Hovold if (rv < 1) { 1416e3e574adSJohan Hovold if (rv >= 0) 1417e3e574adSJohan Hovold rv = -EIO; 1418e3e574adSJohan Hovold } else { 14197e1e6cedSIan Abbott rv = buf[0]; 1420e3e574adSJohan Hovold } 142154f328d0SJohan Hovold 142254f328d0SJohan Hovold kfree(buf); 142354f328d0SJohan Hovold 14248c4f99cdSJohan Hovold return rv; 1425557aaa7fSAlan Cox } 14261da177e4SLinus Torvalds 14277e1e6cedSIan Abbott static int read_latency_timer(struct usb_serial_port *port) 14287e1e6cedSIan Abbott { 14297e1e6cedSIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 14307e1e6cedSIan Abbott int rv; 14317e1e6cedSIan Abbott 14327e1e6cedSIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14337e1e6cedSIan Abbott return -EINVAL; 14347e1e6cedSIan Abbott 14357e1e6cedSIan Abbott rv = _read_latency_timer(port); 14367e1e6cedSIan Abbott if (rv < 0) { 14377e1e6cedSIan Abbott dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 14387e1e6cedSIan Abbott return rv; 14397e1e6cedSIan Abbott } 14407e1e6cedSIan Abbott 14417e1e6cedSIan Abbott priv->latency = rv; 14427e1e6cedSIan Abbott 14437e1e6cedSIan Abbott return 0; 14447e1e6cedSIan Abbott } 14457e1e6cedSIan Abbott 1446464cbb24SAlan Cox static int get_serial_info(struct usb_serial_port *port, 1447464cbb24SAlan Cox struct serial_struct __user *retinfo) 14481da177e4SLinus Torvalds { 14491da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14501da177e4SLinus Torvalds struct serial_struct tmp; 14511da177e4SLinus Torvalds 14521da177e4SLinus Torvalds memset(&tmp, 0, sizeof(tmp)); 14531da177e4SLinus Torvalds tmp.flags = priv->flags; 14541da177e4SLinus Torvalds tmp.baud_base = priv->baud_base; 14551da177e4SLinus Torvalds tmp.custom_divisor = priv->custom_divisor; 14561da177e4SLinus Torvalds if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 14571da177e4SLinus Torvalds return -EFAULT; 14581da177e4SLinus Torvalds return 0; 1459e49bbce1SJohan Hovold } 14601da177e4SLinus Torvalds 146195da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 146295da310eSAlan Cox struct usb_serial_port *port, struct serial_struct __user *newinfo) 1463e49bbce1SJohan Hovold { 14641da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14651da177e4SLinus Torvalds struct serial_struct new_serial; 14661da177e4SLinus Torvalds struct ftdi_private old_priv; 14671da177e4SLinus Torvalds 14681da177e4SLinus Torvalds if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) 14691da177e4SLinus Torvalds return -EFAULT; 14706b447f04SAlan Cox 1471bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 14721da177e4SLinus Torvalds old_priv = *priv; 14731da177e4SLinus Torvalds 14741da177e4SLinus Torvalds /* Do error checking and permission checking */ 14751da177e4SLinus Torvalds 14761da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 1477f3e8ae65SJohan Hovold if ((new_serial.flags ^ priv->flags) & ~ASYNC_USR_MASK) { 1478bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 14791da177e4SLinus Torvalds return -EPERM; 148064905b48SDan Carpenter } 14811da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 14821da177e4SLinus Torvalds (new_serial.flags & ASYNC_USR_MASK)); 14831da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 14841da177e4SLinus Torvalds goto check_and_exit; 14851da177e4SLinus Torvalds } 14861da177e4SLinus Torvalds 1487eb833a9eSJohan Hovold if (new_serial.baud_base != priv->baud_base) { 1488bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 14891da177e4SLinus Torvalds return -EINVAL; 14906b447f04SAlan Cox } 14911da177e4SLinus Torvalds 14921da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 14931da177e4SLinus Torvalds 14941da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 14951da177e4SLinus Torvalds (new_serial.flags & ASYNC_FLAGS)); 14961da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 14971da177e4SLinus Torvalds 1498bb246681SAnthony Mallet check_and_exit: 1499557aaa7fSAlan Cox write_latency_timer(port); 15001da177e4SLinus Torvalds 1501f3e8ae65SJohan Hovold if ((priv->flags ^ old_priv.flags) & ASYNC_SPD_MASK || 1502f3e8ae65SJohan Hovold ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && 1503f3e8ae65SJohan Hovold priv->custom_divisor != old_priv.custom_divisor)) { 150483c9a2d1SJohan Hovold 150583c9a2d1SJohan Hovold /* warn about deprecation unless clearing */ 150683c9a2d1SJohan Hovold if (priv->flags & ASYNC_SPD_MASK) 150783c9a2d1SJohan Hovold dev_warn_ratelimited(&port->dev, "use of SPD flags is deprecated\n"); 150883c9a2d1SJohan Hovold 150995da310eSAlan Cox change_speed(tty, port); 15109c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15111da177e4SLinus Torvalds } 15126b447f04SAlan Cox else 1513bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 151495da310eSAlan Cox return 0; 1515e49bbce1SJohan Hovold } 15161da177e4SLinus Torvalds 1517c466cd2bSGreg Kroah-Hartman static int get_lsr_info(struct usb_serial_port *port, 151859556608SJohan Hovold unsigned int __user *retinfo) 1519c466cd2bSGreg Kroah-Hartman { 1520c466cd2bSGreg Kroah-Hartman struct ftdi_private *priv = usb_get_serial_port_data(port); 1521c466cd2bSGreg Kroah-Hartman unsigned int result = 0; 1522c466cd2bSGreg Kroah-Hartman 1523c466cd2bSGreg Kroah-Hartman if (priv->transmit_empty) 1524c466cd2bSGreg Kroah-Hartman result = TIOCSER_TEMT; 1525c466cd2bSGreg Kroah-Hartman 1526c466cd2bSGreg Kroah-Hartman if (copy_to_user(retinfo, &result, sizeof(unsigned int))) 1527c466cd2bSGreg Kroah-Hartman return -EFAULT; 1528c466cd2bSGreg Kroah-Hartman return 0; 1529c466cd2bSGreg Kroah-Hartman } 1530c466cd2bSGreg Kroah-Hartman 15311da177e4SLinus Torvalds 15328f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 15338f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 15348f977e42SIan Abbott { 15358f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 15368f977e42SIan Abbott struct usb_serial *serial = port->serial; 15378f977e42SIan Abbott struct usb_device *udev = serial->dev; 15388f977e42SIan Abbott unsigned version; 15398f977e42SIan Abbott unsigned interfaces; 15408f977e42SIan Abbott 15418f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1542f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 15438f977e42SIan Abbott 15448f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 15458f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1546bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, 15478f977e42SIan Abbott version, interfaces); 15488f977e42SIan Abbott if (interfaces > 1) { 15498f977e42SIan Abbott int inter; 15508f977e42SIan Abbott 1551094c2e6dSMark Adamson /* Multiple interfaces.*/ 1552094c2e6dSMark Adamson if (version == 0x0800) { 1553094c2e6dSMark Adamson priv->chip_type = FT4232H; 1554094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1555094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1556094c2e6dSMark Adamson } else if (version == 0x0700) { 1557094c2e6dSMark Adamson priv->chip_type = FT2232H; 1558094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1559094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1560094c2e6dSMark Adamson } else 15618f977e42SIan Abbott priv->chip_type = FT2232C; 1562094c2e6dSMark Adamson 15638f977e42SIan Abbott /* Determine interface code. */ 15648f977e42SIan Abbott inter = serial->interface->altsetting->desc.bInterfaceNumber; 1565094c2e6dSMark Adamson if (inter == 0) { 1566094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1567094c2e6dSMark Adamson } else if (inter == 1) { 1568094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1569094c2e6dSMark Adamson } else if (inter == 2) { 1570094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1571094c2e6dSMark Adamson } else if (inter == 3) { 1572094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1573094c2e6dSMark Adamson } 15748f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 15758f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 15768f977e42SIan Abbott if (version < 0x500) { 1577bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, 1578bfc51614SGreg Kroah-Hartman "%s: something fishy - bcdDevice too low for multi-interface device\n", 1579441b62c1SHarvey Harrison __func__); 15808f977e42SIan Abbott } 15818f977e42SIan Abbott } else if (version < 0x200) { 1582330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 15838f977e42SIan Abbott priv->chip_type = SIO; 15848f977e42SIan Abbott priv->baud_base = 12000000 / 16; 15858f977e42SIan Abbott } else if (version < 0x400) { 1586330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 15878f977e42SIan Abbott priv->chip_type = FT8U232AM; 15887e1e6cedSIan Abbott /* 15897e1e6cedSIan Abbott * It might be a BM type because of the iSerialNumber bug. 15907e1e6cedSIan Abbott * If iSerialNumber==0 and the latency timer is readable, 15917e1e6cedSIan Abbott * assume it is BM type. 15927e1e6cedSIan Abbott */ 15937e1e6cedSIan Abbott if (udev->descriptor.iSerialNumber == 0 && 15947e1e6cedSIan Abbott _read_latency_timer(port) >= 0) { 15957e1e6cedSIan Abbott dev_dbg(&port->dev, 15967e1e6cedSIan Abbott "%s: has latency timer so not an AM type\n", 15977e1e6cedSIan Abbott __func__); 15987e1e6cedSIan Abbott priv->chip_type = FT232BM; 15997e1e6cedSIan Abbott } 16003b009c63SDavid Brownell } else if (version < 0x600) { 1601330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 16028f977e42SIan Abbott priv->chip_type = FT232BM; 1603309427b6SUwe Bonnes } else if (version < 0x900) { 1604309427b6SUwe Bonnes /* Assume it's an FT232RL */ 16053b009c63SDavid Brownell priv->chip_type = FT232RL; 1606dc0827c1SJim Paris } else if (version < 0x1000) { 1607309427b6SUwe Bonnes /* Assume it's an FT232H */ 1608309427b6SUwe Bonnes priv->chip_type = FT232H; 1609dc0827c1SJim Paris } else { 1610dc0827c1SJim Paris /* Assume it's an FT-X series device */ 1611dc0827c1SJim Paris priv->chip_type = FTX; 16128f977e42SIan Abbott } 1613dc0827c1SJim Paris 1614c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 16158f977e42SIan Abbott } 16168f977e42SIan Abbott 16178f977e42SIan Abbott 161847e57595SJohan Hovold /* 161947e57595SJohan Hovold * Determine the maximum packet size for the device. This depends on the chip 1620895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 162147e57595SJohan Hovold * device descriptor as the chip will use the appropriate values for the host. 162247e57595SJohan Hovold */ 1623895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1624895f28baSMark Adamson { 1625895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 162647e57595SJohan Hovold struct usb_interface *interface = port->serial->interface; 1627aea1ae87SJohan Hovold struct usb_endpoint_descriptor *ep_desc; 1628895f28baSMark Adamson unsigned num_endpoints; 1629aea1ae87SJohan Hovold unsigned i; 1630895f28baSMark Adamson 1631895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1632aea1ae87SJohan Hovold if (!num_endpoints) 1633aea1ae87SJohan Hovold return; 1634aea1ae87SJohan Hovold 163547e57595SJohan Hovold /* 163647e57595SJohan Hovold * NOTE: Some customers have programmed FT232R/FT245R devices 1637895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1638895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 163947e57595SJohan Hovold * value of 64 for wMaxPacketSize. 164047e57595SJohan Hovold */ 1641895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1642895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 164347e57595SJohan Hovold if (!ep_desc->wMaxPacketSize) { 1644895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1645a90d84adSJohan Hovold dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n", 1646a90d84adSJohan Hovold usb_endpoint_num(ep_desc)); 1647895f28baSMark Adamson } 1648895f28baSMark Adamson } 1649895f28baSMark Adamson 165047e57595SJohan Hovold /* Set max packet size based on last descriptor. */ 165129cc8897SKuninori Morimoto priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1652895f28baSMark Adamson } 1653895f28baSMark Adamson 1654895f28baSMark Adamson 16551da177e4SLinus Torvalds /* 16561da177e4SLinus Torvalds * *************************************************************************** 16571da177e4SLinus Torvalds * Sysfs Attribute 16581da177e4SLinus Torvalds * *************************************************************************** 16591da177e4SLinus Torvalds */ 16601da177e4SLinus Torvalds 1661154547c4SGreg Kroah-Hartman static ssize_t latency_timer_show(struct device *dev, 1662464cbb24SAlan Cox struct device_attribute *attr, char *buf) 16631da177e4SLinus Torvalds { 16641da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16651da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1666557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1667557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1668557aaa7fSAlan Cox else 1669557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 16701da177e4SLinus Torvalds } 1671557aaa7fSAlan Cox 16721da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1673154547c4SGreg Kroah-Hartman static ssize_t latency_timer_store(struct device *dev, 1674154547c4SGreg Kroah-Hartman struct device_attribute *attr, 1675154547c4SGreg Kroah-Hartman const char *valbuf, size_t count) 16761da177e4SLinus Torvalds { 16771da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16781da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1679db924066SIan Abbott u8 v; 1680c1284d77SJohan Hovold int rv; 16811da177e4SLinus Torvalds 1682db924066SIan Abbott if (kstrtou8(valbuf, 10, &v)) 1683db924066SIan Abbott return -EINVAL; 1684db924066SIan Abbott 1685557aaa7fSAlan Cox priv->latency = v; 1686557aaa7fSAlan Cox rv = write_latency_timer(port); 1687557aaa7fSAlan Cox if (rv < 0) 16881da177e4SLinus Torvalds return -EIO; 16891da177e4SLinus Torvalds return count; 16901da177e4SLinus Torvalds } 1691154547c4SGreg Kroah-Hartman static DEVICE_ATTR_RW(latency_timer); 16921da177e4SLinus Torvalds 16931da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 16941da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1695ca35910aSGreg Kroah-Hartman static ssize_t event_char_store(struct device *dev, 1696464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 16971da177e4SLinus Torvalds { 16981da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16991da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 170012bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 1701d0559a2fSIan Abbott unsigned int v; 1702c1284d77SJohan Hovold int rv; 17031da177e4SLinus Torvalds 1704f1ce25f2SIan Abbott if (kstrtouint(valbuf, 0, &v) || v >= 0x200) 1705d0559a2fSIan Abbott return -EINVAL; 1706d0559a2fSIan Abbott 1707f1ce25f2SIan Abbott dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v); 17081da177e4SLinus Torvalds 17091da177e4SLinus Torvalds rv = usb_control_msg(udev, 17101da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 17111da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 17121da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 17131da177e4SLinus Torvalds v, priv->interface, 171466e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 17151da177e4SLinus Torvalds if (rv < 0) { 1716bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); 17171da177e4SLinus Torvalds return -EIO; 17181da177e4SLinus Torvalds } 17191da177e4SLinus Torvalds 17201da177e4SLinus Torvalds return count; 17211da177e4SLinus Torvalds } 1722ca35910aSGreg Kroah-Hartman static DEVICE_ATTR_WO(event_char); 17231da177e4SLinus Torvalds 172412bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 17251da177e4SLinus Torvalds { 172612bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 172713f4db9eSGreg Kroah-Hartman int retval = 0; 17281da177e4SLinus Torvalds 17291da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 17301da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 17311da177e4SLinus Torvalds if (priv->chip_type != SIO) { 1732bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 173312bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 173413f4db9eSGreg Kroah-Hartman if ((!retval) && 173597cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 173697cd49ebSStepan Moskovchenko priv->chip_type == FT2232C || 1737094c2e6dSMark Adamson priv->chip_type == FT232RL || 1738094c2e6dSMark Adamson priv->chip_type == FT2232H || 1739309427b6SUwe Bonnes priv->chip_type == FT4232H || 1740dc0827c1SJim Paris priv->chip_type == FT232H || 1741dc0827c1SJim Paris priv->chip_type == FTX)) { 174212bdbe03SJim Radford retval = device_create_file(&port->dev, 174313f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 17441da177e4SLinus Torvalds } 17451da177e4SLinus Torvalds } 174613f4db9eSGreg Kroah-Hartman return retval; 17471da177e4SLinus Torvalds } 17481da177e4SLinus Torvalds 174912bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 17501da177e4SLinus Torvalds { 175112bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 17521da177e4SLinus Torvalds 17531da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 17541da177e4SLinus Torvalds if (priv->chip_type != SIO) { 175512bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1756ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1757ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1758094c2e6dSMark Adamson priv->chip_type == FT232RL || 1759094c2e6dSMark Adamson priv->chip_type == FT2232H || 1760309427b6SUwe Bonnes priv->chip_type == FT4232H || 1761dc0827c1SJim Paris priv->chip_type == FT232H || 1762dc0827c1SJim Paris priv->chip_type == FTX) { 176312bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 17641da177e4SLinus Torvalds } 17651da177e4SLinus Torvalds } 17661da177e4SLinus Torvalds 17671da177e4SLinus Torvalds } 17681da177e4SLinus Torvalds 17691da177e4SLinus Torvalds /* 17701da177e4SLinus Torvalds * *************************************************************************** 17711da177e4SLinus Torvalds * FTDI driver specific functions 17721da177e4SLinus Torvalds * *************************************************************************** 17731da177e4SLinus Torvalds */ 17741da177e4SLinus Torvalds 17758f977e42SIan Abbott /* Probe function to check for special devices */ 1776464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1777464cbb24SAlan Cox const struct usb_device_id *id) 17788f977e42SIan Abbott { 17793c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = 1780464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 1781fa91d43bSTony Lindgren 1782fa91d43bSTony Lindgren if (quirk && quirk->probe) { 1783fa91d43bSTony Lindgren int ret = quirk->probe(serial); 1784fa91d43bSTony Lindgren if (ret != 0) 1785fa91d43bSTony Lindgren return ret; 1786fa91d43bSTony Lindgren } 1787fa91d43bSTony Lindgren 17888f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 17898f977e42SIan Abbott 1790fa91d43bSTony Lindgren return 0; 17918f977e42SIan Abbott } 17928f977e42SIan Abbott 179312bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 17941da177e4SLinus Torvalds { 17951da177e4SLinus Torvalds struct ftdi_private *priv; 17963c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 17970ffbbe25SOliver Neukum 17981da177e4SLinus Torvalds 179980b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 180010c642d0SJohan Hovold if (!priv) 18011da177e4SLinus Torvalds return -ENOMEM; 18021da177e4SLinus Torvalds 1803bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 18040076b4beSJohan Hovold 18050ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 18060ffbbe25SOliver Neukum quirk->port_probe(priv); 18070ffbbe25SOliver Neukum 180812bdbe03SJim Radford usb_set_serial_port_data(port, priv); 18091da177e4SLinus Torvalds 181012bdbe03SJim Radford ftdi_determine_type(port); 1811895f28baSMark Adamson ftdi_set_max_packet_size(port); 18128c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 18138c4f99cdSJohan Hovold priv->latency = 16; 1814c19db4c9SJohan Hovold write_latency_timer(port); 181512bdbe03SJim Radford create_sysfs_attrs(port); 181612bdbe03SJim Radford return 0; 18171da177e4SLinus Torvalds } 18181da177e4SLinus Torvalds 18198f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 18208f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 18211da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 18220ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 18231da177e4SLinus Torvalds { 18241da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 18251da177e4SLinus Torvalds priv->custom_divisor = 77; 1826669a6db1SAlan Cox priv->force_baud = 38400; 1827e49bbce1SJohan Hovold } 18281da177e4SLinus Torvalds 18298f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 18308f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 1831464cbb24SAlan Cox 18320ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 18338f977e42SIan Abbott { 18341da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 18351da177e4SLinus Torvalds priv->custom_divisor = 240; 1836669a6db1SAlan Cox priv->force_baud = 38400; 18371da177e4SLinus Torvalds priv->force_rtscts = 1; 1838e49bbce1SJohan Hovold } 18391da177e4SLinus Torvalds 1840fa91d43bSTony Lindgren /* 1841b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 1842970e2486SLucas De Marchi * If this value is not set in /etc/modprobe.d/ its value will be set 1843970e2486SLucas De Marchi * to 1ms. 1844b760dac2SMartin Geleynse */ 1845b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 1846b760dac2SMartin Geleynse 1847b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 1848b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 1849b760dac2SMartin Geleynse * 1850b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 1851b760dac2SMartin Geleynse */ 1852b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 1853b760dac2SMartin Geleynse { 1854b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 1855b760dac2SMartin Geleynse int latency = ndi_latency_timer; 1856b760dac2SMartin Geleynse 1857b760dac2SMartin Geleynse if (latency == 0) 1858b760dac2SMartin Geleynse latency = 1; 1859b760dac2SMartin Geleynse if (latency > 99) 1860b760dac2SMartin Geleynse latency = 99; 1861b760dac2SMartin Geleynse 1862bfc51614SGreg Kroah-Hartman dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); 1863bfc51614SGreg Kroah-Hartman dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); 1864b760dac2SMartin Geleynse 1865c1284d77SJohan Hovold /* FIXME: errors are not returned */ 1866c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 1867b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1868b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 186966e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 1870b760dac2SMartin Geleynse return 0; 1871b760dac2SMartin Geleynse } 1872b760dac2SMartin Geleynse 1873b760dac2SMartin Geleynse /* 187420734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 187520734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 187620734345SHarald Welte * userspace using openocd. 1877fa91d43bSTony Lindgren */ 187820734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 1879fa91d43bSTony Lindgren { 1880fa91d43bSTony Lindgren struct usb_device *udev = serial->dev; 1881fa91d43bSTony Lindgren struct usb_interface *interface = serial->interface; 1882fa91d43bSTony Lindgren 1883fa91d43bSTony Lindgren if (interface == udev->actconfig->interface[0]) { 1884c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, 1885c197a8dbSGreg Kroah-Hartman "Ignoring serial port reserved for JTAG\n"); 1886fa91d43bSTony Lindgren return -ENODEV; 1887fa91d43bSTony Lindgren } 1888fa91d43bSTony Lindgren 1889fa91d43bSTony Lindgren return 0; 1890fa91d43bSTony Lindgren } 18911da177e4SLinus Torvalds 1892c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial) 1893c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { 1894c96fbdd0SJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 1895c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1896b229a0f8SDoug Goldstein if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) 1897b229a0f8SDoug Goldstein return ftdi_jtag_probe(serial); 1898b229a0f8SDoug Goldstein 1899b229a0f8SDoug Goldstein if (udev->product && 1900470b5d6fSVasyl Vavrychuk (!strcmp(udev->product, "Arrow USB Blaster") || 1901470b5d6fSVasyl Vavrychuk !strcmp(udev->product, "BeagleBone/XDS100V2") || 1902b229a0f8SDoug Goldstein !strcmp(udev->product, "SNAP Connect E10"))) 1903c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return ftdi_jtag_probe(serial); 1904c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1905c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return 0; 1906c96fbdd0SJean-Christophe PLAGNIOL-VILLARD } 1907c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1908546d7eecSKevin Vance /* 190971d9a2b9SAdrian Thomasset * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's 191071d9a2b9SAdrian Thomasset * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and 191171d9a2b9SAdrian Thomasset * can be accessed from userspace. 191271d9a2b9SAdrian Thomasset * The next two ports are enabled as UARTs by default, where port 2 is 191371d9a2b9SAdrian Thomasset * a conventional RS-232 UART. 19146ec2f46cSJean-Christophe PLAGNIOL-VILLARD */ 19156ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial) 19166ec2f46cSJean-Christophe PLAGNIOL-VILLARD { 19176ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 19186ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_interface *interface = serial->interface; 19196ec2f46cSJean-Christophe PLAGNIOL-VILLARD 192071d9a2b9SAdrian Thomasset if (interface == udev->actconfig->interface[0] || 192171d9a2b9SAdrian Thomasset interface == udev->actconfig->interface[1]) { 19226ec2f46cSJean-Christophe PLAGNIOL-VILLARD dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); 19236ec2f46cSJean-Christophe PLAGNIOL-VILLARD return -ENODEV; 19246ec2f46cSJean-Christophe PLAGNIOL-VILLARD } 19256ec2f46cSJean-Christophe PLAGNIOL-VILLARD 192671d9a2b9SAdrian Thomasset return 0; 192771d9a2b9SAdrian Thomasset } 192871d9a2b9SAdrian Thomasset 192912bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 193012bdbe03SJim Radford { 19311da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 19321da177e4SLinus Torvalds 193312bdbe03SJim Radford remove_sysfs_attrs(port); 19341da177e4SLinus Torvalds 19354cba98ffSJohan Hovold kfree(priv); 19361da177e4SLinus Torvalds 193712bdbe03SJim Radford return 0; 193812bdbe03SJim Radford } 19391da177e4SLinus Torvalds 1940a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 1941e49bbce1SJohan Hovold { 19421da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 19431da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 19441da177e4SLinus Torvalds 19451da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 19461da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 19471da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 19481da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 19491da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 195066e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 19511da177e4SLinus Torvalds 19521da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 1953c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 19541da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 19551da177e4SLinus Torvalds 19561da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 1957be0278ccSJohan Hovold if (tty) 1958be0278ccSJohan Hovold ftdi_set_termios(tty, port, NULL); 19591da177e4SLinus Torvalds 19604cba98ffSJohan Hovold return usb_serial_generic_open(tty, port); 1961e49bbce1SJohan Hovold } 19621da177e4SLinus Torvalds 1963335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 1964335f8514SAlan Cox { 1965335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1966335f8514SAlan Cox 1967335f8514SAlan Cox /* Disable flow control */ 1968b2ca6990SJohan Hovold if (!on) { 1969b2ca6990SJohan Hovold if (usb_control_msg(port->serial->dev, 1970335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 1971335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 1972335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 197366e47e60SJohan Hovold 0, priv->interface, NULL, 0, 1974335f8514SAlan Cox WDR_TIMEOUT) < 0) { 1975335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 1976335f8514SAlan Cox } 1977b2ca6990SJohan Hovold } 1978335f8514SAlan Cox /* drop RTS and DTR */ 1979335f8514SAlan Cox if (on) 1980335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1981335f8514SAlan Cox else 1982335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1983335f8514SAlan Cox } 19841da177e4SLinus Torvalds 19851da177e4SLinus Torvalds /* The SIO requires the first byte to have: 19861da177e4SLinus Torvalds * B0 1 19871da177e4SLinus Torvalds * B1 0 19881da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 19891da177e4SLinus Torvalds * 19901da177e4SLinus Torvalds * The new devices do not require this byte 19911da177e4SLinus Torvalds */ 1992d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1993c23e5fc1SJohan Hovold void *dest, size_t size) 1994e49bbce1SJohan Hovold { 1995d3901a06SJohan Hovold struct ftdi_private *priv; 1996c23e5fc1SJohan Hovold int count; 1997c23e5fc1SJohan Hovold unsigned long flags; 19981da177e4SLinus Torvalds 1999d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 20001da177e4SLinus Torvalds 2001e8770484SJohan Hovold if (priv->chip_type == SIO) { 2002c23e5fc1SJohan Hovold unsigned char *buffer = dest; 2003c23e5fc1SJohan Hovold int i, len, c; 20041da177e4SLinus Torvalds 2005c23e5fc1SJohan Hovold count = 0; 2006c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 2007c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 2008c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 2009c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 2010c23e5fc1SJohan Hovold if (!c) 2011c23e5fc1SJohan Hovold break; 2012cb1676a6SJohan Hovold port->icount.tx += c; 2013c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 2014c23e5fc1SJohan Hovold count += c + 1; 20151da177e4SLinus Torvalds } 2016c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 20171da177e4SLinus Torvalds } else { 2018c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 2019c23e5fc1SJohan Hovold &port->lock); 2020cb1676a6SJohan Hovold port->icount.tx += count; 20211da177e4SLinus Torvalds } 20221da177e4SLinus Torvalds 20231da177e4SLinus Torvalds return count; 202495da310eSAlan Cox } 20251da177e4SLinus Torvalds 2026166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 2027166ceb69SJohan Hovold 202892a19f9cSJiri Slaby static int ftdi_process_packet(struct usb_serial_port *port, 202992a19f9cSJiri Slaby struct ftdi_private *priv, char *packet, int len) 203095da310eSAlan Cox { 20311da177e4SLinus Torvalds int i; 2032cc01f17dSJohan Hovold char status; 2033cc01f17dSJohan Hovold char flag; 2034cc01f17dSJohan Hovold char *ch; 20351da177e4SLinus Torvalds 2036cc01f17dSJohan Hovold if (len < 2) { 2037bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "malformed packet\n"); 2038cc01f17dSJohan Hovold return 0; 20391da177e4SLinus Torvalds } 20401da177e4SLinus Torvalds 2041464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 2042464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 2043464cbb24SAlan Cox are only processed once. */ 2044cc01f17dSJohan Hovold status = packet[0] & FTDI_STATUS_B0_MASK; 2045cc01f17dSJohan Hovold if (status != priv->prev_status) { 2046fca5430dSSimon Arlott char diff_status = status ^ priv->prev_status; 2047fca5430dSSimon Arlott 2048fca5430dSSimon Arlott if (diff_status & FTDI_RS0_CTS) 2049cb1676a6SJohan Hovold port->icount.cts++; 2050fca5430dSSimon Arlott if (diff_status & FTDI_RS0_DSR) 2051cb1676a6SJohan Hovold port->icount.dsr++; 2052fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RI) 2053cb1676a6SJohan Hovold port->icount.rng++; 2054d14654dfSPaul Chavent if (diff_status & FTDI_RS0_RLSD) { 2055d14654dfSPaul Chavent struct tty_struct *tty; 2056d14654dfSPaul Chavent 2057cb1676a6SJohan Hovold port->icount.dcd++; 2058d14654dfSPaul Chavent tty = tty_port_tty_get(&port->port); 2059d14654dfSPaul Chavent if (tty) 2060d14654dfSPaul Chavent usb_serial_handle_dcd_change(port, tty, 2061d14654dfSPaul Chavent status & FTDI_RS0_RLSD); 2062d14654dfSPaul Chavent tty_kref_put(tty); 2063d14654dfSPaul Chavent } 2064fca5430dSSimon Arlott 2065f307e5cdSJohan Hovold wake_up_interruptible(&port->port.delta_msr_wait); 2066cc01f17dSJohan Hovold priv->prev_status = status; 20671da177e4SLinus Torvalds } 20681da177e4SLinus Torvalds 2069a6bb1e17SJohan Hovold /* save if the transmitter is empty or not */ 2070a6bb1e17SJohan Hovold if (packet[1] & FTDI_RS_TEMT) 2071a6bb1e17SJohan Hovold priv->transmit_empty = 1; 2072a6bb1e17SJohan Hovold else 2073a6bb1e17SJohan Hovold priv->transmit_empty = 0; 2074a6bb1e17SJohan Hovold 2075a6bb1e17SJohan Hovold len -= 2; 2076a6bb1e17SJohan Hovold if (!len) 2077a6bb1e17SJohan Hovold return 0; /* status only */ 2078a6bb1e17SJohan Hovold 2079a6bb1e17SJohan Hovold /* 2080a6bb1e17SJohan Hovold * Break and error status must only be processed for packets with 2081a6bb1e17SJohan Hovold * data payload to avoid over-reporting. 2082a6bb1e17SJohan Hovold */ 2083cc01f17dSJohan Hovold flag = TTY_NORMAL; 2084166ceb69SJohan Hovold if (packet[1] & FTDI_RS_ERR_MASK) { 2085166ceb69SJohan Hovold /* Break takes precedence over parity, which takes precedence 2086166ceb69SJohan Hovold * over framing errors */ 2087cc01f17dSJohan Hovold if (packet[1] & FTDI_RS_BI) { 2088cc01f17dSJohan Hovold flag = TTY_BREAK; 2089cb1676a6SJohan Hovold port->icount.brk++; 209072fda3caSJason Wessel usb_serial_handle_break(port); 2091166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_PE) { 2092cc01f17dSJohan Hovold flag = TTY_PARITY; 2093cb1676a6SJohan Hovold port->icount.parity++; 2094166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_FE) { 2095cc01f17dSJohan Hovold flag = TTY_FRAME; 2096cb1676a6SJohan Hovold port->icount.frame++; 2097166ceb69SJohan Hovold } 2098166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 2099005b3cdeSUwe Bonnes if (packet[1] & FTDI_RS_OE) { 2100cb1676a6SJohan Hovold port->icount.overrun++; 210192a19f9cSJiri Slaby tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 21021da177e4SLinus Torvalds } 2103005b3cdeSUwe Bonnes } 21041da177e4SLinus Torvalds 2105cb1676a6SJohan Hovold port->icount.rx += len; 2106cc01f17dSJohan Hovold ch = packet + 2; 2107cc01f17dSJohan Hovold 210849b2597aSJohan Hovold if (port->port.console && port->sysrq) { 2109cc01f17dSJohan Hovold for (i = 0; i < len; i++, ch++) { 21106ee9f4b4SDmitry Torokhov if (!usb_serial_handle_sysrq_char(port, *ch)) 211192a19f9cSJiri Slaby tty_insert_flip_char(&port->port, *ch, flag); 2112cc01f17dSJohan Hovold } 211349b2597aSJohan Hovold } else { 21142f693357SJiri Slaby tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len); 2115cc01f17dSJohan Hovold } 211649b2597aSJohan Hovold 2117cc01f17dSJohan Hovold return len; 2118cc01f17dSJohan Hovold } 2119cc01f17dSJohan Hovold 21201b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 2121cc01f17dSJohan Hovold { 21221b551015SJohan Hovold struct usb_serial_port *port = urb->context; 2123cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2124cc01f17dSJohan Hovold char *data = (char *)urb->transfer_buffer; 2125cc01f17dSJohan Hovold int i; 2126cc01f17dSJohan Hovold int len; 2127cc01f17dSJohan Hovold int count = 0; 2128cc01f17dSJohan Hovold 2129cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 2130cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 213192a19f9cSJiri Slaby count += ftdi_process_packet(port, priv, &data[i], len); 2132cc01f17dSJohan Hovold } 2133cc01f17dSJohan Hovold 2134cc01f17dSJohan Hovold if (count) 21352e124b4aSJiri Slaby tty_flip_buffer_push(&port->port); 2136cc01f17dSJohan Hovold } 21371da177e4SLinus Torvalds 213895da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 21391da177e4SLinus Torvalds { 214095da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 21411da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2142*16410115SJohan Hovold u16 value; 21431da177e4SLinus Torvalds 21441da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 21451da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 2146*16410115SJohan Hovold /* last_set_data_value NEVER has the break bit set in it */ 21471da177e4SLinus Torvalds 2148464cbb24SAlan Cox if (break_state) 2149*16410115SJohan Hovold value = priv->last_set_data_value | FTDI_SIO_SET_BREAK; 2150464cbb24SAlan Cox else 2151*16410115SJohan Hovold value = priv->last_set_data_value; 21521da177e4SLinus Torvalds 2153464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 2154464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 21551da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 21561da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 2157*16410115SJohan Hovold value , priv->interface, 215866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2159bfc51614SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", 2160bfc51614SGreg Kroah-Hartman __func__, break_state); 21611da177e4SLinus Torvalds } 21621da177e4SLinus Torvalds 2163bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, 2164*16410115SJohan Hovold break_state, value); 21651da177e4SLinus Torvalds 21661da177e4SLinus Torvalds } 21671da177e4SLinus Torvalds 2168a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port) 21696f602912SJarkko Huijts { 21705fb0432eSJohan Hovold unsigned char buf[2]; 21716f602912SJarkko Huijts int ret; 21726f602912SJarkko Huijts 2173c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 21745fb0432eSJohan Hovold if (ret == 2) { 21756f602912SJarkko Huijts if (!(buf[1] & FTDI_RS_TEMT)) 2176a37025b5SJohan Hovold return false; 21775fb0432eSJohan Hovold } 21786f602912SJarkko Huijts 2179a37025b5SJohan Hovold return true; 21806f602912SJarkko Huijts } 21816f602912SJarkko Huijts 21821da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 21831da177e4SLinus Torvalds * the new setting to be used 21841da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 21851da177e4SLinus Torvalds */ 218695da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 218795da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 2188e49bbce1SJohan Hovold { 21891da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 2190bfc51614SGreg Kroah-Hartman struct device *ddev = &port->dev; 21911da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2192adc8d746SAlan Cox struct ktermios *termios = &tty->termios; 2193669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 2194*16410115SJohan Hovold u16 value; 21951da177e4SLinus Torvalds 2196464cbb24SAlan Cox /* Added for xon/xoff support */ 2197669a6db1SAlan Cox unsigned int iflag = termios->c_iflag; 21981da177e4SLinus Torvalds unsigned char vstop; 21991da177e4SLinus Torvalds unsigned char vstart; 22001da177e4SLinus Torvalds 2201464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 2202464cbb24SAlan Cox B0. */ 2203669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 2204bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); 220595da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 2206bd5e47ccSAndrew Morton priv->force_baud); 22071da177e4SLinus Torvalds } 22081da177e4SLinus Torvalds 22091da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 22101da177e4SLinus Torvalds if (priv->force_rtscts) { 2211bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); 2212669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 22131da177e4SLinus Torvalds } 22141da177e4SLinus Torvalds 22158704211fSColin Leitner /* 2216c1f15196SColin Leitner * All FTDI UART chips are limited to CS7/8. We shouldn't pretend to 22178704211fSColin Leitner * support CS5/6 and revert the CSIZE setting instead. 2218c1f15196SColin Leitner * 2219c1f15196SColin Leitner * CS5 however is used to control some smartcard readers which abuse 2220c1f15196SColin Leitner * this limitation to switch modes. Original FTDI chips fall back to 2221c1f15196SColin Leitner * eight data bits. 2222c1f15196SColin Leitner * 2223c1f15196SColin Leitner * TODO: Implement a quirk to only allow this with mentioned 2224c1f15196SColin Leitner * readers. One I know of (Argolis Smartreader V1) 2225c1f15196SColin Leitner * returns "USB smartcard server" as iInterface string. 2226c1f15196SColin Leitner * The vendor didn't bother with a custom VID/PID of 2227c1f15196SColin Leitner * course. 22288704211fSColin Leitner */ 2229c1f15196SColin Leitner if (C_CSIZE(tty) == CS6) { 22308704211fSColin Leitner dev_warn(ddev, "requested CSIZE setting not supported\n"); 22318704211fSColin Leitner 22328704211fSColin Leitner termios->c_cflag &= ~CSIZE; 22338704211fSColin Leitner if (old_termios) 22348704211fSColin Leitner termios->c_cflag |= old_termios->c_cflag & CSIZE; 22358704211fSColin Leitner else 22368704211fSColin Leitner termios->c_cflag |= CS8; 22378704211fSColin Leitner } 22388704211fSColin Leitner 2239669a6db1SAlan Cox cflag = termios->c_cflag; 22401da177e4SLinus Torvalds 2241a816e311SYing Xue if (!old_termios) 2242c515598eSAndrew Worsley goto no_skip; 2243c515598eSAndrew Worsley 2244b1ffb4c8SAndrew Worsley if (old_termios->c_cflag == termios->c_cflag 2245b1ffb4c8SAndrew Worsley && old_termios->c_ispeed == termios->c_ispeed 2246b1ffb4c8SAndrew Worsley && old_termios->c_ospeed == termios->c_ospeed) 2247b1ffb4c8SAndrew Worsley goto no_c_cflag_changes; 2248b1ffb4c8SAndrew Worsley 22491da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 2250464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 2251464cbb24SAlan Cox don't see any problems yet */ 22521da177e4SLinus Torvalds 2253b1ffb4c8SAndrew Worsley if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) == 2254b1ffb4c8SAndrew Worsley (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) 2255b1ffb4c8SAndrew Worsley goto no_data_parity_stop_changes; 2256b1ffb4c8SAndrew Worsley 2257c515598eSAndrew Worsley no_skip: 22581da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 22591da177e4SLinus Torvalds 2260*16410115SJohan Hovold value = 0; 2261*16410115SJohan Hovold value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 22621da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 226338fcb830SRoland Koebler if (cflag & PARENB) { 226438fcb830SRoland Koebler if (cflag & CMSPAR) 2265*16410115SJohan Hovold value |= cflag & PARODD ? 226638fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 226738fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 226838fcb830SRoland Koebler else 2269*16410115SJohan Hovold value |= cflag & PARODD ? 227038fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 227138fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 227238fcb830SRoland Koebler } else { 2273*16410115SJohan Hovold value |= FTDI_SIO_SET_DATA_PARITY_NONE; 227438fcb830SRoland Koebler } 22751da177e4SLinus Torvalds switch (cflag & CSIZE) { 2276c1f15196SColin Leitner case CS5: 2277c1f15196SColin Leitner dev_dbg(ddev, "Setting CS5 quirk\n"); 2278c1f15196SColin Leitner break; 2279bfc51614SGreg Kroah-Hartman case CS7: 2280*16410115SJohan Hovold value |= 7; 2281bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS7\n"); 2282bfc51614SGreg Kroah-Hartman break; 22838704211fSColin Leitner default: 2284bfc51614SGreg Kroah-Hartman case CS8: 2285*16410115SJohan Hovold value |= 8; 2286bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS8\n"); 2287bfc51614SGreg Kroah-Hartman break; 22881da177e4SLinus Torvalds } 22891da177e4SLinus Torvalds 2290464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 2291464cbb24SAlan Cox - but is or'ed with this value */ 2292*16410115SJohan Hovold priv->last_set_data_value = value; 22931da177e4SLinus Torvalds 22941da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 22951da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 22961da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 2297*16410115SJohan Hovold value , priv->interface, 229866e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 2299bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", 2300bfc51614SGreg Kroah-Hartman __func__); 23011da177e4SLinus Torvalds } 23021da177e4SLinus Torvalds 23031da177e4SLinus Torvalds /* Now do the baudrate */ 2304b1ffb4c8SAndrew Worsley no_data_parity_stop_changes: 23051da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 23061da177e4SLinus Torvalds /* Disable flow control */ 23071da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 23081da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23091da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 23101da177e4SLinus Torvalds 0, priv->interface, 231166e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2312bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s error from disable flowcontrol urb\n", 2313194343d9SGreg Kroah-Hartman __func__); 23141da177e4SLinus Torvalds } 23151da177e4SLinus Torvalds /* Drop RTS and DTR */ 231674ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 23171da177e4SLinus Torvalds } else { 23181da177e4SLinus Torvalds /* set the baudrate determined before */ 23199c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 2320464cbb24SAlan Cox if (change_speed(tty, port)) 2321bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s urb failed to set baudrate\n", __func__); 23229c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 232372a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 23243177130fSJohan Hovold if (old_termios && (old_termios->c_cflag & CBAUD) == B0) 232574ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 23261da177e4SLinus Torvalds } 23271da177e4SLinus Torvalds 23281da177e4SLinus Torvalds /* Set flow control */ 23291da177e4SLinus Torvalds /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ 2330b1ffb4c8SAndrew Worsley no_c_cflag_changes: 23311da177e4SLinus Torvalds if (cflag & CRTSCTS) { 2332bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Setting to CRTSCTS flow control\n", __func__); 23331da177e4SLinus Torvalds if (usb_control_msg(dev, 23341da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 23351da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23361da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 23371da177e4SLinus Torvalds 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), 233866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2339bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to set to rts/cts flow control\n"); 23401da177e4SLinus Torvalds } 23411da177e4SLinus Torvalds } else { 23421da177e4SLinus Torvalds /* 23431da177e4SLinus Torvalds * Xon/Xoff code 23441da177e4SLinus Torvalds */ 23455ada9842SJohan Hovold if (iflag & IXON) { 2346bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s request to enable xonxoff iflag=%04x\n", 2347464cbb24SAlan Cox __func__, iflag); 2348464cbb24SAlan Cox /* Try to enable the XON/XOFF on the ftdi_sio 2349464cbb24SAlan Cox * Set the vstart and vstop -- could have been done up 2350464cbb24SAlan Cox * above where a lot of other dereferencing is done but 2351464cbb24SAlan Cox * that would be very inefficient as vstart and vstop 2352464cbb24SAlan Cox * are not always needed. 2353464cbb24SAlan Cox */ 2354669a6db1SAlan Cox vstart = termios->c_cc[VSTART]; 2355669a6db1SAlan Cox vstop = termios->c_cc[VSTOP]; 2356*16410115SJohan Hovold value = (vstop << 8) | (vstart); 23571da177e4SLinus Torvalds 23581da177e4SLinus Torvalds if (usb_control_msg(dev, 23591da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 23601da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23611da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 2362*16410115SJohan Hovold value , (FTDI_SIO_XON_XOFF_HS 23631da177e4SLinus Torvalds | priv->interface), 236466e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2365194343d9SGreg Kroah-Hartman dev_err(&port->dev, "urb failed to set to " 2366194343d9SGreg Kroah-Hartman "xon/xoff flow control\n"); 23671da177e4SLinus Torvalds } 23681da177e4SLinus Torvalds } else { 2369464cbb24SAlan Cox /* else clause to only run if cflag ! CRTSCTS and iflag 23705ada9842SJohan Hovold * ! XON. CHECKME Assuming XON/XOFF handled by tty 2371464cbb24SAlan Cox * stack - not by device */ 2372bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Turning off hardware flow control\n", __func__); 23731da177e4SLinus Torvalds if (usb_control_msg(dev, 23741da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 23751da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23761da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 23771da177e4SLinus Torvalds 0, priv->interface, 237866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2379bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to clear flow control\n"); 23801da177e4SLinus Torvalds } 23811da177e4SLinus Torvalds } 23821da177e4SLinus Torvalds } 238395da310eSAlan Cox } 23841da177e4SLinus Torvalds 2385a4afff6bSJohan Hovold /* 2386a4afff6bSJohan Hovold * Get modem-control status. 2387a4afff6bSJohan Hovold * 2388a4afff6bSJohan Hovold * Returns the number of status bytes retrieved (device dependant), or 2389a4afff6bSJohan Hovold * negative error code. 2390a4afff6bSJohan Hovold */ 2391c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 2392a4afff6bSJohan Hovold unsigned char status[2]) 23931da177e4SLinus Torvalds { 23941da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 239566e47e60SJohan Hovold unsigned char *buf; 2396a3f8168bSJohan Hovold int len; 23971da177e4SLinus Torvalds int ret; 23981da177e4SLinus Torvalds 239966e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 240066e47e60SJohan Hovold if (!buf) 240166e47e60SJohan Hovold return -ENOMEM; 2402a3f8168bSJohan Hovold /* 2403a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2404a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2405a3f8168bSJohan Hovold */ 24061da177e4SLinus Torvalds switch (priv->chip_type) { 24071da177e4SLinus Torvalds case SIO: 2408a3f8168bSJohan Hovold len = 1; 24091da177e4SLinus Torvalds break; 24101da177e4SLinus Torvalds case FT8U232AM: 24111da177e4SLinus Torvalds case FT232BM: 24121da177e4SLinus Torvalds case FT2232C: 2413ed6e5282SAndrew M. Bishop case FT232RL: 2414094c2e6dSMark Adamson case FT2232H: 2415094c2e6dSMark Adamson case FT4232H: 2416309427b6SUwe Bonnes case FT232H: 2417dc0827c1SJim Paris case FTX: 2418a3f8168bSJohan Hovold len = 2; 24191da177e4SLinus Torvalds break; 24201da177e4SLinus Torvalds default: 242166e47e60SJohan Hovold ret = -EFAULT; 242266e47e60SJohan Hovold goto out; 24231da177e4SLinus Torvalds } 24241da177e4SLinus Torvalds 2425a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2426a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2427a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2428a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2429a3f8168bSJohan Hovold 0, priv->interface, 2430a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 2431427c3a95SJohan Hovold 2432427c3a95SJohan Hovold /* NOTE: We allow short responses and handle that below. */ 2433427c3a95SJohan Hovold if (ret < 1) { 2434a4afff6bSJohan Hovold dev_err(&port->dev, "failed to get modem status: %d\n", ret); 2435427c3a95SJohan Hovold if (ret >= 0) 2436427c3a95SJohan Hovold ret = -EIO; 24372c2ee545SJohan Hovold ret = usb_translate_errors(ret); 2438a3f8168bSJohan Hovold goto out; 24392c2ee545SJohan Hovold } 2440a3f8168bSJohan Hovold 2441a4afff6bSJohan Hovold status[0] = buf[0]; 2442a4afff6bSJohan Hovold if (ret > 1) 2443a4afff6bSJohan Hovold status[1] = buf[1]; 2444a4afff6bSJohan Hovold else 2445a4afff6bSJohan Hovold status[1] = 0; 2446a4afff6bSJohan Hovold 2447a4afff6bSJohan Hovold dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0], 2448a4afff6bSJohan Hovold status[1]); 2449a4afff6bSJohan Hovold out: 2450a4afff6bSJohan Hovold kfree(buf); 2451a4afff6bSJohan Hovold 2452a4afff6bSJohan Hovold return ret; 2453a4afff6bSJohan Hovold } 2454a4afff6bSJohan Hovold 2455a4afff6bSJohan Hovold static int ftdi_tiocmget(struct tty_struct *tty) 2456a4afff6bSJohan Hovold { 2457a4afff6bSJohan Hovold struct usb_serial_port *port = tty->driver_data; 2458a4afff6bSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2459a4afff6bSJohan Hovold unsigned char buf[2]; 2460a4afff6bSJohan Hovold int ret; 2461a4afff6bSJohan Hovold 2462c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 2463a4afff6bSJohan Hovold if (ret < 0) 2464a4afff6bSJohan Hovold return ret; 2465a4afff6bSJohan Hovold 246666e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 24671da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 24681da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 24691da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 24701da177e4SLinus Torvalds priv->last_dtr_rts; 2471a4afff6bSJohan Hovold 247266e47e60SJohan Hovold return ret; 24731da177e4SLinus Torvalds } 24741da177e4SLinus Torvalds 247520b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 247695da310eSAlan Cox unsigned int set, unsigned int clear) 24771da177e4SLinus Torvalds { 247895da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2479a09aa7ddSGreg Kroah-Hartman 248074ede0ffSIan Abbott return update_mctrl(port, set, clear); 24811da177e4SLinus Torvalds } 24821da177e4SLinus Torvalds 248300a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 2484464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 24851da177e4SLinus Torvalds { 248695da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 248759556608SJohan Hovold void __user *argp = (void __user *)arg; 24881da177e4SLinus Torvalds 24891da177e4SLinus Torvalds switch (cmd) { 249059556608SJohan Hovold case TIOCGSERIAL: 249159556608SJohan Hovold return get_serial_info(port, argp); 249259556608SJohan Hovold case TIOCSSERIAL: 249359556608SJohan Hovold return set_serial_info(tty, port, argp); 2494c466cd2bSGreg Kroah-Hartman case TIOCSERGETLSR: 249559556608SJohan Hovold return get_lsr_info(port, argp); 24961da177e4SLinus Torvalds default: 24971da177e4SLinus Torvalds break; 24981da177e4SLinus Torvalds } 24994d5147ecSJohan Hovold 250095da310eSAlan Cox return -ENOIOCTLCMD; 250195da310eSAlan Cox } 25021da177e4SLinus Torvalds 2503e17c1aa2SJohan Hovold module_usb_serial_driver(serial_drivers, id_table_combined); 25041da177e4SLinus Torvalds 25051da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 25061da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 25071da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 25081da177e4SLinus Torvalds 2509b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2510b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2511