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 * 13ecefae6dSMauro Carvalho Chehab * See Documentation/usb/usb-serial.rst 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> 42ba93cc7dSKaroly Pados #include <linux/gpio/driver.h> 43a969888cSGreg Kroah-Hartman #include <linux/usb/serial.h> 441da177e4SLinus Torvalds #include "ftdi_sio.h" 4531844d55SAndreas Mohr #include "ftdi_sio_ids.h" 461da177e4SLinus Torvalds 47d3901a06SJohan 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>" 481da177e4SLinus Torvalds #define DRIVER_DESC "USB FTDI Serial Converters Driver" 491da177e4SLinus Torvalds 501da177e4SLinus Torvalds 510ffbbe25SOliver Neukum struct ftdi_private { 523bb36aa2SGreg Kroah-Hartman enum ftdi_chip_type chip_type; 53464cbb24SAlan Cox /* type of device, either SIO or FT8U232AM */ 540ffbbe25SOliver Neukum int baud_base; /* baud base clock for divisor setting */ 55464cbb24SAlan Cox int custom_divisor; /* custom_divisor kludge, this is for 56464cbb24SAlan Cox baud_base (different from what goes to the 57464cbb24SAlan Cox chip!) */ 5816410115SJohan Hovold u16 last_set_data_value; /* the last data state set - needed for doing 59464cbb24SAlan Cox * a break 60464cbb24SAlan Cox */ 610ffbbe25SOliver Neukum int flags; /* some ASYNC_xxxx flags are supported */ 620ffbbe25SOliver Neukum unsigned long last_dtr_rts; /* saved modem control outputs */ 63fca5430dSSimon Arlott char prev_status; /* Used for TIOCMIWAIT */ 64c466cd2bSGreg Kroah-Hartman char transmit_empty; /* If transmitter is empty or not */ 65fd54a99aSJohan Hovold u16 interface; /* FT2232C, FT2232H or FT4232H port interface 66094c2e6dSMark Adamson (0 for FT232/245) */ 670ffbbe25SOliver Neukum 68464cbb24SAlan Cox speed_t force_baud; /* if non-zero, force the baud rate to 69464cbb24SAlan Cox this value */ 70464cbb24SAlan Cox int force_rtscts; /* if non-zero, force RTS-CTS to always 71464cbb24SAlan Cox be enabled */ 720ffbbe25SOliver Neukum 73557aaa7fSAlan Cox unsigned int latency; /* latency setting in use */ 74895f28baSMark Adamson unsigned short max_packet_size; 759c67d28eSAlessio Igor Bogani struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ 76ba93cc7dSKaroly Pados #ifdef CONFIG_GPIOLIB 77ba93cc7dSKaroly Pados struct gpio_chip gc; 78ba93cc7dSKaroly Pados struct mutex gpio_lock; /* protects GPIO state */ 79ba93cc7dSKaroly Pados bool gpio_registered; /* is the gpiochip in kernel registered */ 80ba93cc7dSKaroly Pados bool gpio_used; /* true if the user requested a gpio */ 81ba93cc7dSKaroly Pados u8 gpio_altfunc; /* which pins are in gpio mode */ 82ba93cc7dSKaroly Pados u8 gpio_output; /* pin directions cache */ 83ba93cc7dSKaroly Pados u8 gpio_value; /* pin value for outputs */ 84ba93cc7dSKaroly Pados #endif 850ffbbe25SOliver Neukum }; 860ffbbe25SOliver Neukum 878f977e42SIan Abbott /* struct ftdi_sio_quirk is used by devices requiring special attention. */ 888f977e42SIan Abbott struct ftdi_sio_quirk { 89fa91d43bSTony Lindgren int (*probe)(struct usb_serial *); 90464cbb24SAlan Cox /* Special settings for probed ports. */ 91464cbb24SAlan Cox void (*port_probe)(struct ftdi_private *); 928f977e42SIan Abbott }; 938f977e42SIan Abbott 9420734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial); 95b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial); 966ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial); 97c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial); 980ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 990ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 1008f977e42SIan Abbott 1013c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_jtag_quirk = { 10220734345SHarald Welte .probe = ftdi_jtag_probe, 103fa91d43bSTony Lindgren }; 104fa91d43bSTony Lindgren 1053c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_NDI_device_quirk = { 106b760dac2SMartin Geleynse .probe = ftdi_NDI_device_setup, 107b760dac2SMartin Geleynse }; 108b760dac2SMartin Geleynse 1093c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 1100ffbbe25SOliver Neukum .port_probe = ftdi_USB_UIRT_setup, 1118f977e42SIan Abbott }; 1128f977e42SIan Abbott 1133c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { 1140ffbbe25SOliver Neukum .port_probe = ftdi_HE_TIRA1_setup, 1151da177e4SLinus Torvalds }; 1161da177e4SLinus Torvalds 1173c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_stmclite_quirk = { 1186ec2f46cSJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_stmclite_probe, 1196ec2f46cSJean-Christophe PLAGNIOL-VILLARD }; 1206ec2f46cSJean-Christophe PLAGNIOL-VILLARD 1213c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_8u2232c_quirk = { 122c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_8u2232c_probe, 123c96fbdd0SJean-Christophe PLAGNIOL-VILLARD }; 124c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1251da177e4SLinus Torvalds /* 1261da177e4SLinus Torvalds * The 8U232AM has the same API as the sio except for: 1271da177e4SLinus Torvalds * - it can support MUCH higher baudrates; up to: 1281da177e4SLinus Torvalds * o 921600 for RS232 and 2000000 for RS422/485 at 48MHz 1291da177e4SLinus Torvalds * o 230400 at 12MHz 1301da177e4SLinus Torvalds * so .. 8U232AM's baudrate setting codes are different 1311da177e4SLinus Torvalds * - it has a two byte status code. 1321da177e4SLinus Torvalds * - it returns characters every 16ms (the FTDI does it every 40ms) 1331da177e4SLinus Torvalds * 1341da177e4SLinus Torvalds * the bcdDevice value is used to differentiate FT232BM and FT245BM from 1351da177e4SLinus Torvalds * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 1361da177e4SLinus Torvalds * combinations in both tables. 1378f977e42SIan Abbott * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices, 1388f977e42SIan Abbott * but I don't know if those ever went into mass production. [Ian Abbott] 1391da177e4SLinus Torvalds */ 1401da177e4SLinus Torvalds 1411da177e4SLinus Torvalds 1421da177e4SLinus Torvalds 14365e1ec67SAndreas Mohr /* 144e17c1aa2SJohan Hovold * Device ID not listed? Test it using 145e17c1aa2SJohan Hovold * /sys/bus/usb-serial/drivers/ftdi_sio/new_id and send a patch or report. 14665e1ec67SAndreas Mohr */ 1475c6b98ddSJohan Hovold static const struct usb_device_id id_table_combined[] = { 1487f2719f0SPerry Hung { USB_DEVICE(FTDI_VID, FTDI_BRICK_PID) }, 149ce7e9065SArtur Zimmer { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, 1505a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) }, 1515a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) }, 1522011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 1532011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 15401ba0856SAndrew Ewert { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 1556552cc7fSJohan Hovold { USB_DEVICE(FTDI_VID, FTDI_BM_ATOM_NANO_PID) }, 15665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 15767847baeSBjørn Mork { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, 1586e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, 1596e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, 1606e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, 1616e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) }, 1626e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) }, 1636e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, 1646e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, 1656e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, 166b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, 167b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, 168b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, 16972a9f958SRazvan Gavril { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 1701da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 17169737dfaSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 172d099321bSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, 173fad14a0dSFrank Sievertsen { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, 1741da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 1751da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 1761da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 177d8b21606SGard Spreemann { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, 178c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) , 179c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, 180094c2e6dSMark Adamson { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 181309427b6SUwe Bonnes { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, 182dc0827c1SJim Paris { USB_DEVICE(FTDI_VID, FTDI_FTX_PID) }, 183c0f8d561SChristophe Mariac { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 1841da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 1852adb80e9SGuido Scholz { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, 186ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) }, 187ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 188ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 18999c1e4f8SRainer Keller { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, 19058f8b6c4SStefani Seibold { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, 191d7e14b37SMartin Teichmann { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, 19271381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_CC_PID) }, 19371381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) }, 1941da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 1951da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 196f2ee6955SAlan Cox { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 19776f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, 19876f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, 199ea233f80SGalen Seitz { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, 2001da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 2011da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, 2021da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, 2031da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_633_PID) }, 2041da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_631_PID) }, 2051da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_635_PID) }, 2061da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_640_PID) }, 2071da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_642_PID) }, 2081da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) }, 20974bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_0_PID) }, 21074bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_1_PID) }, 2111da177e4SLinus Torvalds { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) }, 2121da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) }, 2138f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_0_PID) }, 2148f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_1_PID) }, 2158f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_2_PID) }, 2168f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_3_PID) }, 2178f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 2188f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 2198f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 220b34efeeaSFolkert van Heusden { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, 2216fdbad80SJacques Viviers { USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) }, 222ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 223ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 224ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 225ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0103_PID) }, 226ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0104_PID) }, 227ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0105_PID) }, 228ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0106_PID) }, 229ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0107_PID) }, 230ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0108_PID) }, 231ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0109_PID) }, 232ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010A_PID) }, 233ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010B_PID) }, 234ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010C_PID) }, 235ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010D_PID) }, 236ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010E_PID) }, 237ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010F_PID) }, 238ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0110_PID) }, 239ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0111_PID) }, 240ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0112_PID) }, 241ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0113_PID) }, 242ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0114_PID) }, 243ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0115_PID) }, 244ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0116_PID) }, 245ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0117_PID) }, 246ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0118_PID) }, 247ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0119_PID) }, 248ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011A_PID) }, 249ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011B_PID) }, 250ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011C_PID) }, 251ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011D_PID) }, 252ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011E_PID) }, 253ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011F_PID) }, 254ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0120_PID) }, 255ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0121_PID) }, 256ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0122_PID) }, 257ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0123_PID) }, 258ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0124_PID) }, 259ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0125_PID) }, 260ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0126_PID) }, 26119de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID) }, 262ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 263ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 264ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 265ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 26619de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID) }, 267ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 268ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 269ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, 270ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0130_PID) }, 271ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0131_PID) }, 272ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0132_PID) }, 273ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0133_PID) }, 274ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0134_PID) }, 275ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0135_PID) }, 276ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0136_PID) }, 277ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0137_PID) }, 278ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0138_PID) }, 279ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0139_PID) }, 280ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013A_PID) }, 281ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013B_PID) }, 282ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013C_PID) }, 283ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013D_PID) }, 284ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013E_PID) }, 285ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013F_PID) }, 286ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0140_PID) }, 287ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0141_PID) }, 288ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0142_PID) }, 289ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0143_PID) }, 290ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0144_PID) }, 291ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0145_PID) }, 292ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0146_PID) }, 293ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0147_PID) }, 294ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0148_PID) }, 295ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0149_PID) }, 296ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014A_PID) }, 297ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014B_PID) }, 298ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014C_PID) }, 299ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014D_PID) }, 300ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014E_PID) }, 301ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014F_PID) }, 302ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 303ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 304ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 30519de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID) }, 30619de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID) }, 30719de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID) }, 30819de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID) }, 30919de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID) }, 31019de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID) }, 311ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 312ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 313ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, 314ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015C_PID) }, 315ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015D_PID) }, 316ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015E_PID) }, 317ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015F_PID) }, 318ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0160_PID) }, 319ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0161_PID) }, 320ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0162_PID) }, 321ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0163_PID) }, 322ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0164_PID) }, 323ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0165_PID) }, 324ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0166_PID) }, 325ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0167_PID) }, 326ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0168_PID) }, 327ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0169_PID) }, 328ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016A_PID) }, 329ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016B_PID) }, 330ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016C_PID) }, 331ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016D_PID) }, 332ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016E_PID) }, 333ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016F_PID) }, 334ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0170_PID) }, 335ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0171_PID) }, 336ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0172_PID) }, 337ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0173_PID) }, 338ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0174_PID) }, 339ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0175_PID) }, 340ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0176_PID) }, 341ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0177_PID) }, 342ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0178_PID) }, 343ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0179_PID) }, 344ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017A_PID) }, 345ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017B_PID) }, 346ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017C_PID) }, 347ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017D_PID) }, 348ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017E_PID) }, 349ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017F_PID) }, 350ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0180_PID) }, 351ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0181_PID) }, 352ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0182_PID) }, 353ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0183_PID) }, 354ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0184_PID) }, 355ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0185_PID) }, 356ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0186_PID) }, 357ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0187_PID) }, 358ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0188_PID) }, 359ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0189_PID) }, 360ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018A_PID) }, 361ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018B_PID) }, 362ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018C_PID) }, 363ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018D_PID) }, 364ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018E_PID) }, 365ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018F_PID) }, 366ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0190_PID) }, 367ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0191_PID) }, 368ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0192_PID) }, 369ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0193_PID) }, 370ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0194_PID) }, 371ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0195_PID) }, 372ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0196_PID) }, 373ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0197_PID) }, 374ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0198_PID) }, 375ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0199_PID) }, 376ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019A_PID) }, 377ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019B_PID) }, 378ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019C_PID) }, 379ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019D_PID) }, 380ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019E_PID) }, 381ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019F_PID) }, 382ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A0_PID) }, 383ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A1_PID) }, 384ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A2_PID) }, 385ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A3_PID) }, 386ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A4_PID) }, 387ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A5_PID) }, 388ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A6_PID) }, 389ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A7_PID) }, 390ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A8_PID) }, 391ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A9_PID) }, 392ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AA_PID) }, 393ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AB_PID) }, 394ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AC_PID) }, 395ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AD_PID) }, 396ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AE_PID) }, 397ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AF_PID) }, 398ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B0_PID) }, 399ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B1_PID) }, 400ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B2_PID) }, 401ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B3_PID) }, 402ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B4_PID) }, 403ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B5_PID) }, 404ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B6_PID) }, 405ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B7_PID) }, 406ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B8_PID) }, 407ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B9_PID) }, 408ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BA_PID) }, 409ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BB_PID) }, 410ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BC_PID) }, 411ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BD_PID) }, 412ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BE_PID) }, 413ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BF_PID) }, 414ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C0_PID) }, 415ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C1_PID) }, 416ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C2_PID) }, 417ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C3_PID) }, 418ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C4_PID) }, 419ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C5_PID) }, 420ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C6_PID) }, 421ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C7_PID) }, 422ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C8_PID) }, 423ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C9_PID) }, 424ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CA_PID) }, 425ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CB_PID) }, 426ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CC_PID) }, 427ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CD_PID) }, 428ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CE_PID) }, 429ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CF_PID) }, 430ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D0_PID) }, 431ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D1_PID) }, 432ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D2_PID) }, 433ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D3_PID) }, 434ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D4_PID) }, 435ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D5_PID) }, 436ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D6_PID) }, 437ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D7_PID) }, 438ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D8_PID) }, 439ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D9_PID) }, 440ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DA_PID) }, 441ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DB_PID) }, 442ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DC_PID) }, 443ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DD_PID) }, 444ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DE_PID) }, 445ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DF_PID) }, 446ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E0_PID) }, 447ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E1_PID) }, 448ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E2_PID) }, 449ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E3_PID) }, 450ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E4_PID) }, 451ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E5_PID) }, 452ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E6_PID) }, 453ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E7_PID) }, 454ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E8_PID) }, 455ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E9_PID) }, 456ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EA_PID) }, 457ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EB_PID) }, 458ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EC_PID) }, 459ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01ED_PID) }, 460ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EE_PID) }, 461ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EF_PID) }, 462ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F0_PID) }, 463ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F1_PID) }, 464ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F2_PID) }, 465ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F3_PID) }, 466ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F4_PID) }, 467ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F5_PID) }, 468ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F6_PID) }, 469ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F7_PID) }, 470ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F8_PID) }, 471ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F9_PID) }, 472ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FA_PID) }, 473ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FB_PID) }, 474ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FC_PID) }, 475ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 476ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 477ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 478204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) }, 479204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) }, 480204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) }, 481204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) }, 482204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) }, 483204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) }, 484204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) }, 485204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) }, 486204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) }, 487204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) }, 488204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) }, 489204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) }, 490204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) }, 491204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) }, 492204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) }, 493204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) }, 494204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) }, 495204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) }, 496204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) }, 497204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) }, 498204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) }, 499204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) }, 500204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) }, 501204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) }, 502204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) }, 503204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) }, 504204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) }, 505204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) }, 506204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) }, 507204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) }, 508204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) }, 509204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) }, 510204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) }, 5118f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 5121da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 513274a4bbcSDave Platt { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 514868e440dSJelle Foks { USB_DEVICE(FTDI_VID, FTDI_USBX_707_PID) }, 5151da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 5161da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 5171da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 5181da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, 519a1484827SJustin Carlson { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, 5201da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, 5211da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, 5221da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, 5231da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_2_PID) }, 5241da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_1_PID) }, 5251da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_2_PID) }, 5261da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_1_PID) }, 5271da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_2_PID) }, 5281da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_3_PID) }, 5291da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_4_PID) }, 5301da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_1_PID) }, 5311da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_2_PID) }, 5321da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_3_PID) }, 5331da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_4_PID) }, 5341da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_1_PID) }, 5351da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_2_PID) }, 5361da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_3_PID) }, 5371da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_4_PID) }, 5381da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_1_PID) }, 5391da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_2_PID) }, 5401da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_3_PID) }, 5411da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_4_PID) }, 5421da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_5_PID) }, 5431da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_6_PID) }, 5441da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_7_PID) }, 5451da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_8_PID) }, 5461da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_1_PID) }, 5471da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_2_PID) }, 5481da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_3_PID) }, 5491da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_4_PID) }, 5501da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_5_PID) }, 5511da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_6_PID) }, 5521da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_7_PID) }, 5531da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_8_PID) }, 5541da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_1_PID) }, 5551da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_2_PID) }, 5561da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_3_PID) }, 5571da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_4_PID) }, 5581da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_5_PID) }, 5591da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) }, 5601da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) }, 5611da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 5626d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_1_PID) }, 5636d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_2_PID) }, 5646d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_3_PID) }, 5656d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_4_PID) }, 5661da177e4SLinus Torvalds { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 5671da177e4SLinus Torvalds { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 56811a31d84SJohan Hovold { USB_DEVICE(OCT_VID, OCT_DK201_PID) }, 5698f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID), 5708f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk }, 5718f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID), 5728f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk }, 5731da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 5741da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 5751da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 5761da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 5778f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) }, 5788f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) }, 5798f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) }, 5808f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) }, 5818f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) }, 5828f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) }, 5838f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) }, 5848f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) }, 5858f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) }, 5868f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) }, 5878f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) }, 5888f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) }, 5898f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) }, 5908f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) }, 5918f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) }, 5928f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) }, 5931da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 59447900743SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 595e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UR100_PID) }, 596e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 597207c47e1SThomas Riewe { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 598bde62185SMartin Hagelin { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 5994eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, 6004eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, 6014eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, 6024eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, 6034eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, 6044eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, 6054eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, 6064eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, 60737909fe5SBenedek László { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) }, 60854575b05SAntonio Ospite { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID), 60954575b05SAntonio Ospite .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 610d0839d75SGeorge McCollister { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID), 611d0839d75SGeorge McCollister .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 612422c2537SGeorge McCollister { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLX_PLUS_PID) }, 613422c2537SGeorge McCollister { USB_DEVICE(FTDI_VID, FTDI_NT_ORION_IO_PID) }, 6144899c054SDoug Goldstein { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, 6151fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) }, 6161fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) }, 6171fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) }, 6181fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) }, 619e6ac4a40SIan Abbott /* 62065e1ec67SAndreas Mohr * ELV devices: 621e6ac4a40SIan Abbott */ 622c249f911SSven Killig { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, 62365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 62465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 62565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, 62665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) }, 62765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) }, 62865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) }, 62965e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) }, 63065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) }, 63142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) }, 63242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) }, 63342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) }, 63442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDF77_PID) }, 63542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UIO88_PID) }, 63642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UAD8_PID) }, 63742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDA7_PID) }, 63842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_USI2_PID) }, 63942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_T1100_PID) }, 64042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCD200_PID) }, 64142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_ULA200_PID) }, 64242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CSI8_PID) }, 64342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1000DL_PID) }, 64442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) }, 64542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) }, 64642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, 64765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) }, 64842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, 64965e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) }, 65042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, 6514ae897dfSSven Andersen { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, 65242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, 653b5894a50SAndré Schenk { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) }, 65465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) }, 65565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) }, 65665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) }, 65765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) }, 6586977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_PALMSENS_PID) }, 6596977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_IVIUM_XSTAT_PID) }, 6608f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, 6618f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, 6628f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) }, 6638f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) }, 6648f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) }, 6651da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 6661da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 667ec434e9bSJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 6689d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) }, 6699d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) }, 6709d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) }, 6711da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 6721da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 6731da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 6741da177e4SLinus Torvalds { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 675e6ac4a40SIan Abbott { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 6761da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 677c3d36c45SVladimir Vukicevic { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, 678ef31fec0SMichael Olberg { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, 6796f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 68028fe2eb0SMichael Williamson { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, 68146b72d78SDaniel Sangorrin { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, 682482b0b5dSKonstantin Holoborodko { USB_DEVICE(MITSUBISHI_VID, MITSUBISHI_FXUSB_PID) }, 6831da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 6841da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 6851da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, 686a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) }, 687a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) }, 688a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) }, 689a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) }, 690a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) }, 691a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) }, 692a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) }, 693a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) }, 694a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) }, 695a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) }, 696a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) }, 697a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) }, 698a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) }, 699a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) }, 7001da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 7016f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 7026f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 703a26d31ceSSteffen Sledz { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) }, 704e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 705e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 706e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 707e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_3_PID) }, 708e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_4_PID) }, 709e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 710e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 711e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 712edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) }, 713edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, 7144bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, 7151df5b888SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, 7166ccc48e0SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) }, 7174bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 7180ba3b2ccSPetr Kubánek { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 7196f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 7208f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 72134d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 72234d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 7239b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 7249b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 72534d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 72634d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 72734d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 72834d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 729740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 730740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 7319b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 732c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 733c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 734c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 735c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 73609c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 737c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 73809c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 73934910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 740b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 741b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 742effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 743641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 7447e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 745a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 746a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 747ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 748cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 7497e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 75026a538b9SHorst Schirmeier { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 751a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 752a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 753a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 754a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 755a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 756a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 757a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 758a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 759a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 760a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 761a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 76220a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 763eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 76448437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 7655a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_1_PID) }, 7665a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_3_PID) }, 767eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 7689978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 7699978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 7709978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 77140c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 772b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 773b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 774b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 775b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 776b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 777b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 778b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 779b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 780b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 781b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 782822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 783ee444609SJohan Hovold { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) }, 7849608e5c0SMajor Hayden { USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) }, 785fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, 786fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, 787fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, 788fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, 789fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, 790fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, 791fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, 792fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, 793fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, 794fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, 795fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, 796fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, 797fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, 798fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, 799fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, 800fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, 801fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, 802fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, 803fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, 804fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, 805fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, 806fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, 807fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, 808fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, 809fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, 810fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, 811fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, 812fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, 813762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 814a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 815d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 8164bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 81711171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 818307369b0SMarcin Kościelnicki { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 819c7d373c3SMax Mansfield { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), 820c7d373c3SMax Mansfield .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8215f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, 8225f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, 8235f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, 8245f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, 82520734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 82620734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82720734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 82820734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 829a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 830a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 831a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 832a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8333687f641SPeter Stuge { USB_DEVICE(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID), 8343687f641SPeter Stuge .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 83514511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 83614511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 83726ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 838e03cdf22SGreg Kroah-Hartman { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, 8392542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 84059c6ccd9SDaniel Suchy 84159c6ccd9SDaniel Suchy /* Papouch devices based on FTDI chip */ 84259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) }, 84359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) }, 84459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) }, 84559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) }, 84659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) }, 84759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) }, 84859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) }, 84959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) }, 85059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) }, 85159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) }, 85259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 85359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) }, 85459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) }, 85559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) }, 856a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 85759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) }, 85859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) }, 85959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) }, 86059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) }, 86159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) }, 86259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) }, 86359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) }, 86459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) }, 86559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) }, 86659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) }, 867a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 86859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) }, 86959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) }, 87059c6ccd9SDaniel Suchy 87196285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 87296285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 87345eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 874ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 8757f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 8767f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 8777f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 878b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 879b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 88011eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 88111eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 882f08dea73SBjørn Mork { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 883f08dea73SBjørn Mork USB_CLASS_VENDOR_SPEC, 884f08dea73SBjørn Mork USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 88531c5d192SMarek Vasut { USB_DEVICE_INTERFACE_NUMBER(ACTEL_VID, MICROSEMI_ARROW_SF2PLUS_BOARD_PID, 2) }, 886ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 8871002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 8881002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 889d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 890fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 891dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 892dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 893dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C866_PID) }, 894dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C663_PID) }, 895dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C725_PID) }, 896dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E517_PID) }, 897dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C863_PID) }, 898b69cc672SÉric Piel { USB_DEVICE(PI_VID, PI_E861_PID) }, 899dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C867_PID) }, 900dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E609_PID) }, 901dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E709_PID) }, 902dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_100F_PID) }, 903dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1011_PID) }, 904dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1012_PID) }, 905dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1013_PID) }, 906dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1014_PID) }, 907dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1015_PID) }, 908dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1016_PID) }, 9097724a1edSOzan Çağlayan { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 910c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 91150d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 91250d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91355f13aeaSPeter Korsgaard { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID), 91455f13aeaSPeter Korsgaard .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 915e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 916c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, 917c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, 918e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 9199714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 9209714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 9219714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 9229714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 92377dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 92477dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92577dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 92677dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92777dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 92877dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92977dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 93077dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 931afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 9323126d823SRich Mattes { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) }, 933666cc076SMartin Michlmayr { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), 934666cc076SMartin Michlmayr .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 93565737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, 93665737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, 93765737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, 93865737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, 93965737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, 94065737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, 94165737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, 94265737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, 9430f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, 9440f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, 9450f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, 94690451e69SMilan Kocian { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, 9476555ad13SClemens Werther { USB_DEVICE(FTDI_VID, FTDI_FHE_PID) }, 9485363cdc3SFlorian Faber { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, 9497fea0f71SSebastien Bourdeauducq { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), 9507fea0f71SSebastien Bourdeauducq .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9519f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), 9529f06d15fSAdrian Thomasset .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9539f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), 9546ec2f46cSJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, 955fc216ec3SPeter Naulls { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, 95647594d55SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 95747594d55SMichał Wróbel .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 95857e596f3SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 9598cf65dc3STomasz Mloduchowski /* Crucible Devices */ 9608cf65dc3STomasz Mloduchowski { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 961e1466ad5SАлексей Крамаренко { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, 9626dbd46c8SJoerg Dorchain /* Cressi Devices */ 9636dbd46c8SJoerg Dorchain { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, 964efe26e16SMichele Baldessari /* Brainboxes Devices */ 965efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_001_PID) }, 966efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_012_PID) }, 967efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) }, 968efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) }, 969efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) }, 970efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) }, 971efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) }, 972efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) }, 973efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_4_PID) }, 974efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_5_PID) }, 975efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) }, 976efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) }, 977efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) }, 978efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) }, 979efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) }, 980efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) }, 981efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) }, 982efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) }, 983efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) }, 984efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) }, 985efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) }, 986efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) }, 987efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_357_PID) }, 988efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_1_PID) }, 989efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_2_PID) }, 990efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_3_PID) }, 991efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_1_PID) }, 992efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_2_PID) }, 993efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_1_PID) }, 994efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, 995efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, 996efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, 997646907f5SJaša Bartelj /* ekey Devices */ 998646907f5SJaša Bartelj { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) }, 999d8279a40SMichal Sojka /* Infineon Devices */ 1000ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) }, 1001ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) }, 10029c491c37STaylor Braun-Jones /* GE Healthcare devices */ 10039c491c37STaylor Braun-Jones { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) }, 1004f6950344SMark Glover /* Active Research (Actisense) devices */ 1005f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NDC_PID) }, 1006f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) }, 1007f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) }, 1008f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) }, 1009f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) }, 1010f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) }, 1011f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) }, 1012f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) }, 1013f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) }, 1014f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) }, 1015f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_NMEA2000_PID) }, 1016f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ETHERNET_PID) }, 1017f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_WIFI_PID) }, 1018f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 1019f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 1020f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 1021ea6db90eSJosh Boyer /* ICP DAS I-756xU devices */ 1022ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, 1023ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, 1024ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, 1025ae34d12cSSheng-Hui J. Chu { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, 10269bfef729SDoug Brown { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), 10279bfef729SDoug Brown .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 1028a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, 1029a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, 1030c6a36ad3SMax Schulze { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) }, 10318d7fa3d4SMans Rullgard /* EZPrototypes devices */ 10328d7fa3d4SMans Rullgard { USB_DEVICE(EZPROTOTYPES_VID, HJELMSLUND_USB485_ISO_PID) }, 1033f8377effSAndreas Fritiofson { USB_DEVICE_INTERFACE_NUMBER(UNJO_VID, UNJO_ISODEBUG_V1_PID, 1) }, 1034357f16d9SBeni Mahler /* Sienna devices */ 1035357f16d9SBeni Mahler { USB_DEVICE(FTDI_VID, FTDI_SIENNA_PID) }, 1036357f16d9SBeni Mahler { USB_DEVICE(ECHELON_VID, ECHELON_U20_PID) }, 1037c1a1f273SFabio D'Urso /* U-Blox devices */ 1038c1a1f273SFabio D'Urso { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, 1039c1a1f273SFabio D'Urso { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, 10406cf87e5eSMychaela N. Falconia /* FreeCalypso USB adapters */ 10416cf87e5eSMychaela N. Falconia { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID), 10426cf87e5eSMychaela N. Falconia .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 10436cf87e5eSMychaela N. Falconia { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), 10446cf87e5eSMychaela N. Falconia .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 10451da177e4SLinus Torvalds { } /* Terminating entry */ 10461da177e4SLinus Torvalds }; 10471da177e4SLinus Torvalds 10481da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 10491da177e4SLinus Torvalds 10504c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 10511da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 10521da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 10531da177e4SLinus Torvalds [FT232BM] = "FT232BM", 10541da177e4SLinus Torvalds [FT2232C] = "FT2232C", 1055d8b21606SGard Spreemann [FT232RL] = "FT232RL", 1056094c2e6dSMark Adamson [FT2232H] = "FT2232H", 1057309427b6SUwe Bonnes [FT4232H] = "FT4232H", 1058dc0827c1SJim Paris [FT232H] = "FT232H", 1059dc0827c1SJim Paris [FTX] = "FT-X" 10601da177e4SLinus Torvalds }; 10611da177e4SLinus Torvalds 10621da177e4SLinus Torvalds 10631da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 10641da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 10651da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 10661da177e4SLinus Torvalds /* End TIOCMIWAIT */ 10671da177e4SLinus Torvalds 10681da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 1069464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1070464cbb24SAlan Cox const struct usb_device_id *id); 107112bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 107212bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 1073a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 1074335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 10751b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 1076d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1077c23e5fc1SJohan Hovold void *dest, size_t size); 1078464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 1079464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 108060b33c13SAlan Cox static int ftdi_tiocmget(struct tty_struct *tty); 108120b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 1082464cbb24SAlan Cox unsigned int set, unsigned int clear); 108300a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 1084464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 10853ae36bedSAl Viro static int get_serial_info(struct tty_struct *tty, 10863ae36bedSAl Viro struct serial_struct *ss); 10873ae36bedSAl Viro static int set_serial_info(struct tty_struct *tty, 10883ae36bedSAl Viro struct serial_struct *ss); 108995da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 1090a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port); 1091c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 10925fb0432eSJohan Hovold unsigned char status[2]); 10931da177e4SLinus Torvalds 10941da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 10951da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 1096fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 1097fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud); 1098fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 1099fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud); 11001da177e4SLinus Torvalds 1101ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 110218fcac35SGreg Kroah-Hartman .driver = { 11031da177e4SLinus Torvalds .owner = THIS_MODULE, 1104269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 110518fcac35SGreg Kroah-Hartman }, 1106269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 11078f977e42SIan Abbott .id_table = id_table_combined, 11081da177e4SLinus Torvalds .num_ports = 1, 1109bbcb2b90SJohan Hovold .bulk_in_size = 512, 1110c23e5fc1SJohan Hovold .bulk_out_size = 256, 11118f977e42SIan Abbott .probe = ftdi_sio_probe, 111212bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 111312bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 11141da177e4SLinus Torvalds .open = ftdi_open, 1115335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 11161b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 11171b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 11181b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 1119d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 11201da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 11211da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 1122f307e5cdSJohan Hovold .tiocmiwait = usb_serial_generic_tiocmiwait, 11236f86fec9SJohan Hovold .get_icount = usb_serial_generic_get_icount, 11241da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 11253ae36bedSAl Viro .get_serial = get_serial_info, 11263ae36bedSAl Viro .set_serial = set_serial_info, 11271da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 11281da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 1129a37025b5SJohan Hovold .tx_empty = ftdi_tx_empty, 11301da177e4SLinus Torvalds }; 11311da177e4SLinus Torvalds 113297b6b6d2SAlan Stern static struct usb_serial_driver * const serial_drivers[] = { 113397b6b6d2SAlan Stern &ftdi_sio_device, NULL 113497b6b6d2SAlan Stern }; 113597b6b6d2SAlan Stern 11361da177e4SLinus Torvalds 11371da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 1138279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 11391da177e4SLinus Torvalds 11401da177e4SLinus Torvalds /* 11411da177e4SLinus Torvalds * *************************************************************************** 1142fa91d43bSTony Lindgren * Utility functions 11431da177e4SLinus Torvalds * *************************************************************************** 11441da177e4SLinus Torvalds */ 11451da177e4SLinus Torvalds 11461da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 11471da177e4SLinus Torvalds { 11481da177e4SLinus Torvalds unsigned short int divisor; 1149464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 11506abd8371SNikolaj Fogh int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud); 1151464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 1152464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 11531da177e4SLinus Torvalds divisor = divisor3 >> 3; 11541da177e4SLinus Torvalds divisor3 &= 0x7; 1155464cbb24SAlan Cox if (divisor3 == 1) 1156464cbb24SAlan Cox divisor |= 0xc000; 1157464cbb24SAlan Cox else if (divisor3 >= 4) 1158464cbb24SAlan Cox divisor |= 0x4000; 1159464cbb24SAlan Cox else if (divisor3 != 0) 1160464cbb24SAlan Cox divisor |= 0x8000; 1161464cbb24SAlan Cox else if (divisor == 1) 1162464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 11631da177e4SLinus Torvalds return divisor; 11641da177e4SLinus Torvalds } 11651da177e4SLinus Torvalds 11661da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 11671da177e4SLinus Torvalds { 1168464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 11691da177e4SLinus Torvalds } 11701da177e4SLinus Torvalds 1171fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 11721da177e4SLinus Torvalds { 11731da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1174fd54a99aSJohan Hovold u32 divisor; 1175464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 11766abd8371SNikolaj Fogh int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud); 11771da177e4SLinus Torvalds divisor = divisor3 >> 3; 1178fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 11791da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 1180464cbb24SAlan Cox if (divisor == 1) 1181464cbb24SAlan Cox divisor = 0; 1182464cbb24SAlan Cox else if (divisor == 0x4001) 1183464cbb24SAlan Cox divisor = 1; 11841da177e4SLinus Torvalds return divisor; 11851da177e4SLinus Torvalds } 11861da177e4SLinus Torvalds 1187fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud) 11881da177e4SLinus Torvalds { 1189464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 11901da177e4SLinus Torvalds } 11911da177e4SLinus Torvalds 1192fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 1193094c2e6dSMark Adamson { 1194094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1195fd54a99aSJohan Hovold u32 divisor; 1196094c2e6dSMark Adamson int divisor3; 1197094c2e6dSMark Adamson 1198094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 11996abd8371SNikolaj Fogh divisor3 = DIV_ROUND_CLOSEST(8 * base, 10 * baud); 1200094c2e6dSMark Adamson 1201094c2e6dSMark Adamson divisor = divisor3 >> 3; 1202fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 1203094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 1204094c2e6dSMark Adamson if (divisor == 1) 1205094c2e6dSMark Adamson divisor = 0; 1206094c2e6dSMark Adamson else if (divisor == 0x4001) 1207094c2e6dSMark Adamson divisor = 1; 1208094c2e6dSMark Adamson /* 1209094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 1210094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 1211094c2e6dSMark Adamson * baud with this bit set 1212094c2e6dSMark Adamson */ 1213094c2e6dSMark Adamson divisor |= 0x00020000; 1214094c2e6dSMark Adamson return divisor; 1215094c2e6dSMark Adamson } 1216094c2e6dSMark Adamson 1217fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud) 1218094c2e6dSMark Adamson { 1219094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 1220094c2e6dSMark Adamson } 1221094c2e6dSMark Adamson 122274ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 122374ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 122474ede0ffSIan Abbott 1225464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 1226464cbb24SAlan Cox unsigned int clear) 12271da177e4SLinus Torvalds { 12281da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1229bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 123016410115SJohan Hovold unsigned value; 12311da177e4SLinus Torvalds int rv; 12321da177e4SLinus Torvalds 123374ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 1234bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); 123574ede0ffSIan Abbott return 0; /* no change */ 12361da177e4SLinus Torvalds } 123774ede0ffSIan Abbott 123874ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 123916410115SJohan Hovold value = 0; 124074ede0ffSIan Abbott if (clear & TIOCM_DTR) 124116410115SJohan Hovold value |= FTDI_SIO_SET_DTR_LOW; 124274ede0ffSIan Abbott if (clear & TIOCM_RTS) 124316410115SJohan Hovold value |= FTDI_SIO_SET_RTS_LOW; 124474ede0ffSIan Abbott if (set & TIOCM_DTR) 124516410115SJohan Hovold value |= FTDI_SIO_SET_DTR_HIGH; 124674ede0ffSIan Abbott if (set & TIOCM_RTS) 124716410115SJohan Hovold value |= FTDI_SIO_SET_RTS_HIGH; 12481da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 12491da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 12501da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 12511da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 125216410115SJohan Hovold value, priv->interface, 125366e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 125474ede0ffSIan Abbott if (rv < 0) { 1255bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", 1256441b62c1SHarvey Harrison __func__, 1257bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1258bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12592c2ee545SJohan Hovold rv = usb_translate_errors(rv); 12601da177e4SLinus Torvalds } else { 1261bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1262bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1263bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12649b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 126574ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 12661da177e4SLinus Torvalds } 12671da177e4SLinus Torvalds return rv; 12681da177e4SLinus Torvalds } 12691da177e4SLinus Torvalds 12701da177e4SLinus Torvalds 1271fd54a99aSJohan Hovold static u32 get_ftdi_divisor(struct tty_struct *tty, 1272464cbb24SAlan Cox struct usb_serial_port *port) 1273e49bbce1SJohan Hovold { 12741da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1275bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 1276fd54a99aSJohan Hovold u32 div_value = 0; 12771da177e4SLinus Torvalds int div_okay = 1; 12781da177e4SLinus Torvalds int baud; 12791da177e4SLinus Torvalds 128095da310eSAlan Cox baud = tty_get_baud_rate(tty); 1281bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); 12821da177e4SLinus Torvalds 128383c9a2d1SJohan Hovold /* 128483c9a2d1SJohan Hovold * Observe deprecated async-compatible custom_divisor hack, update 128583c9a2d1SJohan Hovold * baudrate if needed. 128683c9a2d1SJohan Hovold */ 12871da177e4SLinus Torvalds if (baud == 38400 && 12881da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 12891da177e4SLinus Torvalds (priv->custom_divisor)) { 12901da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1291bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", 1292464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 12931da177e4SLinus Torvalds } 12941da177e4SLinus Torvalds 1295464cbb24SAlan Cox if (!baud) 1296464cbb24SAlan Cox baud = 9600; 12971da177e4SLinus Torvalds switch (priv->chip_type) { 12981da177e4SLinus Torvalds case SIO: /* SIO chip */ 12991da177e4SLinus Torvalds switch (baud) { 13001da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 13011da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 13021da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 13031da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 13041da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 13051da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 13061da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 13071da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 13081da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 13091da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 13101da177e4SLinus Torvalds } /* baud */ 13111da177e4SLinus Torvalds if (div_value == 0) { 1312bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", 1313464cbb24SAlan Cox __func__, baud); 13141da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1315669a6db1SAlan Cox baud = 9600; 13161da177e4SLinus Torvalds div_okay = 0; 13171da177e4SLinus Torvalds } 13181da177e4SLinus Torvalds break; 13191da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 13201da177e4SLinus Torvalds if (baud <= 3000000) { 13211da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 13221da177e4SLinus Torvalds } else { 1323bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1324669a6db1SAlan Cox baud = 9600; 13251da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 13261da177e4SLinus Torvalds div_okay = 0; 13271da177e4SLinus Torvalds } 13281da177e4SLinus Torvalds break; 13291da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 13301da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 1331dc0827c1SJim Paris case FT232RL: /* FT232RL chip */ 1332dc0827c1SJim Paris case FTX: /* FT-X series */ 13331da177e4SLinus Torvalds if (baud <= 3000000) { 1334fd54a99aSJohan Hovold u16 product_id = le16_to_cpu( 1335b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1336fb571101SMathieu OTHACEHE if (((product_id == FTDI_NDI_HUC_PID) || 1337fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_SPECTRA_SCU_PID) || 1338fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_2_PID) || 1339fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_3_PID) || 1340fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_AURORA_SCU_PID)) && 1341b760dac2SMartin Geleynse (baud == 19200)) { 1342b760dac2SMartin Geleynse baud = 1200000; 1343b760dac2SMartin Geleynse } 13441da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 13451da177e4SLinus Torvalds } else { 1346bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 13471da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 13481da177e4SLinus Torvalds div_okay = 0; 1349669a6db1SAlan Cox baud = 9600; 13501da177e4SLinus Torvalds } 13511da177e4SLinus Torvalds break; 1352094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1353094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1354309427b6SUwe Bonnes case FT232H: /* FT232H chip */ 13551862cdd5SIonut Nicu if ((baud <= 12000000) && (baud >= 1200)) { 1356094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1357094c2e6dSMark Adamson } else if (baud < 1200) { 1358094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1359094c2e6dSMark Adamson } else { 1360bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1361094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1362094c2e6dSMark Adamson div_okay = 0; 1363094c2e6dSMark Adamson baud = 9600; 1364094c2e6dSMark Adamson } 1365094c2e6dSMark Adamson break; 13661da177e4SLinus Torvalds } /* priv->chip_type */ 13671da177e4SLinus Torvalds 13681da177e4SLinus Torvalds if (div_okay) { 1369bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", 1370441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 13711da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 13721da177e4SLinus Torvalds } 13731da177e4SLinus Torvalds 137495da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1375464cbb24SAlan Cox return div_value; 13761da177e4SLinus Torvalds } 13771da177e4SLinus Torvalds 137895da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 137995da310eSAlan Cox { 138095da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 138116410115SJohan Hovold u16 value; 138216410115SJohan Hovold u16 index; 138316410115SJohan Hovold u32 index_value; 138495da310eSAlan Cox int rv; 138595da310eSAlan Cox 138616410115SJohan Hovold index_value = get_ftdi_divisor(tty, port); 138716410115SJohan Hovold value = (u16)index_value; 138816410115SJohan Hovold index = (u16)(index_value >> 16); 13890ee404ccSUwe Bonnes if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || 13900ee404ccSUwe Bonnes (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { 13910ee404ccSUwe Bonnes /* Probably the BM type needs the MSB of the encoded fractional 13920ee404ccSUwe Bonnes * divider also moved like for the chips above. Any infos? */ 139316410115SJohan Hovold index = (u16)((index << 8) | priv->interface); 139495da310eSAlan Cox } 139595da310eSAlan Cox 139695da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 139795da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 139895da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 139995da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 140016410115SJohan Hovold value, index, 140166e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 140295da310eSAlan Cox return rv; 140395da310eSAlan Cox } 140495da310eSAlan Cox 1405557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1406557aaa7fSAlan Cox { 1407557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1408557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1409c1284d77SJohan Hovold int rv; 1410557aaa7fSAlan Cox int l = priv->latency; 141195da310eSAlan Cox 14122dea7cd7SIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14132dea7cd7SIan Abbott return -EINVAL; 14142dea7cd7SIan Abbott 1415557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1416557aaa7fSAlan Cox l = 1; 1417557aaa7fSAlan Cox 1418bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); 1419557aaa7fSAlan Cox 1420557aaa7fSAlan Cox rv = usb_control_msg(udev, 1421557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1422557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1423557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1424557aaa7fSAlan Cox l, priv->interface, 142566e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1426557aaa7fSAlan Cox if (rv < 0) 1427557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1428557aaa7fSAlan Cox return rv; 1429557aaa7fSAlan Cox } 1430557aaa7fSAlan Cox 14317e1e6cedSIan Abbott static int _read_latency_timer(struct usb_serial_port *port) 1432557aaa7fSAlan Cox { 1433557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1434557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 143554f328d0SJohan Hovold unsigned char *buf; 1436c1284d77SJohan Hovold int rv; 1437557aaa7fSAlan Cox 143854f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 143954f328d0SJohan Hovold if (!buf) 144054f328d0SJohan Hovold return -ENOMEM; 144154f328d0SJohan Hovold 1442557aaa7fSAlan Cox rv = usb_control_msg(udev, 1443557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1444557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1445557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1446557aaa7fSAlan Cox 0, priv->interface, 144754f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 1448e3e574adSJohan Hovold if (rv < 1) { 1449e3e574adSJohan Hovold if (rv >= 0) 1450e3e574adSJohan Hovold rv = -EIO; 1451e3e574adSJohan Hovold } else { 14527e1e6cedSIan Abbott rv = buf[0]; 1453e3e574adSJohan Hovold } 145454f328d0SJohan Hovold 145554f328d0SJohan Hovold kfree(buf); 145654f328d0SJohan Hovold 14578c4f99cdSJohan Hovold return rv; 1458557aaa7fSAlan Cox } 14591da177e4SLinus Torvalds 14607e1e6cedSIan Abbott static int read_latency_timer(struct usb_serial_port *port) 14617e1e6cedSIan Abbott { 14627e1e6cedSIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 14637e1e6cedSIan Abbott int rv; 14647e1e6cedSIan Abbott 14657e1e6cedSIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14667e1e6cedSIan Abbott return -EINVAL; 14677e1e6cedSIan Abbott 14687e1e6cedSIan Abbott rv = _read_latency_timer(port); 14697e1e6cedSIan Abbott if (rv < 0) { 14707e1e6cedSIan Abbott dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 14717e1e6cedSIan Abbott return rv; 14727e1e6cedSIan Abbott } 14737e1e6cedSIan Abbott 14747e1e6cedSIan Abbott priv->latency = rv; 14757e1e6cedSIan Abbott 14767e1e6cedSIan Abbott return 0; 14777e1e6cedSIan Abbott } 14787e1e6cedSIan Abbott 14793ae36bedSAl Viro static int get_serial_info(struct tty_struct *tty, 14803ae36bedSAl Viro struct serial_struct *ss) 14811da177e4SLinus Torvalds { 14823ae36bedSAl Viro struct usb_serial_port *port = tty->driver_data; 14831da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14841da177e4SLinus Torvalds 14853ae36bedSAl Viro ss->flags = priv->flags; 14863ae36bedSAl Viro ss->baud_base = priv->baud_base; 14873ae36bedSAl Viro ss->custom_divisor = priv->custom_divisor; 14881da177e4SLinus Torvalds return 0; 1489e49bbce1SJohan Hovold } 14901da177e4SLinus Torvalds 149195da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 14923ae36bedSAl Viro struct serial_struct *ss) 1493e49bbce1SJohan Hovold { 14943ae36bedSAl Viro struct usb_serial_port *port = tty->driver_data; 14951da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14961da177e4SLinus Torvalds struct ftdi_private old_priv; 14971da177e4SLinus Torvalds 1498bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 14991da177e4SLinus Torvalds old_priv = *priv; 15001da177e4SLinus Torvalds 15011da177e4SLinus Torvalds /* Do error checking and permission checking */ 15021da177e4SLinus Torvalds 15031da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 15043ae36bedSAl Viro if ((ss->flags ^ priv->flags) & ~ASYNC_USR_MASK) { 1505bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15061da177e4SLinus Torvalds return -EPERM; 150764905b48SDan Carpenter } 15081da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 15093ae36bedSAl Viro (ss->flags & ASYNC_USR_MASK)); 15103ae36bedSAl Viro priv->custom_divisor = ss->custom_divisor; 15111da177e4SLinus Torvalds goto check_and_exit; 15121da177e4SLinus Torvalds } 15131da177e4SLinus Torvalds 15143ae36bedSAl Viro if (ss->baud_base != priv->baud_base) { 1515bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15161da177e4SLinus Torvalds return -EINVAL; 15176b447f04SAlan Cox } 15181da177e4SLinus Torvalds 15191da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 15201da177e4SLinus Torvalds 15211da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 15223ae36bedSAl Viro (ss->flags & ASYNC_FLAGS)); 15233ae36bedSAl Viro priv->custom_divisor = ss->custom_divisor; 15241da177e4SLinus Torvalds 1525bb246681SAnthony Mallet check_and_exit: 1526557aaa7fSAlan Cox write_latency_timer(port); 15271da177e4SLinus Torvalds 1528f3e8ae65SJohan Hovold if ((priv->flags ^ old_priv.flags) & ASYNC_SPD_MASK || 1529f3e8ae65SJohan Hovold ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && 1530f3e8ae65SJohan Hovold priv->custom_divisor != old_priv.custom_divisor)) { 153183c9a2d1SJohan Hovold 153283c9a2d1SJohan Hovold /* warn about deprecation unless clearing */ 153383c9a2d1SJohan Hovold if (priv->flags & ASYNC_SPD_MASK) 153483c9a2d1SJohan Hovold dev_warn_ratelimited(&port->dev, "use of SPD flags is deprecated\n"); 153583c9a2d1SJohan Hovold 153695da310eSAlan Cox change_speed(tty, port); 15371da177e4SLinus Torvalds } 1538bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 153995da310eSAlan Cox return 0; 1540e49bbce1SJohan Hovold } 15411da177e4SLinus Torvalds 1542c466cd2bSGreg Kroah-Hartman static int get_lsr_info(struct usb_serial_port *port, 154359556608SJohan Hovold unsigned int __user *retinfo) 1544c466cd2bSGreg Kroah-Hartman { 1545c466cd2bSGreg Kroah-Hartman struct ftdi_private *priv = usb_get_serial_port_data(port); 1546c466cd2bSGreg Kroah-Hartman unsigned int result = 0; 1547c466cd2bSGreg Kroah-Hartman 1548c466cd2bSGreg Kroah-Hartman if (priv->transmit_empty) 1549c466cd2bSGreg Kroah-Hartman result = TIOCSER_TEMT; 1550c466cd2bSGreg Kroah-Hartman 1551c466cd2bSGreg Kroah-Hartman if (copy_to_user(retinfo, &result, sizeof(unsigned int))) 1552c466cd2bSGreg Kroah-Hartman return -EFAULT; 1553c466cd2bSGreg Kroah-Hartman return 0; 1554c466cd2bSGreg Kroah-Hartman } 1555c466cd2bSGreg Kroah-Hartman 15561da177e4SLinus Torvalds 15578f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 15588f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 15598f977e42SIan Abbott { 15608f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 15618f977e42SIan Abbott struct usb_serial *serial = port->serial; 15628f977e42SIan Abbott struct usb_device *udev = serial->dev; 15638f977e42SIan Abbott unsigned version; 15648f977e42SIan Abbott unsigned interfaces; 15658f977e42SIan Abbott 15668f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1567f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 15688f977e42SIan Abbott 15698f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 15708f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1571bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, 15728f977e42SIan Abbott version, interfaces); 15738f977e42SIan Abbott if (interfaces > 1) { 1574711a3781SMychaela N. Falconia struct usb_interface *intf = serial->interface; 1575711a3781SMychaela N. Falconia int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 15768f977e42SIan Abbott 1577094c2e6dSMark Adamson /* Multiple interfaces.*/ 1578094c2e6dSMark Adamson if (version == 0x0800) { 1579094c2e6dSMark Adamson priv->chip_type = FT4232H; 1580094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1581094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1582094c2e6dSMark Adamson } else if (version == 0x0700) { 1583094c2e6dSMark Adamson priv->chip_type = FT2232H; 1584094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1585094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1586094c2e6dSMark Adamson } else 15878f977e42SIan Abbott priv->chip_type = FT2232C; 1588094c2e6dSMark Adamson 15898f977e42SIan Abbott /* Determine interface code. */ 1590711a3781SMychaela N. Falconia if (ifnum == 0) 1591094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1592711a3781SMychaela N. Falconia else if (ifnum == 1) 1593094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1594711a3781SMychaela N. Falconia else if (ifnum == 2) 1595094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1596711a3781SMychaela N. Falconia else if (ifnum == 3) 1597094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1598711a3781SMychaela N. Falconia 15998f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 16008f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 16018f977e42SIan Abbott if (version < 0x500) { 1602bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, 1603bfc51614SGreg Kroah-Hartman "%s: something fishy - bcdDevice too low for multi-interface device\n", 1604441b62c1SHarvey Harrison __func__); 16058f977e42SIan Abbott } 16068f977e42SIan Abbott } else if (version < 0x200) { 1607330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 16088f977e42SIan Abbott priv->chip_type = SIO; 16098f977e42SIan Abbott priv->baud_base = 12000000 / 16; 16108f977e42SIan Abbott } else if (version < 0x400) { 1611330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 16128f977e42SIan Abbott priv->chip_type = FT8U232AM; 16137e1e6cedSIan Abbott /* 16147e1e6cedSIan Abbott * It might be a BM type because of the iSerialNumber bug. 16157e1e6cedSIan Abbott * If iSerialNumber==0 and the latency timer is readable, 16167e1e6cedSIan Abbott * assume it is BM type. 16177e1e6cedSIan Abbott */ 16187e1e6cedSIan Abbott if (udev->descriptor.iSerialNumber == 0 && 16197e1e6cedSIan Abbott _read_latency_timer(port) >= 0) { 16207e1e6cedSIan Abbott dev_dbg(&port->dev, 16217e1e6cedSIan Abbott "%s: has latency timer so not an AM type\n", 16227e1e6cedSIan Abbott __func__); 16237e1e6cedSIan Abbott priv->chip_type = FT232BM; 16247e1e6cedSIan Abbott } 16253b009c63SDavid Brownell } else if (version < 0x600) { 1626330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 16278f977e42SIan Abbott priv->chip_type = FT232BM; 1628309427b6SUwe Bonnes } else if (version < 0x900) { 1629309427b6SUwe Bonnes /* Assume it's an FT232RL */ 16303b009c63SDavid Brownell priv->chip_type = FT232RL; 1631dc0827c1SJim Paris } else if (version < 0x1000) { 1632309427b6SUwe Bonnes /* Assume it's an FT232H */ 1633309427b6SUwe Bonnes priv->chip_type = FT232H; 1634dc0827c1SJim Paris } else { 1635dc0827c1SJim Paris /* Assume it's an FT-X series device */ 1636dc0827c1SJim Paris priv->chip_type = FTX; 16378f977e42SIan Abbott } 1638dc0827c1SJim Paris 1639c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 16408f977e42SIan Abbott } 16418f977e42SIan Abbott 16428f977e42SIan Abbott 164347e57595SJohan Hovold /* 164447e57595SJohan Hovold * Determine the maximum packet size for the device. This depends on the chip 1645895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 164647e57595SJohan Hovold * device descriptor as the chip will use the appropriate values for the host. 164747e57595SJohan Hovold */ 1648895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1649895f28baSMark Adamson { 1650895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 165147e57595SJohan Hovold struct usb_interface *interface = port->serial->interface; 1652aea1ae87SJohan Hovold struct usb_endpoint_descriptor *ep_desc; 1653895f28baSMark Adamson unsigned num_endpoints; 1654aea1ae87SJohan Hovold unsigned i; 1655895f28baSMark Adamson 1656895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1657aea1ae87SJohan Hovold if (!num_endpoints) 1658aea1ae87SJohan Hovold return; 1659aea1ae87SJohan Hovold 166047e57595SJohan Hovold /* 166147e57595SJohan Hovold * NOTE: Some customers have programmed FT232R/FT245R devices 1662895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1663895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 166447e57595SJohan Hovold * value of 64 for wMaxPacketSize. 166547e57595SJohan Hovold */ 1666895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1667895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 166847e57595SJohan Hovold if (!ep_desc->wMaxPacketSize) { 1669895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1670a90d84adSJohan Hovold dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n", 1671a90d84adSJohan Hovold usb_endpoint_num(ep_desc)); 1672895f28baSMark Adamson } 1673895f28baSMark Adamson } 1674895f28baSMark Adamson 167547e57595SJohan Hovold /* Set max packet size based on last descriptor. */ 167629cc8897SKuninori Morimoto priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1677895f28baSMark Adamson } 1678895f28baSMark Adamson 1679895f28baSMark Adamson 16801da177e4SLinus Torvalds /* 16811da177e4SLinus Torvalds * *************************************************************************** 16821da177e4SLinus Torvalds * Sysfs Attribute 16831da177e4SLinus Torvalds * *************************************************************************** 16841da177e4SLinus Torvalds */ 16851da177e4SLinus Torvalds 1686154547c4SGreg Kroah-Hartman static ssize_t latency_timer_show(struct device *dev, 1687464cbb24SAlan Cox struct device_attribute *attr, char *buf) 16881da177e4SLinus Torvalds { 16891da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16901da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1691557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1692557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1693557aaa7fSAlan Cox else 1694557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 16951da177e4SLinus Torvalds } 1696557aaa7fSAlan Cox 16971da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1698154547c4SGreg Kroah-Hartman static ssize_t latency_timer_store(struct device *dev, 1699154547c4SGreg Kroah-Hartman struct device_attribute *attr, 1700154547c4SGreg Kroah-Hartman const char *valbuf, size_t count) 17011da177e4SLinus Torvalds { 17021da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 17031da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1704db924066SIan Abbott u8 v; 1705c1284d77SJohan Hovold int rv; 17061da177e4SLinus Torvalds 1707db924066SIan Abbott if (kstrtou8(valbuf, 10, &v)) 1708db924066SIan Abbott return -EINVAL; 1709db924066SIan Abbott 1710557aaa7fSAlan Cox priv->latency = v; 1711557aaa7fSAlan Cox rv = write_latency_timer(port); 1712557aaa7fSAlan Cox if (rv < 0) 17131da177e4SLinus Torvalds return -EIO; 17141da177e4SLinus Torvalds return count; 17151da177e4SLinus Torvalds } 1716154547c4SGreg Kroah-Hartman static DEVICE_ATTR_RW(latency_timer); 17171da177e4SLinus Torvalds 17181da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 17191da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1720ca35910aSGreg Kroah-Hartman static ssize_t event_char_store(struct device *dev, 1721464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 17221da177e4SLinus Torvalds { 17231da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 17241da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 172512bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 1726d0559a2fSIan Abbott unsigned int v; 1727c1284d77SJohan Hovold int rv; 17281da177e4SLinus Torvalds 1729f1ce25f2SIan Abbott if (kstrtouint(valbuf, 0, &v) || v >= 0x200) 1730d0559a2fSIan Abbott return -EINVAL; 1731d0559a2fSIan Abbott 1732f1ce25f2SIan Abbott dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v); 17331da177e4SLinus Torvalds 17341da177e4SLinus Torvalds rv = usb_control_msg(udev, 17351da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 17361da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 17371da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 17381da177e4SLinus Torvalds v, priv->interface, 173966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 17401da177e4SLinus Torvalds if (rv < 0) { 1741bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); 17421da177e4SLinus Torvalds return -EIO; 17431da177e4SLinus Torvalds } 17441da177e4SLinus Torvalds 17451da177e4SLinus Torvalds return count; 17461da177e4SLinus Torvalds } 1747ca35910aSGreg Kroah-Hartman static DEVICE_ATTR_WO(event_char); 17481da177e4SLinus Torvalds 174912bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 17501da177e4SLinus Torvalds { 175112bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 175213f4db9eSGreg Kroah-Hartman int retval = 0; 17531da177e4SLinus Torvalds 17541da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 17551da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 17561da177e4SLinus Torvalds if (priv->chip_type != SIO) { 1757bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 175812bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 175913f4db9eSGreg Kroah-Hartman if ((!retval) && 176097cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 176197cd49ebSStepan Moskovchenko priv->chip_type == FT2232C || 1762094c2e6dSMark Adamson priv->chip_type == FT232RL || 1763094c2e6dSMark Adamson priv->chip_type == FT2232H || 1764309427b6SUwe Bonnes priv->chip_type == FT4232H || 1765dc0827c1SJim Paris priv->chip_type == FT232H || 1766dc0827c1SJim Paris priv->chip_type == FTX)) { 176712bdbe03SJim Radford retval = device_create_file(&port->dev, 176813f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 17691da177e4SLinus Torvalds } 17701da177e4SLinus Torvalds } 177113f4db9eSGreg Kroah-Hartman return retval; 17721da177e4SLinus Torvalds } 17731da177e4SLinus Torvalds 177412bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 17751da177e4SLinus Torvalds { 177612bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 17771da177e4SLinus Torvalds 17781da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 17791da177e4SLinus Torvalds if (priv->chip_type != SIO) { 178012bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1781ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1782ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1783094c2e6dSMark Adamson priv->chip_type == FT232RL || 1784094c2e6dSMark Adamson priv->chip_type == FT2232H || 1785309427b6SUwe Bonnes priv->chip_type == FT4232H || 1786dc0827c1SJim Paris priv->chip_type == FT232H || 1787dc0827c1SJim Paris priv->chip_type == FTX) { 178812bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 17891da177e4SLinus Torvalds } 17901da177e4SLinus Torvalds } 17911da177e4SLinus Torvalds 17921da177e4SLinus Torvalds } 17931da177e4SLinus Torvalds 1794ba93cc7dSKaroly Pados #ifdef CONFIG_GPIOLIB 1795ba93cc7dSKaroly Pados 1796ba93cc7dSKaroly Pados static int ftdi_set_bitmode(struct usb_serial_port *port, u8 mode) 1797ba93cc7dSKaroly Pados { 1798ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1799ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 1800ba93cc7dSKaroly Pados int result; 1801ba93cc7dSKaroly Pados u16 val; 1802ba93cc7dSKaroly Pados 1803a8eda9faSKaroly Pados result = usb_autopm_get_interface(serial->interface); 1804a8eda9faSKaroly Pados if (result) 1805a8eda9faSKaroly Pados return result; 1806a8eda9faSKaroly Pados 1807ba93cc7dSKaroly Pados val = (mode << 8) | (priv->gpio_output << 4) | priv->gpio_value; 1808ba93cc7dSKaroly Pados result = usb_control_msg(serial->dev, 1809ba93cc7dSKaroly Pados usb_sndctrlpipe(serial->dev, 0), 1810ba93cc7dSKaroly Pados FTDI_SIO_SET_BITMODE_REQUEST, 1811ba93cc7dSKaroly Pados FTDI_SIO_SET_BITMODE_REQUEST_TYPE, val, 1812ba93cc7dSKaroly Pados priv->interface, NULL, 0, WDR_TIMEOUT); 1813ba93cc7dSKaroly Pados if (result < 0) { 1814ba93cc7dSKaroly Pados dev_err(&serial->interface->dev, 1815ba93cc7dSKaroly Pados "bitmode request failed for value 0x%04x: %d\n", 1816ba93cc7dSKaroly Pados val, result); 1817ba93cc7dSKaroly Pados } 1818ba93cc7dSKaroly Pados 1819a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1820a8eda9faSKaroly Pados 1821ba93cc7dSKaroly Pados return result; 1822ba93cc7dSKaroly Pados } 1823ba93cc7dSKaroly Pados 1824ba93cc7dSKaroly Pados static int ftdi_set_cbus_pins(struct usb_serial_port *port) 1825ba93cc7dSKaroly Pados { 1826ba93cc7dSKaroly Pados return ftdi_set_bitmode(port, FTDI_SIO_BITMODE_CBUS); 1827ba93cc7dSKaroly Pados } 1828ba93cc7dSKaroly Pados 1829ba93cc7dSKaroly Pados static int ftdi_exit_cbus_mode(struct usb_serial_port *port) 1830ba93cc7dSKaroly Pados { 1831ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1832ba93cc7dSKaroly Pados 1833ba93cc7dSKaroly Pados priv->gpio_output = 0; 1834ba93cc7dSKaroly Pados priv->gpio_value = 0; 1835ba93cc7dSKaroly Pados return ftdi_set_bitmode(port, FTDI_SIO_BITMODE_RESET); 1836ba93cc7dSKaroly Pados } 1837ba93cc7dSKaroly Pados 1838ba93cc7dSKaroly Pados static int ftdi_gpio_request(struct gpio_chip *gc, unsigned int offset) 1839ba93cc7dSKaroly Pados { 1840ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1841ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1842ba93cc7dSKaroly Pados int result; 1843ba93cc7dSKaroly Pados 1844ba93cc7dSKaroly Pados if (priv->gpio_altfunc & BIT(offset)) 1845ba93cc7dSKaroly Pados return -ENODEV; 1846ba93cc7dSKaroly Pados 1847ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1848ba93cc7dSKaroly Pados if (!priv->gpio_used) { 1849ba93cc7dSKaroly Pados /* Set default pin states, as we cannot get them from device */ 1850ba93cc7dSKaroly Pados priv->gpio_output = 0x00; 1851ba93cc7dSKaroly Pados priv->gpio_value = 0x00; 1852ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1853ba93cc7dSKaroly Pados if (result) { 1854ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1855ba93cc7dSKaroly Pados return result; 1856ba93cc7dSKaroly Pados } 1857ba93cc7dSKaroly Pados 1858ba93cc7dSKaroly Pados priv->gpio_used = true; 1859ba93cc7dSKaroly Pados } 1860ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1861ba93cc7dSKaroly Pados 1862ba93cc7dSKaroly Pados return 0; 1863ba93cc7dSKaroly Pados } 1864ba93cc7dSKaroly Pados 1865ba93cc7dSKaroly Pados static int ftdi_read_cbus_pins(struct usb_serial_port *port) 1866ba93cc7dSKaroly Pados { 1867ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1868ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 1869ba93cc7dSKaroly Pados unsigned char *buf; 1870ba93cc7dSKaroly Pados int result; 1871ba93cc7dSKaroly Pados 1872a8eda9faSKaroly Pados result = usb_autopm_get_interface(serial->interface); 1873a8eda9faSKaroly Pados if (result) 1874a8eda9faSKaroly Pados return result; 1875a8eda9faSKaroly Pados 1876ba93cc7dSKaroly Pados buf = kmalloc(1, GFP_KERNEL); 1877a8eda9faSKaroly Pados if (!buf) { 1878a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1879ba93cc7dSKaroly Pados return -ENOMEM; 1880a8eda9faSKaroly Pados } 1881ba93cc7dSKaroly Pados 1882ba93cc7dSKaroly Pados result = usb_control_msg(serial->dev, 1883ba93cc7dSKaroly Pados usb_rcvctrlpipe(serial->dev, 0), 1884ba93cc7dSKaroly Pados FTDI_SIO_READ_PINS_REQUEST, 1885ba93cc7dSKaroly Pados FTDI_SIO_READ_PINS_REQUEST_TYPE, 0, 1886ba93cc7dSKaroly Pados priv->interface, buf, 1, WDR_TIMEOUT); 1887ba93cc7dSKaroly Pados if (result < 1) { 1888ba93cc7dSKaroly Pados if (result >= 0) 1889ba93cc7dSKaroly Pados result = -EIO; 1890ba93cc7dSKaroly Pados } else { 1891ba93cc7dSKaroly Pados result = buf[0]; 1892ba93cc7dSKaroly Pados } 1893ba93cc7dSKaroly Pados 1894ba93cc7dSKaroly Pados kfree(buf); 1895a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1896ba93cc7dSKaroly Pados 1897ba93cc7dSKaroly Pados return result; 1898ba93cc7dSKaroly Pados } 1899ba93cc7dSKaroly Pados 1900ba93cc7dSKaroly Pados static int ftdi_gpio_get(struct gpio_chip *gc, unsigned int gpio) 1901ba93cc7dSKaroly Pados { 1902ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1903ba93cc7dSKaroly Pados int result; 1904ba93cc7dSKaroly Pados 1905ba93cc7dSKaroly Pados result = ftdi_read_cbus_pins(port); 1906ba93cc7dSKaroly Pados if (result < 0) 1907ba93cc7dSKaroly Pados return result; 1908ba93cc7dSKaroly Pados 1909ba93cc7dSKaroly Pados return !!(result & BIT(gpio)); 1910ba93cc7dSKaroly Pados } 1911ba93cc7dSKaroly Pados 1912ba93cc7dSKaroly Pados static void ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1913ba93cc7dSKaroly Pados { 1914ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1915ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1916ba93cc7dSKaroly Pados 1917ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1918ba93cc7dSKaroly Pados 1919ba93cc7dSKaroly Pados if (value) 1920ba93cc7dSKaroly Pados priv->gpio_value |= BIT(gpio); 1921ba93cc7dSKaroly Pados else 1922ba93cc7dSKaroly Pados priv->gpio_value &= ~BIT(gpio); 1923ba93cc7dSKaroly Pados 1924ba93cc7dSKaroly Pados ftdi_set_cbus_pins(port); 1925ba93cc7dSKaroly Pados 1926ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1927ba93cc7dSKaroly Pados } 1928ba93cc7dSKaroly Pados 1929ba93cc7dSKaroly Pados static int ftdi_gpio_get_multiple(struct gpio_chip *gc, unsigned long *mask, 1930ba93cc7dSKaroly Pados unsigned long *bits) 1931ba93cc7dSKaroly Pados { 1932ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1933ba93cc7dSKaroly Pados int result; 1934ba93cc7dSKaroly Pados 1935ba93cc7dSKaroly Pados result = ftdi_read_cbus_pins(port); 1936ba93cc7dSKaroly Pados if (result < 0) 1937ba93cc7dSKaroly Pados return result; 1938ba93cc7dSKaroly Pados 1939ba93cc7dSKaroly Pados *bits = result & *mask; 1940ba93cc7dSKaroly Pados 1941ba93cc7dSKaroly Pados return 0; 1942ba93cc7dSKaroly Pados } 1943ba93cc7dSKaroly Pados 1944ba93cc7dSKaroly Pados static void ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask, 1945ba93cc7dSKaroly Pados unsigned long *bits) 1946ba93cc7dSKaroly Pados { 1947ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1948ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1949ba93cc7dSKaroly Pados 1950ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1951ba93cc7dSKaroly Pados 1952ba93cc7dSKaroly Pados priv->gpio_value &= ~(*mask); 1953ba93cc7dSKaroly Pados priv->gpio_value |= *bits & *mask; 1954ba93cc7dSKaroly Pados ftdi_set_cbus_pins(port); 1955ba93cc7dSKaroly Pados 1956ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1957ba93cc7dSKaroly Pados } 1958ba93cc7dSKaroly Pados 1959ba93cc7dSKaroly Pados static int ftdi_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio) 1960ba93cc7dSKaroly Pados { 1961ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1962ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1963ba93cc7dSKaroly Pados 1964ba93cc7dSKaroly Pados return !(priv->gpio_output & BIT(gpio)); 1965ba93cc7dSKaroly Pados } 1966ba93cc7dSKaroly Pados 1967ba93cc7dSKaroly Pados static int ftdi_gpio_direction_input(struct gpio_chip *gc, unsigned int gpio) 1968ba93cc7dSKaroly Pados { 1969ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1970ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1971ba93cc7dSKaroly Pados int result; 1972ba93cc7dSKaroly Pados 1973ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1974ba93cc7dSKaroly Pados 1975ba93cc7dSKaroly Pados priv->gpio_output &= ~BIT(gpio); 1976ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1977ba93cc7dSKaroly Pados 1978ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1979ba93cc7dSKaroly Pados 1980ba93cc7dSKaroly Pados return result; 1981ba93cc7dSKaroly Pados } 1982ba93cc7dSKaroly Pados 1983ba93cc7dSKaroly Pados static int ftdi_gpio_direction_output(struct gpio_chip *gc, unsigned int gpio, 1984ba93cc7dSKaroly Pados int value) 1985ba93cc7dSKaroly Pados { 1986ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1987ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1988ba93cc7dSKaroly Pados int result; 1989ba93cc7dSKaroly Pados 1990ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1991ba93cc7dSKaroly Pados 1992ba93cc7dSKaroly Pados priv->gpio_output |= BIT(gpio); 1993ba93cc7dSKaroly Pados if (value) 1994ba93cc7dSKaroly Pados priv->gpio_value |= BIT(gpio); 1995ba93cc7dSKaroly Pados else 1996ba93cc7dSKaroly Pados priv->gpio_value &= ~BIT(gpio); 1997ba93cc7dSKaroly Pados 1998ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1999ba93cc7dSKaroly Pados 2000ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 2001ba93cc7dSKaroly Pados 2002ba93cc7dSKaroly Pados return result; 2003ba93cc7dSKaroly Pados } 2004ba93cc7dSKaroly Pados 2005*11fb08cfSMarc Zyngier static int ftdi_gpio_init_valid_mask(struct gpio_chip *gc, 2006*11fb08cfSMarc Zyngier unsigned long *valid_mask, 2007*11fb08cfSMarc Zyngier unsigned int ngpios) 2008*11fb08cfSMarc Zyngier { 2009*11fb08cfSMarc Zyngier struct usb_serial_port *port = gpiochip_get_data(gc); 2010*11fb08cfSMarc Zyngier struct ftdi_private *priv = usb_get_serial_port_data(port); 2011*11fb08cfSMarc Zyngier unsigned long map = priv->gpio_altfunc; 2012*11fb08cfSMarc Zyngier 2013*11fb08cfSMarc Zyngier bitmap_complement(valid_mask, &map, ngpios); 2014*11fb08cfSMarc Zyngier 2015*11fb08cfSMarc Zyngier return 0; 2016*11fb08cfSMarc Zyngier } 2017*11fb08cfSMarc Zyngier 2018ba93cc7dSKaroly Pados static int ftdi_read_eeprom(struct usb_serial *serial, void *dst, u16 addr, 2019ba93cc7dSKaroly Pados u16 nbytes) 2020ba93cc7dSKaroly Pados { 2021ba93cc7dSKaroly Pados int read = 0; 2022ba93cc7dSKaroly Pados 2023ba93cc7dSKaroly Pados if (addr % 2 != 0) 2024ba93cc7dSKaroly Pados return -EINVAL; 2025ba93cc7dSKaroly Pados if (nbytes % 2 != 0) 2026ba93cc7dSKaroly Pados return -EINVAL; 2027ba93cc7dSKaroly Pados 2028ba93cc7dSKaroly Pados /* Read EEPROM two bytes at a time */ 2029ba93cc7dSKaroly Pados while (read < nbytes) { 2030ba93cc7dSKaroly Pados int rv; 2031ba93cc7dSKaroly Pados 2032ba93cc7dSKaroly Pados rv = usb_control_msg(serial->dev, 2033ba93cc7dSKaroly Pados usb_rcvctrlpipe(serial->dev, 0), 2034ba93cc7dSKaroly Pados FTDI_SIO_READ_EEPROM_REQUEST, 2035ba93cc7dSKaroly Pados FTDI_SIO_READ_EEPROM_REQUEST_TYPE, 2036ba93cc7dSKaroly Pados 0, (addr + read) / 2, dst + read, 2, 2037ba93cc7dSKaroly Pados WDR_TIMEOUT); 2038ba93cc7dSKaroly Pados if (rv < 2) { 2039ba93cc7dSKaroly Pados if (rv >= 0) 2040ba93cc7dSKaroly Pados return -EIO; 2041ba93cc7dSKaroly Pados else 2042ba93cc7dSKaroly Pados return rv; 2043ba93cc7dSKaroly Pados } 2044ba93cc7dSKaroly Pados 2045ba93cc7dSKaroly Pados read += rv; 2046ba93cc7dSKaroly Pados } 2047ba93cc7dSKaroly Pados 2048ba93cc7dSKaroly Pados return 0; 2049ba93cc7dSKaroly Pados } 2050ba93cc7dSKaroly Pados 20517a786b84SMatthew Michilot static int ftdi_gpio_init_ft232h(struct usb_serial_port *port) 20527a786b84SMatthew Michilot { 20537a786b84SMatthew Michilot struct ftdi_private *priv = usb_get_serial_port_data(port); 20547a786b84SMatthew Michilot u16 cbus_config; 20557a786b84SMatthew Michilot u8 *buf; 20567a786b84SMatthew Michilot int ret; 20577a786b84SMatthew Michilot int i; 20587a786b84SMatthew Michilot 20597a786b84SMatthew Michilot buf = kmalloc(4, GFP_KERNEL); 20607a786b84SMatthew Michilot if (!buf) 20617a786b84SMatthew Michilot return -ENOMEM; 20627a786b84SMatthew Michilot 20637a786b84SMatthew Michilot ret = ftdi_read_eeprom(port->serial, buf, 0x1a, 4); 20647a786b84SMatthew Michilot if (ret < 0) 20657a786b84SMatthew Michilot goto out_free; 20667a786b84SMatthew Michilot 20677a786b84SMatthew Michilot /* 20687a786b84SMatthew Michilot * FT232H CBUS Memory Map 20697a786b84SMatthew Michilot * 20707a786b84SMatthew Michilot * 0x1a: X- (upper nibble -> AC5) 20717a786b84SMatthew Michilot * 0x1b: -X (lower nibble -> AC6) 20727a786b84SMatthew Michilot * 0x1c: XX (upper nibble -> AC9 | lower nibble -> AC8) 20737a786b84SMatthew Michilot */ 20747a786b84SMatthew Michilot cbus_config = buf[2] << 8 | (buf[1] & 0xf) << 4 | (buf[0] & 0xf0) >> 4; 20757a786b84SMatthew Michilot 20767a786b84SMatthew Michilot priv->gc.ngpio = 4; 20777a786b84SMatthew Michilot priv->gpio_altfunc = 0xff; 20787a786b84SMatthew Michilot 20797a786b84SMatthew Michilot for (i = 0; i < priv->gc.ngpio; ++i) { 20807a786b84SMatthew Michilot if ((cbus_config & 0xf) == FTDI_FTX_CBUS_MUX_GPIO) 20817a786b84SMatthew Michilot priv->gpio_altfunc &= ~BIT(i); 20827a786b84SMatthew Michilot cbus_config >>= 4; 20837a786b84SMatthew Michilot } 20847a786b84SMatthew Michilot 20857a786b84SMatthew Michilot out_free: 20867a786b84SMatthew Michilot kfree(buf); 20877a786b84SMatthew Michilot 20887a786b84SMatthew Michilot return ret; 20897a786b84SMatthew Michilot } 20907a786b84SMatthew Michilot 2091ff32d97eSJohan Hovold static int ftdi_gpio_init_ft232r(struct usb_serial_port *port) 2092ff32d97eSJohan Hovold { 2093ff32d97eSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2094ff32d97eSJohan Hovold u16 cbus_config; 2095ff32d97eSJohan Hovold u8 *buf; 2096ff32d97eSJohan Hovold int ret; 2097ff32d97eSJohan Hovold int i; 2098ff32d97eSJohan Hovold 2099ff32d97eSJohan Hovold buf = kmalloc(2, GFP_KERNEL); 2100ff32d97eSJohan Hovold if (!buf) 2101ff32d97eSJohan Hovold return -ENOMEM; 2102ff32d97eSJohan Hovold 2103ff32d97eSJohan Hovold ret = ftdi_read_eeprom(port->serial, buf, 0x14, 2); 2104ff32d97eSJohan Hovold if (ret < 0) 2105ff32d97eSJohan Hovold goto out_free; 2106ff32d97eSJohan Hovold 2107ff32d97eSJohan Hovold cbus_config = le16_to_cpup((__le16 *)buf); 2108ff32d97eSJohan Hovold dev_dbg(&port->dev, "cbus_config = 0x%04x\n", cbus_config); 2109ff32d97eSJohan Hovold 2110ff32d97eSJohan Hovold priv->gc.ngpio = 4; 2111ff32d97eSJohan Hovold 2112ff32d97eSJohan Hovold priv->gpio_altfunc = 0xff; 2113ff32d97eSJohan Hovold for (i = 0; i < priv->gc.ngpio; ++i) { 2114ff32d97eSJohan Hovold if ((cbus_config & 0xf) == FTDI_FT232R_CBUS_MUX_GPIO) 2115ff32d97eSJohan Hovold priv->gpio_altfunc &= ~BIT(i); 2116ff32d97eSJohan Hovold cbus_config >>= 4; 2117ff32d97eSJohan Hovold } 2118ff32d97eSJohan Hovold out_free: 2119ff32d97eSJohan Hovold kfree(buf); 2120ff32d97eSJohan Hovold 2121ff32d97eSJohan Hovold return ret; 2122ff32d97eSJohan Hovold } 2123ff32d97eSJohan Hovold 2124ff32d97eSJohan Hovold static int ftdi_gpio_init_ftx(struct usb_serial_port *port) 2125ba93cc7dSKaroly Pados { 2126ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2127ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 2128ba93cc7dSKaroly Pados const u16 cbus_cfg_addr = 0x1a; 2129ba93cc7dSKaroly Pados const u16 cbus_cfg_size = 4; 2130ba93cc7dSKaroly Pados u8 *cbus_cfg_buf; 2131ba93cc7dSKaroly Pados int result; 2132ba93cc7dSKaroly Pados u8 i; 2133ba93cc7dSKaroly Pados 2134ba93cc7dSKaroly Pados cbus_cfg_buf = kmalloc(cbus_cfg_size, GFP_KERNEL); 2135ba93cc7dSKaroly Pados if (!cbus_cfg_buf) 2136ba93cc7dSKaroly Pados return -ENOMEM; 2137ba93cc7dSKaroly Pados 2138ba93cc7dSKaroly Pados result = ftdi_read_eeprom(serial, cbus_cfg_buf, 2139ba93cc7dSKaroly Pados cbus_cfg_addr, cbus_cfg_size); 2140ba93cc7dSKaroly Pados if (result < 0) 2141ba93cc7dSKaroly Pados goto out_free; 2142ba93cc7dSKaroly Pados 2143ba93cc7dSKaroly Pados /* FIXME: FT234XD alone has 1 GPIO, but how to recognize this IC? */ 2144ba93cc7dSKaroly Pados priv->gc.ngpio = 4; 2145ba93cc7dSKaroly Pados 2146ba93cc7dSKaroly Pados /* Determine which pins are configured for CBUS bitbanging */ 2147ba93cc7dSKaroly Pados priv->gpio_altfunc = 0xff; 2148ba93cc7dSKaroly Pados for (i = 0; i < priv->gc.ngpio; ++i) { 2149ba93cc7dSKaroly Pados if (cbus_cfg_buf[i] == FTDI_FTX_CBUS_MUX_GPIO) 2150ba93cc7dSKaroly Pados priv->gpio_altfunc &= ~BIT(i); 2151ba93cc7dSKaroly Pados } 2152ba93cc7dSKaroly Pados 2153ba93cc7dSKaroly Pados out_free: 2154ba93cc7dSKaroly Pados kfree(cbus_cfg_buf); 2155ba93cc7dSKaroly Pados 2156ba93cc7dSKaroly Pados return result; 2157ba93cc7dSKaroly Pados } 2158ba93cc7dSKaroly Pados 2159ba93cc7dSKaroly Pados static int ftdi_gpio_init(struct usb_serial_port *port) 2160ba93cc7dSKaroly Pados { 2161ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2162ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 2163ba93cc7dSKaroly Pados int result; 2164ba93cc7dSKaroly Pados 2165ba93cc7dSKaroly Pados switch (priv->chip_type) { 21667a786b84SMatthew Michilot case FT232H: 21677a786b84SMatthew Michilot result = ftdi_gpio_init_ft232h(port); 21687a786b84SMatthew Michilot break; 2169ff32d97eSJohan Hovold case FT232RL: 2170ff32d97eSJohan Hovold result = ftdi_gpio_init_ft232r(port); 2171ff32d97eSJohan Hovold break; 2172ba93cc7dSKaroly Pados case FTX: 2173ff32d97eSJohan Hovold result = ftdi_gpio_init_ftx(port); 2174ba93cc7dSKaroly Pados break; 2175ba93cc7dSKaroly Pados default: 2176ba93cc7dSKaroly Pados return 0; 2177ba93cc7dSKaroly Pados } 2178ba93cc7dSKaroly Pados 2179ba93cc7dSKaroly Pados if (result < 0) 2180ba93cc7dSKaroly Pados return result; 2181ba93cc7dSKaroly Pados 2182ba93cc7dSKaroly Pados mutex_init(&priv->gpio_lock); 2183ba93cc7dSKaroly Pados 2184ba93cc7dSKaroly Pados priv->gc.label = "ftdi-cbus"; 2185ba93cc7dSKaroly Pados priv->gc.request = ftdi_gpio_request; 2186ba93cc7dSKaroly Pados priv->gc.get_direction = ftdi_gpio_direction_get; 2187ba93cc7dSKaroly Pados priv->gc.direction_input = ftdi_gpio_direction_input; 2188ba93cc7dSKaroly Pados priv->gc.direction_output = ftdi_gpio_direction_output; 2189*11fb08cfSMarc Zyngier priv->gc.init_valid_mask = ftdi_gpio_init_valid_mask; 2190ba93cc7dSKaroly Pados priv->gc.get = ftdi_gpio_get; 2191ba93cc7dSKaroly Pados priv->gc.set = ftdi_gpio_set; 2192ba93cc7dSKaroly Pados priv->gc.get_multiple = ftdi_gpio_get_multiple; 2193ba93cc7dSKaroly Pados priv->gc.set_multiple = ftdi_gpio_set_multiple; 2194ba93cc7dSKaroly Pados priv->gc.owner = THIS_MODULE; 2195ba93cc7dSKaroly Pados priv->gc.parent = &serial->interface->dev; 2196ba93cc7dSKaroly Pados priv->gc.base = -1; 2197ba93cc7dSKaroly Pados priv->gc.can_sleep = true; 2198ba93cc7dSKaroly Pados 2199ba93cc7dSKaroly Pados result = gpiochip_add_data(&priv->gc, port); 2200ba93cc7dSKaroly Pados if (!result) 2201ba93cc7dSKaroly Pados priv->gpio_registered = true; 2202ba93cc7dSKaroly Pados 2203ba93cc7dSKaroly Pados return result; 2204ba93cc7dSKaroly Pados } 2205ba93cc7dSKaroly Pados 2206ba93cc7dSKaroly Pados static void ftdi_gpio_remove(struct usb_serial_port *port) 2207ba93cc7dSKaroly Pados { 2208ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2209ba93cc7dSKaroly Pados 2210ba93cc7dSKaroly Pados if (priv->gpio_registered) { 2211ba93cc7dSKaroly Pados gpiochip_remove(&priv->gc); 2212ba93cc7dSKaroly Pados priv->gpio_registered = false; 2213ba93cc7dSKaroly Pados } 2214ba93cc7dSKaroly Pados 2215ba93cc7dSKaroly Pados if (priv->gpio_used) { 2216ba93cc7dSKaroly Pados /* Exiting CBUS-mode does not reset pin states. */ 2217ba93cc7dSKaroly Pados ftdi_exit_cbus_mode(port); 2218ba93cc7dSKaroly Pados priv->gpio_used = false; 2219ba93cc7dSKaroly Pados } 2220ba93cc7dSKaroly Pados } 2221ba93cc7dSKaroly Pados 2222ba93cc7dSKaroly Pados #else 2223ba93cc7dSKaroly Pados 2224ba93cc7dSKaroly Pados static int ftdi_gpio_init(struct usb_serial_port *port) 2225ba93cc7dSKaroly Pados { 2226ba93cc7dSKaroly Pados return 0; 2227ba93cc7dSKaroly Pados } 2228ba93cc7dSKaroly Pados 2229ba93cc7dSKaroly Pados static void ftdi_gpio_remove(struct usb_serial_port *port) { } 2230ba93cc7dSKaroly Pados 2231ba93cc7dSKaroly Pados #endif /* CONFIG_GPIOLIB */ 2232ba93cc7dSKaroly Pados 22331da177e4SLinus Torvalds /* 22341da177e4SLinus Torvalds * *************************************************************************** 22351da177e4SLinus Torvalds * FTDI driver specific functions 22361da177e4SLinus Torvalds * *************************************************************************** 22371da177e4SLinus Torvalds */ 22381da177e4SLinus Torvalds 22398f977e42SIan Abbott /* Probe function to check for special devices */ 2240464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 2241464cbb24SAlan Cox const struct usb_device_id *id) 22428f977e42SIan Abbott { 22433c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = 2244464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 2245fa91d43bSTony Lindgren 2246fa91d43bSTony Lindgren if (quirk && quirk->probe) { 2247fa91d43bSTony Lindgren int ret = quirk->probe(serial); 2248fa91d43bSTony Lindgren if (ret != 0) 2249fa91d43bSTony Lindgren return ret; 2250fa91d43bSTony Lindgren } 2251fa91d43bSTony Lindgren 22528f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 22538f977e42SIan Abbott 2254fa91d43bSTony Lindgren return 0; 22558f977e42SIan Abbott } 22568f977e42SIan Abbott 225712bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 22581da177e4SLinus Torvalds { 22591da177e4SLinus Torvalds struct ftdi_private *priv; 22603c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 2261ba93cc7dSKaroly Pados int result; 22621da177e4SLinus Torvalds 226380b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 226410c642d0SJohan Hovold if (!priv) 22651da177e4SLinus Torvalds return -ENOMEM; 22661da177e4SLinus Torvalds 2267bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 22680076b4beSJohan Hovold 22690ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 22700ffbbe25SOliver Neukum quirk->port_probe(priv); 22710ffbbe25SOliver Neukum 227212bdbe03SJim Radford usb_set_serial_port_data(port, priv); 22731da177e4SLinus Torvalds 227412bdbe03SJim Radford ftdi_determine_type(port); 2275895f28baSMark Adamson ftdi_set_max_packet_size(port); 22768c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 22778c4f99cdSJohan Hovold priv->latency = 16; 2278c19db4c9SJohan Hovold write_latency_timer(port); 227912bdbe03SJim Radford create_sysfs_attrs(port); 2280ba93cc7dSKaroly Pados 2281ba93cc7dSKaroly Pados result = ftdi_gpio_init(port); 2282ba93cc7dSKaroly Pados if (result < 0) { 2283ba93cc7dSKaroly Pados dev_err(&port->serial->interface->dev, 2284ba93cc7dSKaroly Pados "GPIO initialisation failed: %d\n", 2285ba93cc7dSKaroly Pados result); 2286ba93cc7dSKaroly Pados } 2287ba93cc7dSKaroly Pados 228812bdbe03SJim Radford return 0; 22891da177e4SLinus Torvalds } 22901da177e4SLinus Torvalds 22918f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 22928f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 22931da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 22940ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 22951da177e4SLinus Torvalds { 22961da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 22971da177e4SLinus Torvalds priv->custom_divisor = 77; 2298669a6db1SAlan Cox priv->force_baud = 38400; 2299e49bbce1SJohan Hovold } 23001da177e4SLinus Torvalds 23018f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 23028f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 2303464cbb24SAlan Cox 23040ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 23058f977e42SIan Abbott { 23061da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 23071da177e4SLinus Torvalds priv->custom_divisor = 240; 2308669a6db1SAlan Cox priv->force_baud = 38400; 23091da177e4SLinus Torvalds priv->force_rtscts = 1; 2310e49bbce1SJohan Hovold } 23111da177e4SLinus Torvalds 2312fa91d43bSTony Lindgren /* 2313b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 2314970e2486SLucas De Marchi * If this value is not set in /etc/modprobe.d/ its value will be set 2315970e2486SLucas De Marchi * to 1ms. 2316b760dac2SMartin Geleynse */ 2317b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 2318b760dac2SMartin Geleynse 2319b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 2320b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 2321b760dac2SMartin Geleynse * 2322b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 2323b760dac2SMartin Geleynse */ 2324b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 2325b760dac2SMartin Geleynse { 2326b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 2327b760dac2SMartin Geleynse int latency = ndi_latency_timer; 2328b760dac2SMartin Geleynse 2329b760dac2SMartin Geleynse if (latency == 0) 2330b760dac2SMartin Geleynse latency = 1; 2331b760dac2SMartin Geleynse if (latency > 99) 2332b760dac2SMartin Geleynse latency = 99; 2333b760dac2SMartin Geleynse 2334bfc51614SGreg Kroah-Hartman dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); 2335bfc51614SGreg Kroah-Hartman dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); 2336b760dac2SMartin Geleynse 2337c1284d77SJohan Hovold /* FIXME: errors are not returned */ 2338c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 2339b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 2340b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 234166e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 2342b760dac2SMartin Geleynse return 0; 2343b760dac2SMartin Geleynse } 2344b760dac2SMartin Geleynse 2345b760dac2SMartin Geleynse /* 234620734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 234720734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 234820734345SHarald Welte * userspace using openocd. 2349fa91d43bSTony Lindgren */ 235020734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 2351fa91d43bSTony Lindgren { 235275240ac4SJohan Hovold struct usb_interface *intf = serial->interface; 235375240ac4SJohan Hovold int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 2354fa91d43bSTony Lindgren 235575240ac4SJohan Hovold if (ifnum == 0) { 235675240ac4SJohan Hovold dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n"); 2357fa91d43bSTony Lindgren return -ENODEV; 2358fa91d43bSTony Lindgren } 2359fa91d43bSTony Lindgren 2360fa91d43bSTony Lindgren return 0; 2361fa91d43bSTony Lindgren } 23621da177e4SLinus Torvalds 2363c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial) 2364c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { 2365c96fbdd0SJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 2366c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2367b229a0f8SDoug Goldstein if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) 2368b229a0f8SDoug Goldstein return ftdi_jtag_probe(serial); 2369b229a0f8SDoug Goldstein 2370b229a0f8SDoug Goldstein if (udev->product && 2371470b5d6fSVasyl Vavrychuk (!strcmp(udev->product, "Arrow USB Blaster") || 2372470b5d6fSVasyl Vavrychuk !strcmp(udev->product, "BeagleBone/XDS100V2") || 2373b229a0f8SDoug Goldstein !strcmp(udev->product, "SNAP Connect E10"))) 2374c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return ftdi_jtag_probe(serial); 2375c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2376c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return 0; 2377c96fbdd0SJean-Christophe PLAGNIOL-VILLARD } 2378c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2379546d7eecSKevin Vance /* 238071d9a2b9SAdrian Thomasset * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's 238171d9a2b9SAdrian Thomasset * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and 238271d9a2b9SAdrian Thomasset * can be accessed from userspace. 238371d9a2b9SAdrian Thomasset * The next two ports are enabled as UARTs by default, where port 2 is 238471d9a2b9SAdrian Thomasset * a conventional RS-232 UART. 23856ec2f46cSJean-Christophe PLAGNIOL-VILLARD */ 23866ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial) 23876ec2f46cSJean-Christophe PLAGNIOL-VILLARD { 238875240ac4SJohan Hovold struct usb_interface *intf = serial->interface; 238975240ac4SJohan Hovold int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 23906ec2f46cSJean-Christophe PLAGNIOL-VILLARD 239175240ac4SJohan Hovold if (ifnum < 2) { 239275240ac4SJohan Hovold dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n"); 23936ec2f46cSJean-Christophe PLAGNIOL-VILLARD return -ENODEV; 23946ec2f46cSJean-Christophe PLAGNIOL-VILLARD } 23956ec2f46cSJean-Christophe PLAGNIOL-VILLARD 239671d9a2b9SAdrian Thomasset return 0; 239771d9a2b9SAdrian Thomasset } 239871d9a2b9SAdrian Thomasset 239912bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 240012bdbe03SJim Radford { 24011da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 24021da177e4SLinus Torvalds 2403ba93cc7dSKaroly Pados ftdi_gpio_remove(port); 2404ba93cc7dSKaroly Pados 240512bdbe03SJim Radford remove_sysfs_attrs(port); 24061da177e4SLinus Torvalds 24074cba98ffSJohan Hovold kfree(priv); 24081da177e4SLinus Torvalds 240912bdbe03SJim Radford return 0; 241012bdbe03SJim Radford } 24111da177e4SLinus Torvalds 2412a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 2413e49bbce1SJohan Hovold { 24141da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 24151da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 24161da177e4SLinus Torvalds 24171da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 24181da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 24191da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 24201da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 24211da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 242266e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 24231da177e4SLinus Torvalds 24241da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 2425c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 24261da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 24271da177e4SLinus Torvalds 24281da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 2429be0278ccSJohan Hovold if (tty) 2430be0278ccSJohan Hovold ftdi_set_termios(tty, port, NULL); 24311da177e4SLinus Torvalds 24324cba98ffSJohan Hovold return usb_serial_generic_open(tty, port); 2433e49bbce1SJohan Hovold } 24341da177e4SLinus Torvalds 2435335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 2436335f8514SAlan Cox { 2437335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 2438335f8514SAlan Cox 2439335f8514SAlan Cox /* Disable flow control */ 2440b2ca6990SJohan Hovold if (!on) { 2441b2ca6990SJohan Hovold if (usb_control_msg(port->serial->dev, 2442335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 2443335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 2444335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 244566e47e60SJohan Hovold 0, priv->interface, NULL, 0, 2446335f8514SAlan Cox WDR_TIMEOUT) < 0) { 2447335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 2448335f8514SAlan Cox } 2449b2ca6990SJohan Hovold } 2450335f8514SAlan Cox /* drop RTS and DTR */ 2451335f8514SAlan Cox if (on) 2452335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2453335f8514SAlan Cox else 2454335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2455335f8514SAlan Cox } 24561da177e4SLinus Torvalds 24571da177e4SLinus Torvalds /* The SIO requires the first byte to have: 24581da177e4SLinus Torvalds * B0 1 24591da177e4SLinus Torvalds * B1 0 24601da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 24611da177e4SLinus Torvalds * 24621da177e4SLinus Torvalds * The new devices do not require this byte 24631da177e4SLinus Torvalds */ 2464d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 2465c23e5fc1SJohan Hovold void *dest, size_t size) 2466e49bbce1SJohan Hovold { 2467d3901a06SJohan Hovold struct ftdi_private *priv; 2468c23e5fc1SJohan Hovold int count; 2469c23e5fc1SJohan Hovold unsigned long flags; 24701da177e4SLinus Torvalds 2471d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 24721da177e4SLinus Torvalds 2473e8770484SJohan Hovold if (priv->chip_type == SIO) { 2474c23e5fc1SJohan Hovold unsigned char *buffer = dest; 2475c23e5fc1SJohan Hovold int i, len, c; 24761da177e4SLinus Torvalds 2477c23e5fc1SJohan Hovold count = 0; 2478c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 2479c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 2480c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 2481c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 2482c23e5fc1SJohan Hovold if (!c) 2483c23e5fc1SJohan Hovold break; 2484cb1676a6SJohan Hovold port->icount.tx += c; 2485c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 2486c23e5fc1SJohan Hovold count += c + 1; 24871da177e4SLinus Torvalds } 2488c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 24891da177e4SLinus Torvalds } else { 2490c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 2491c23e5fc1SJohan Hovold &port->lock); 2492cb1676a6SJohan Hovold port->icount.tx += count; 24931da177e4SLinus Torvalds } 24941da177e4SLinus Torvalds 24951da177e4SLinus Torvalds return count; 249695da310eSAlan Cox } 24971da177e4SLinus Torvalds 2498166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 2499166ceb69SJohan Hovold 250092a19f9cSJiri Slaby static int ftdi_process_packet(struct usb_serial_port *port, 2501ab4cc4efSJohan Hovold struct ftdi_private *priv, unsigned char *buf, int len) 250295da310eSAlan Cox { 2503ab4cc4efSJohan Hovold unsigned char status; 2504733fff67SJohan Hovold bool brkint = false; 25051da177e4SLinus Torvalds int i; 2506cc01f17dSJohan Hovold char flag; 25071da177e4SLinus Torvalds 2508cc01f17dSJohan Hovold if (len < 2) { 2509bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "malformed packet\n"); 2510cc01f17dSJohan Hovold return 0; 25111da177e4SLinus Torvalds } 25121da177e4SLinus Torvalds 2513464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 2514464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 2515464cbb24SAlan Cox are only processed once. */ 2516ab4cc4efSJohan Hovold status = buf[0] & FTDI_STATUS_B0_MASK; 2517cc01f17dSJohan Hovold if (status != priv->prev_status) { 2518fca5430dSSimon Arlott char diff_status = status ^ priv->prev_status; 2519fca5430dSSimon Arlott 2520fca5430dSSimon Arlott if (diff_status & FTDI_RS0_CTS) 2521cb1676a6SJohan Hovold port->icount.cts++; 2522fca5430dSSimon Arlott if (diff_status & FTDI_RS0_DSR) 2523cb1676a6SJohan Hovold port->icount.dsr++; 2524fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RI) 2525cb1676a6SJohan Hovold port->icount.rng++; 2526d14654dfSPaul Chavent if (diff_status & FTDI_RS0_RLSD) { 2527d14654dfSPaul Chavent struct tty_struct *tty; 2528d14654dfSPaul Chavent 2529cb1676a6SJohan Hovold port->icount.dcd++; 2530d14654dfSPaul Chavent tty = tty_port_tty_get(&port->port); 2531d14654dfSPaul Chavent if (tty) 2532d14654dfSPaul Chavent usb_serial_handle_dcd_change(port, tty, 2533d14654dfSPaul Chavent status & FTDI_RS0_RLSD); 2534d14654dfSPaul Chavent tty_kref_put(tty); 2535d14654dfSPaul Chavent } 2536fca5430dSSimon Arlott 2537f307e5cdSJohan Hovold wake_up_interruptible(&port->port.delta_msr_wait); 2538cc01f17dSJohan Hovold priv->prev_status = status; 25391da177e4SLinus Torvalds } 25401da177e4SLinus Torvalds 2541a6bb1e17SJohan Hovold /* save if the transmitter is empty or not */ 2542ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_TEMT) 2543a6bb1e17SJohan Hovold priv->transmit_empty = 1; 2544a6bb1e17SJohan Hovold else 2545a6bb1e17SJohan Hovold priv->transmit_empty = 0; 2546a6bb1e17SJohan Hovold 2547ce054039SJohan Hovold if (len == 2) 2548a6bb1e17SJohan Hovold return 0; /* status only */ 2549a6bb1e17SJohan Hovold 2550a6bb1e17SJohan Hovold /* 2551a6bb1e17SJohan Hovold * Break and error status must only be processed for packets with 2552a6bb1e17SJohan Hovold * data payload to avoid over-reporting. 2553a6bb1e17SJohan Hovold */ 2554cc01f17dSJohan Hovold flag = TTY_NORMAL; 2555ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_ERR_MASK) { 2556733fff67SJohan Hovold /* 2557733fff67SJohan Hovold * Break takes precedence over parity, which takes precedence 2558733fff67SJohan Hovold * over framing errors. Note that break is only associated 2559733fff67SJohan Hovold * with the last character in the buffer and only when it's a 2560733fff67SJohan Hovold * NUL. 2561733fff67SJohan Hovold */ 2562733fff67SJohan Hovold if (buf[1] & FTDI_RS_BI && buf[len - 1] == '\0') { 2563cb1676a6SJohan Hovold port->icount.brk++; 2564733fff67SJohan Hovold brkint = true; 2565733fff67SJohan Hovold } 2566733fff67SJohan Hovold if (buf[1] & FTDI_RS_PE) { 2567cc01f17dSJohan Hovold flag = TTY_PARITY; 2568cb1676a6SJohan Hovold port->icount.parity++; 2569ab4cc4efSJohan Hovold } else if (buf[1] & FTDI_RS_FE) { 2570cc01f17dSJohan Hovold flag = TTY_FRAME; 2571cb1676a6SJohan Hovold port->icount.frame++; 2572166ceb69SJohan Hovold } 2573166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 2574ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_OE) { 2575cb1676a6SJohan Hovold port->icount.overrun++; 257692a19f9cSJiri Slaby tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 25771da177e4SLinus Torvalds } 2578005b3cdeSUwe Bonnes } 25791da177e4SLinus Torvalds 2580ce054039SJohan Hovold port->icount.rx += len - 2; 2581cc01f17dSJohan Hovold 258237ae2315SJohan Hovold if (brkint || port->sysrq) { 2583ce054039SJohan Hovold for (i = 2; i < len; i++) { 2584733fff67SJohan Hovold if (brkint && i == len - 1) { 2585733fff67SJohan Hovold if (usb_serial_handle_break(port)) 2586733fff67SJohan Hovold return len - 3; 2587733fff67SJohan Hovold flag = TTY_BREAK; 2588733fff67SJohan Hovold } 2589ce054039SJohan Hovold if (usb_serial_handle_sysrq_char(port, buf[i])) 2590ce054039SJohan Hovold continue; 2591ce054039SJohan Hovold tty_insert_flip_char(&port->port, buf[i], flag); 2592cc01f17dSJohan Hovold } 259349b2597aSJohan Hovold } else { 2594ce054039SJohan Hovold tty_insert_flip_string_fixed_flag(&port->port, buf + 2, flag, 2595ce054039SJohan Hovold len - 2); 2596cc01f17dSJohan Hovold } 259749b2597aSJohan Hovold 2598ce054039SJohan Hovold return len - 2; 2599cc01f17dSJohan Hovold } 2600cc01f17dSJohan Hovold 26011b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 2602cc01f17dSJohan Hovold { 26031b551015SJohan Hovold struct usb_serial_port *port = urb->context; 2604cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2605eb0c68eaSJohan Hovold char *data = urb->transfer_buffer; 2606cc01f17dSJohan Hovold int i; 2607cc01f17dSJohan Hovold int len; 2608cc01f17dSJohan Hovold int count = 0; 2609cc01f17dSJohan Hovold 2610cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 2611cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 261292a19f9cSJiri Slaby count += ftdi_process_packet(port, priv, &data[i], len); 2613cc01f17dSJohan Hovold } 2614cc01f17dSJohan Hovold 2615cc01f17dSJohan Hovold if (count) 26162e124b4aSJiri Slaby tty_flip_buffer_push(&port->port); 2617cc01f17dSJohan Hovold } 26181da177e4SLinus Torvalds 261995da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 26201da177e4SLinus Torvalds { 262195da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 26221da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 262316410115SJohan Hovold u16 value; 26241da177e4SLinus Torvalds 26251da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 26261da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 262716410115SJohan Hovold /* last_set_data_value NEVER has the break bit set in it */ 26281da177e4SLinus Torvalds 2629464cbb24SAlan Cox if (break_state) 263016410115SJohan Hovold value = priv->last_set_data_value | FTDI_SIO_SET_BREAK; 2631464cbb24SAlan Cox else 263216410115SJohan Hovold value = priv->last_set_data_value; 26331da177e4SLinus Torvalds 2634464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 2635464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 26361da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 26371da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 263816410115SJohan Hovold value , priv->interface, 263966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2640bfc51614SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", 2641bfc51614SGreg Kroah-Hartman __func__, break_state); 26421da177e4SLinus Torvalds } 26431da177e4SLinus Torvalds 2644bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, 264516410115SJohan Hovold break_state, value); 26461da177e4SLinus Torvalds 26471da177e4SLinus Torvalds } 26481da177e4SLinus Torvalds 2649a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port) 26506f602912SJarkko Huijts { 26515fb0432eSJohan Hovold unsigned char buf[2]; 26526f602912SJarkko Huijts int ret; 26536f602912SJarkko Huijts 2654c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 26555fb0432eSJohan Hovold if (ret == 2) { 26566f602912SJarkko Huijts if (!(buf[1] & FTDI_RS_TEMT)) 2657a37025b5SJohan Hovold return false; 26585fb0432eSJohan Hovold } 26596f602912SJarkko Huijts 2660a37025b5SJohan Hovold return true; 26616f602912SJarkko Huijts } 26626f602912SJarkko Huijts 26631da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 26641da177e4SLinus Torvalds * the new setting to be used 26651da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 26661da177e4SLinus Torvalds */ 266795da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 266895da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 2669e49bbce1SJohan Hovold { 26701da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 2671bfc51614SGreg Kroah-Hartman struct device *ddev = &port->dev; 26721da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2673adc8d746SAlan Cox struct ktermios *termios = &tty->termios; 2674669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 2675df1cd63dSJohan Hovold u16 value, index; 2676df1cd63dSJohan Hovold int ret; 26771da177e4SLinus Torvalds 2678464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 2679464cbb24SAlan Cox B0. */ 2680669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 2681bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); 268295da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 2683bd5e47ccSAndrew Morton priv->force_baud); 26841da177e4SLinus Torvalds } 26851da177e4SLinus Torvalds 26861da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 26871da177e4SLinus Torvalds if (priv->force_rtscts) { 2688bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); 2689669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 26901da177e4SLinus Torvalds } 26911da177e4SLinus Torvalds 26928704211fSColin Leitner /* 2693c1f15196SColin Leitner * All FTDI UART chips are limited to CS7/8. We shouldn't pretend to 26948704211fSColin Leitner * support CS5/6 and revert the CSIZE setting instead. 2695c1f15196SColin Leitner * 2696c1f15196SColin Leitner * CS5 however is used to control some smartcard readers which abuse 2697c1f15196SColin Leitner * this limitation to switch modes. Original FTDI chips fall back to 2698c1f15196SColin Leitner * eight data bits. 2699c1f15196SColin Leitner * 2700c1f15196SColin Leitner * TODO: Implement a quirk to only allow this with mentioned 2701c1f15196SColin Leitner * readers. One I know of (Argolis Smartreader V1) 2702c1f15196SColin Leitner * returns "USB smartcard server" as iInterface string. 2703c1f15196SColin Leitner * The vendor didn't bother with a custom VID/PID of 2704c1f15196SColin Leitner * course. 27058704211fSColin Leitner */ 2706c1f15196SColin Leitner if (C_CSIZE(tty) == CS6) { 27078704211fSColin Leitner dev_warn(ddev, "requested CSIZE setting not supported\n"); 27088704211fSColin Leitner 27098704211fSColin Leitner termios->c_cflag &= ~CSIZE; 27108704211fSColin Leitner if (old_termios) 27118704211fSColin Leitner termios->c_cflag |= old_termios->c_cflag & CSIZE; 27128704211fSColin Leitner else 27138704211fSColin Leitner termios->c_cflag |= CS8; 27148704211fSColin Leitner } 27158704211fSColin Leitner 2716669a6db1SAlan Cox cflag = termios->c_cflag; 27171da177e4SLinus Torvalds 2718a816e311SYing Xue if (!old_termios) 2719c515598eSAndrew Worsley goto no_skip; 2720c515598eSAndrew Worsley 2721b1ffb4c8SAndrew Worsley if (old_termios->c_cflag == termios->c_cflag 2722b1ffb4c8SAndrew Worsley && old_termios->c_ispeed == termios->c_ispeed 2723b1ffb4c8SAndrew Worsley && old_termios->c_ospeed == termios->c_ospeed) 2724b1ffb4c8SAndrew Worsley goto no_c_cflag_changes; 2725b1ffb4c8SAndrew Worsley 27261da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 2727464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 2728464cbb24SAlan Cox don't see any problems yet */ 27291da177e4SLinus Torvalds 2730b1ffb4c8SAndrew Worsley if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) == 2731b1ffb4c8SAndrew Worsley (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) 2732b1ffb4c8SAndrew Worsley goto no_data_parity_stop_changes; 2733b1ffb4c8SAndrew Worsley 2734c515598eSAndrew Worsley no_skip: 27351da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 27361da177e4SLinus Torvalds 273716410115SJohan Hovold value = 0; 273816410115SJohan Hovold value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 27391da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 274038fcb830SRoland Koebler if (cflag & PARENB) { 274138fcb830SRoland Koebler if (cflag & CMSPAR) 274216410115SJohan Hovold value |= cflag & PARODD ? 274338fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 274438fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 274538fcb830SRoland Koebler else 274616410115SJohan Hovold value |= cflag & PARODD ? 274738fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 274838fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 274938fcb830SRoland Koebler } else { 275016410115SJohan Hovold value |= FTDI_SIO_SET_DATA_PARITY_NONE; 275138fcb830SRoland Koebler } 27521da177e4SLinus Torvalds switch (cflag & CSIZE) { 2753c1f15196SColin Leitner case CS5: 2754c1f15196SColin Leitner dev_dbg(ddev, "Setting CS5 quirk\n"); 2755c1f15196SColin Leitner break; 2756bfc51614SGreg Kroah-Hartman case CS7: 275716410115SJohan Hovold value |= 7; 2758bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS7\n"); 2759bfc51614SGreg Kroah-Hartman break; 27608704211fSColin Leitner default: 2761bfc51614SGreg Kroah-Hartman case CS8: 276216410115SJohan Hovold value |= 8; 2763bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS8\n"); 2764bfc51614SGreg Kroah-Hartman break; 27651da177e4SLinus Torvalds } 27661da177e4SLinus Torvalds 2767464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 2768464cbb24SAlan Cox - but is or'ed with this value */ 276916410115SJohan Hovold priv->last_set_data_value = value; 27701da177e4SLinus Torvalds 27711da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 27721da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 27731da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 277416410115SJohan Hovold value , priv->interface, 277566e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 2776bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", 2777bfc51614SGreg Kroah-Hartman __func__); 27781da177e4SLinus Torvalds } 27791da177e4SLinus Torvalds 27801da177e4SLinus Torvalds /* Now do the baudrate */ 2781b1ffb4c8SAndrew Worsley no_data_parity_stop_changes: 27821da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 27831da177e4SLinus Torvalds /* Disable flow control */ 27841da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 27851da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 27861da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 27871da177e4SLinus Torvalds 0, priv->interface, 278866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2789bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s error from disable flowcontrol urb\n", 2790194343d9SGreg Kroah-Hartman __func__); 27911da177e4SLinus Torvalds } 27921da177e4SLinus Torvalds /* Drop RTS and DTR */ 279374ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 27941da177e4SLinus Torvalds } else { 27951da177e4SLinus Torvalds /* set the baudrate determined before */ 27969c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 2797464cbb24SAlan Cox if (change_speed(tty, port)) 2798bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s urb failed to set baudrate\n", __func__); 27999c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 280072a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 28013177130fSJohan Hovold if (old_termios && (old_termios->c_cflag & CBAUD) == B0) 280274ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 28031da177e4SLinus Torvalds } 28041da177e4SLinus Torvalds 2805b1ffb4c8SAndrew Worsley no_c_cflag_changes: 2806df1cd63dSJohan Hovold /* Set hardware-assisted flow control */ 2807df1cd63dSJohan Hovold value = 0; 28081da177e4SLinus Torvalds 2809df1cd63dSJohan Hovold if (C_CRTSCTS(tty)) { 2810df1cd63dSJohan Hovold dev_dbg(&port->dev, "enabling rts/cts flow control\n"); 2811df1cd63dSJohan Hovold index = FTDI_SIO_RTS_CTS_HS; 2812df1cd63dSJohan Hovold } else if (I_IXON(tty)) { 2813df1cd63dSJohan Hovold dev_dbg(&port->dev, "enabling xon/xoff flow control\n"); 2814df1cd63dSJohan Hovold index = FTDI_SIO_XON_XOFF_HS; 2815df1cd63dSJohan Hovold value = STOP_CHAR(tty) << 8 | START_CHAR(tty); 28161da177e4SLinus Torvalds } else { 2817df1cd63dSJohan Hovold dev_dbg(&port->dev, "disabling flow control\n"); 2818df1cd63dSJohan Hovold index = FTDI_SIO_DISABLE_FLOW_CTRL; 2819df1cd63dSJohan Hovold } 2820df1cd63dSJohan Hovold 2821df1cd63dSJohan Hovold index |= priv->interface; 2822df1cd63dSJohan Hovold 2823df1cd63dSJohan Hovold ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 28241da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 28251da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 2826df1cd63dSJohan Hovold value, index, NULL, 0, WDR_TIMEOUT); 2827df1cd63dSJohan Hovold if (ret < 0) 2828df1cd63dSJohan Hovold dev_err(&port->dev, "failed to set flow control: %d\n", ret); 282995da310eSAlan Cox } 28301da177e4SLinus Torvalds 2831a4afff6bSJohan Hovold /* 2832a4afff6bSJohan Hovold * Get modem-control status. 2833a4afff6bSJohan Hovold * 2834a4afff6bSJohan Hovold * Returns the number of status bytes retrieved (device dependant), or 2835a4afff6bSJohan Hovold * negative error code. 2836a4afff6bSJohan Hovold */ 2837c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 2838a4afff6bSJohan Hovold unsigned char status[2]) 28391da177e4SLinus Torvalds { 28401da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 284166e47e60SJohan Hovold unsigned char *buf; 2842a3f8168bSJohan Hovold int len; 28431da177e4SLinus Torvalds int ret; 28441da177e4SLinus Torvalds 284566e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 284666e47e60SJohan Hovold if (!buf) 284766e47e60SJohan Hovold return -ENOMEM; 2848a3f8168bSJohan Hovold /* 2849a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2850a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2851a3f8168bSJohan Hovold */ 28521da177e4SLinus Torvalds switch (priv->chip_type) { 28531da177e4SLinus Torvalds case SIO: 2854a3f8168bSJohan Hovold len = 1; 28551da177e4SLinus Torvalds break; 28561da177e4SLinus Torvalds case FT8U232AM: 28571da177e4SLinus Torvalds case FT232BM: 28581da177e4SLinus Torvalds case FT2232C: 2859ed6e5282SAndrew M. Bishop case FT232RL: 2860094c2e6dSMark Adamson case FT2232H: 2861094c2e6dSMark Adamson case FT4232H: 2862309427b6SUwe Bonnes case FT232H: 2863dc0827c1SJim Paris case FTX: 2864a3f8168bSJohan Hovold len = 2; 28651da177e4SLinus Torvalds break; 28661da177e4SLinus Torvalds default: 286766e47e60SJohan Hovold ret = -EFAULT; 286866e47e60SJohan Hovold goto out; 28691da177e4SLinus Torvalds } 28701da177e4SLinus Torvalds 2871a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2872a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2873a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2874a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2875a3f8168bSJohan Hovold 0, priv->interface, 2876a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 2877427c3a95SJohan Hovold 2878427c3a95SJohan Hovold /* NOTE: We allow short responses and handle that below. */ 2879427c3a95SJohan Hovold if (ret < 1) { 2880a4afff6bSJohan Hovold dev_err(&port->dev, "failed to get modem status: %d\n", ret); 2881427c3a95SJohan Hovold if (ret >= 0) 2882427c3a95SJohan Hovold ret = -EIO; 28832c2ee545SJohan Hovold ret = usb_translate_errors(ret); 2884a3f8168bSJohan Hovold goto out; 28852c2ee545SJohan Hovold } 2886a3f8168bSJohan Hovold 2887a4afff6bSJohan Hovold status[0] = buf[0]; 2888a4afff6bSJohan Hovold if (ret > 1) 2889a4afff6bSJohan Hovold status[1] = buf[1]; 2890a4afff6bSJohan Hovold else 2891a4afff6bSJohan Hovold status[1] = 0; 2892a4afff6bSJohan Hovold 2893a4afff6bSJohan Hovold dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0], 2894a4afff6bSJohan Hovold status[1]); 2895a4afff6bSJohan Hovold out: 2896a4afff6bSJohan Hovold kfree(buf); 2897a4afff6bSJohan Hovold 2898a4afff6bSJohan Hovold return ret; 2899a4afff6bSJohan Hovold } 2900a4afff6bSJohan Hovold 2901a4afff6bSJohan Hovold static int ftdi_tiocmget(struct tty_struct *tty) 2902a4afff6bSJohan Hovold { 2903a4afff6bSJohan Hovold struct usb_serial_port *port = tty->driver_data; 2904a4afff6bSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2905a4afff6bSJohan Hovold unsigned char buf[2]; 2906a4afff6bSJohan Hovold int ret; 2907a4afff6bSJohan Hovold 2908c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 2909a4afff6bSJohan Hovold if (ret < 0) 2910a4afff6bSJohan Hovold return ret; 2911a4afff6bSJohan Hovold 291266e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 29131da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 29141da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 29151da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 29161da177e4SLinus Torvalds priv->last_dtr_rts; 2917a4afff6bSJohan Hovold 291866e47e60SJohan Hovold return ret; 29191da177e4SLinus Torvalds } 29201da177e4SLinus Torvalds 292120b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 292295da310eSAlan Cox unsigned int set, unsigned int clear) 29231da177e4SLinus Torvalds { 292495da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2925a09aa7ddSGreg Kroah-Hartman 292674ede0ffSIan Abbott return update_mctrl(port, set, clear); 29271da177e4SLinus Torvalds } 29281da177e4SLinus Torvalds 292900a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 2930464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 29311da177e4SLinus Torvalds { 293295da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 293359556608SJohan Hovold void __user *argp = (void __user *)arg; 29341da177e4SLinus Torvalds 29351da177e4SLinus Torvalds switch (cmd) { 2936c466cd2bSGreg Kroah-Hartman case TIOCSERGETLSR: 293759556608SJohan Hovold return get_lsr_info(port, argp); 29381da177e4SLinus Torvalds default: 29391da177e4SLinus Torvalds break; 29401da177e4SLinus Torvalds } 29414d5147ecSJohan Hovold 294295da310eSAlan Cox return -ENOIOCTLCMD; 294395da310eSAlan Cox } 29441da177e4SLinus Torvalds 2945e17c1aa2SJohan Hovold module_usb_serial_driver(serial_drivers, id_table_combined); 29461da177e4SLinus Torvalds 29471da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 29481da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 29491da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 29501da177e4SLinus Torvalds 2951b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2952b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2953