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) }, 7164bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 7170ba3b2ccSPetr Kubánek { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 7186f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 7198f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 72034d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 72134d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 7229b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 7239b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 72434d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 72534d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 72634d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 72734d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 728740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 729740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 7309b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 731c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 732c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 733c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 734c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 73509c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 736c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 73709c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 73834910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 739b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 740b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 741effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 742641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 7437e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 744a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 745a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 746ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 747cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 7487e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 74926a538b9SHorst Schirmeier { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 750a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 751a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 752a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 753a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 754a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 755a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 756a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 757a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 758a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 759a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 760a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 76120a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 762eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 76348437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 7645a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_1_PID) }, 7655a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_3_PID) }, 766eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 7679978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 7689978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 7699978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 77040c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 771b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 772b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 773b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 774b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 775b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 776b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 777b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 778b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 779b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 780b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 781822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 782ee444609SJohan Hovold { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) }, 7839608e5c0SMajor Hayden { USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) }, 784fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, 785fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, 786fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, 787fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, 788fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, 789fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, 790fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, 791fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, 792fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, 793fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, 794fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, 795fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, 796fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, 797fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, 798fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, 799fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, 800fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, 801fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, 802fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, 803fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, 804fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, 805fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, 806fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, 807fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, 808fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, 809fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, 810fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, 811fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, 812762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 813a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 814d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 8154bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 81611171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 817307369b0SMarcin Kościelnicki { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 818c7d373c3SMax Mansfield { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), 819c7d373c3SMax Mansfield .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8205f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) }, 8215f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) }, 8225f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) }, 8235f63424aSAndrey Korolyov { USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) }, 82420734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 82520734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82620734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 82720734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 828a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 829a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 830a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 831a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8323687f641SPeter Stuge { USB_DEVICE(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID), 8333687f641SPeter Stuge .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 83414511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 83514511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 83626ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 837e03cdf22SGreg Kroah-Hartman { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, 8382542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 83959c6ccd9SDaniel Suchy 84059c6ccd9SDaniel Suchy /* Papouch devices based on FTDI chip */ 84159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) }, 84259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) }, 84359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) }, 84459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) }, 84559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) }, 84659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) }, 84759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) }, 84859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) }, 84959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) }, 85059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) }, 85159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 85259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) }, 85359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) }, 85459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) }, 855a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 85659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) }, 85759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) }, 85859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) }, 85959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) }, 86059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) }, 86159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) }, 86259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) }, 86359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) }, 86459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) }, 86559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) }, 866a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 86759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) }, 86859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) }, 86959c6ccd9SDaniel Suchy 87096285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 87196285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 87245eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 873ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 8747f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 8757f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 8767f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 877b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 878b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 87911eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 88011eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 881f08dea73SBjørn Mork { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 882f08dea73SBjørn Mork USB_CLASS_VENDOR_SPEC, 883f08dea73SBjørn Mork USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 88431c5d192SMarek Vasut { USB_DEVICE_INTERFACE_NUMBER(ACTEL_VID, MICROSEMI_ARROW_SF2PLUS_BOARD_PID, 2) }, 885ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 8861002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 8871002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 888d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 889fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 890dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 891dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 892dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C866_PID) }, 893dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C663_PID) }, 894dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C725_PID) }, 895dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E517_PID) }, 896dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C863_PID) }, 897b69cc672SÉric Piel { USB_DEVICE(PI_VID, PI_E861_PID) }, 898dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C867_PID) }, 899dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E609_PID) }, 900dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E709_PID) }, 901dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_100F_PID) }, 902dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1011_PID) }, 903dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1012_PID) }, 904dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1013_PID) }, 905dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1014_PID) }, 906dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1015_PID) }, 907dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1016_PID) }, 9087724a1edSOzan Çağlayan { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 909c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 91050d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 91150d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91255f13aeaSPeter Korsgaard { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID), 91355f13aeaSPeter Korsgaard .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 914e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 915c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, 916c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, 917e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 9189714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 9199714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 9209714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 9219714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 92277dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 92377dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92477dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 92577dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92677dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 92777dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92877dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 92977dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 930afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 9313126d823SRich Mattes { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) }, 932666cc076SMartin Michlmayr { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), 933666cc076SMartin Michlmayr .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 93465737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, 93565737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, 93665737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, 93765737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, 93865737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, 93965737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, 94065737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, 94165737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, 9420f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, 9430f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, 9440f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, 94590451e69SMilan Kocian { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, 9466555ad13SClemens Werther { USB_DEVICE(FTDI_VID, FTDI_FHE_PID) }, 9475363cdc3SFlorian Faber { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, 9487fea0f71SSebastien Bourdeauducq { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), 9497fea0f71SSebastien Bourdeauducq .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9509f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), 9519f06d15fSAdrian Thomasset .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9529f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), 9536ec2f46cSJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, 954fc216ec3SPeter Naulls { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, 95547594d55SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 95647594d55SMichał Wróbel .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 95757e596f3SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 9588cf65dc3STomasz Mloduchowski /* Crucible Devices */ 9598cf65dc3STomasz Mloduchowski { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 960e1466ad5SАлексей Крамаренко { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, 9616dbd46c8SJoerg Dorchain /* Cressi Devices */ 9626dbd46c8SJoerg Dorchain { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, 963efe26e16SMichele Baldessari /* Brainboxes Devices */ 964efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_001_PID) }, 965efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_012_PID) }, 966efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) }, 967efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) }, 968efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) }, 969efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) }, 970efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) }, 971efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) }, 972efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_4_PID) }, 973efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_5_PID) }, 974efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) }, 975efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) }, 976efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) }, 977efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) }, 978efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) }, 979efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) }, 980efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) }, 981efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) }, 982efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) }, 983efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) }, 984efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) }, 985efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) }, 986efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_357_PID) }, 987efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_1_PID) }, 988efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_2_PID) }, 989efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_3_PID) }, 990efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_1_PID) }, 991efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_2_PID) }, 992efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_1_PID) }, 993efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, 994efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, 995efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, 996646907f5SJaša Bartelj /* ekey Devices */ 997646907f5SJaša Bartelj { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) }, 998d8279a40SMichal Sojka /* Infineon Devices */ 999ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) }, 1000ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) }, 10019c491c37STaylor Braun-Jones /* GE Healthcare devices */ 10029c491c37STaylor Braun-Jones { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) }, 1003f6950344SMark Glover /* Active Research (Actisense) devices */ 1004f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NDC_PID) }, 1005f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) }, 1006f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) }, 1007f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) }, 1008f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) }, 1009f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) }, 1010f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) }, 1011f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) }, 1012f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) }, 1013f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) }, 1014f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_NMEA2000_PID) }, 1015f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ETHERNET_PID) }, 1016f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_WIFI_PID) }, 1017f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 1018f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 1019f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 1020ea6db90eSJosh Boyer /* ICP DAS I-756xU devices */ 1021ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, 1022ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, 1023ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, 1024ae34d12cSSheng-Hui J. Chu { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, 10259bfef729SDoug Brown { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), 10269bfef729SDoug Brown .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 1027a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, 1028a6c215e2SJeffrey Chu { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, 1029c6a36ad3SMax Schulze { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) }, 10308d7fa3d4SMans Rullgard /* EZPrototypes devices */ 10318d7fa3d4SMans Rullgard { USB_DEVICE(EZPROTOTYPES_VID, HJELMSLUND_USB485_ISO_PID) }, 1032f8377effSAndreas Fritiofson { USB_DEVICE_INTERFACE_NUMBER(UNJO_VID, UNJO_ISODEBUG_V1_PID, 1) }, 1033357f16d9SBeni Mahler /* Sienna devices */ 1034357f16d9SBeni Mahler { USB_DEVICE(FTDI_VID, FTDI_SIENNA_PID) }, 1035357f16d9SBeni Mahler { USB_DEVICE(ECHELON_VID, ECHELON_U20_PID) }, 1036c1a1f273SFabio D'Urso /* U-Blox devices */ 1037c1a1f273SFabio D'Urso { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, 1038c1a1f273SFabio D'Urso { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, 10391da177e4SLinus Torvalds { } /* Terminating entry */ 10401da177e4SLinus Torvalds }; 10411da177e4SLinus Torvalds 10421da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 10431da177e4SLinus Torvalds 10444c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 10451da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 10461da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 10471da177e4SLinus Torvalds [FT232BM] = "FT232BM", 10481da177e4SLinus Torvalds [FT2232C] = "FT2232C", 1049d8b21606SGard Spreemann [FT232RL] = "FT232RL", 1050094c2e6dSMark Adamson [FT2232H] = "FT2232H", 1051309427b6SUwe Bonnes [FT4232H] = "FT4232H", 1052dc0827c1SJim Paris [FT232H] = "FT232H", 1053dc0827c1SJim Paris [FTX] = "FT-X" 10541da177e4SLinus Torvalds }; 10551da177e4SLinus Torvalds 10561da177e4SLinus Torvalds 10571da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 10581da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 10591da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 10601da177e4SLinus Torvalds /* End TIOCMIWAIT */ 10611da177e4SLinus Torvalds 10621da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 1063464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1064464cbb24SAlan Cox const struct usb_device_id *id); 106512bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 106612bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 1067a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 1068335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 10691b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 1070d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1071c23e5fc1SJohan Hovold void *dest, size_t size); 1072464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 1073464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 107460b33c13SAlan Cox static int ftdi_tiocmget(struct tty_struct *tty); 107520b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 1076464cbb24SAlan Cox unsigned int set, unsigned int clear); 107700a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 1078464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 10793ae36bedSAl Viro static int get_serial_info(struct tty_struct *tty, 10803ae36bedSAl Viro struct serial_struct *ss); 10813ae36bedSAl Viro static int set_serial_info(struct tty_struct *tty, 10823ae36bedSAl Viro struct serial_struct *ss); 108395da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 1084a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port); 1085c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 10865fb0432eSJohan Hovold unsigned char status[2]); 10871da177e4SLinus Torvalds 10881da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 10891da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 1090fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 1091fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud); 1092fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 1093fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud); 10941da177e4SLinus Torvalds 1095ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 109618fcac35SGreg Kroah-Hartman .driver = { 10971da177e4SLinus Torvalds .owner = THIS_MODULE, 1098269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 109918fcac35SGreg Kroah-Hartman }, 1100269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 11018f977e42SIan Abbott .id_table = id_table_combined, 11021da177e4SLinus Torvalds .num_ports = 1, 1103bbcb2b90SJohan Hovold .bulk_in_size = 512, 1104c23e5fc1SJohan Hovold .bulk_out_size = 256, 11058f977e42SIan Abbott .probe = ftdi_sio_probe, 110612bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 110712bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 11081da177e4SLinus Torvalds .open = ftdi_open, 1109335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 11101b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 11111b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 11121b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 1113d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 11141da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 11151da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 1116f307e5cdSJohan Hovold .tiocmiwait = usb_serial_generic_tiocmiwait, 11176f86fec9SJohan Hovold .get_icount = usb_serial_generic_get_icount, 11181da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 11193ae36bedSAl Viro .get_serial = get_serial_info, 11203ae36bedSAl Viro .set_serial = set_serial_info, 11211da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 11221da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 1123a37025b5SJohan Hovold .tx_empty = ftdi_tx_empty, 11241da177e4SLinus Torvalds }; 11251da177e4SLinus Torvalds 112697b6b6d2SAlan Stern static struct usb_serial_driver * const serial_drivers[] = { 112797b6b6d2SAlan Stern &ftdi_sio_device, NULL 112897b6b6d2SAlan Stern }; 112997b6b6d2SAlan Stern 11301da177e4SLinus Torvalds 11311da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 1132279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 11331da177e4SLinus Torvalds 11341da177e4SLinus Torvalds /* 11351da177e4SLinus Torvalds * *************************************************************************** 1136fa91d43bSTony Lindgren * Utility functions 11371da177e4SLinus Torvalds * *************************************************************************** 11381da177e4SLinus Torvalds */ 11391da177e4SLinus Torvalds 11401da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 11411da177e4SLinus Torvalds { 11421da177e4SLinus Torvalds unsigned short int divisor; 1143464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 11446abd8371SNikolaj Fogh int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud); 1145464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 1146464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 11471da177e4SLinus Torvalds divisor = divisor3 >> 3; 11481da177e4SLinus Torvalds divisor3 &= 0x7; 1149464cbb24SAlan Cox if (divisor3 == 1) 1150464cbb24SAlan Cox divisor |= 0xc000; 1151464cbb24SAlan Cox else if (divisor3 >= 4) 1152464cbb24SAlan Cox divisor |= 0x4000; 1153464cbb24SAlan Cox else if (divisor3 != 0) 1154464cbb24SAlan Cox divisor |= 0x8000; 1155464cbb24SAlan Cox else if (divisor == 1) 1156464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 11571da177e4SLinus Torvalds return divisor; 11581da177e4SLinus Torvalds } 11591da177e4SLinus Torvalds 11601da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 11611da177e4SLinus Torvalds { 1162464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 11631da177e4SLinus Torvalds } 11641da177e4SLinus Torvalds 1165fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 11661da177e4SLinus Torvalds { 11671da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1168fd54a99aSJohan Hovold u32 divisor; 1169464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 11706abd8371SNikolaj Fogh int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud); 11711da177e4SLinus Torvalds divisor = divisor3 >> 3; 1172fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 11731da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 1174464cbb24SAlan Cox if (divisor == 1) 1175464cbb24SAlan Cox divisor = 0; 1176464cbb24SAlan Cox else if (divisor == 0x4001) 1177464cbb24SAlan Cox divisor = 1; 11781da177e4SLinus Torvalds return divisor; 11791da177e4SLinus Torvalds } 11801da177e4SLinus Torvalds 1181fd54a99aSJohan Hovold static u32 ftdi_232bm_baud_to_divisor(int baud) 11821da177e4SLinus Torvalds { 1183464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 11841da177e4SLinus Torvalds } 11851da177e4SLinus Torvalds 1186fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 1187094c2e6dSMark Adamson { 1188094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1189fd54a99aSJohan Hovold u32 divisor; 1190094c2e6dSMark Adamson int divisor3; 1191094c2e6dSMark Adamson 1192094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 11936abd8371SNikolaj Fogh divisor3 = DIV_ROUND_CLOSEST(8 * base, 10 * baud); 1194094c2e6dSMark Adamson 1195094c2e6dSMark Adamson divisor = divisor3 >> 3; 1196fd54a99aSJohan Hovold divisor |= (u32)divfrac[divisor3 & 0x7] << 14; 1197094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 1198094c2e6dSMark Adamson if (divisor == 1) 1199094c2e6dSMark Adamson divisor = 0; 1200094c2e6dSMark Adamson else if (divisor == 0x4001) 1201094c2e6dSMark Adamson divisor = 1; 1202094c2e6dSMark Adamson /* 1203094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 1204094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 1205094c2e6dSMark Adamson * baud with this bit set 1206094c2e6dSMark Adamson */ 1207094c2e6dSMark Adamson divisor |= 0x00020000; 1208094c2e6dSMark Adamson return divisor; 1209094c2e6dSMark Adamson } 1210094c2e6dSMark Adamson 1211fd54a99aSJohan Hovold static u32 ftdi_2232h_baud_to_divisor(int baud) 1212094c2e6dSMark Adamson { 1213094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 1214094c2e6dSMark Adamson } 1215094c2e6dSMark Adamson 121674ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 121774ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 121874ede0ffSIan Abbott 1219464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 1220464cbb24SAlan Cox unsigned int clear) 12211da177e4SLinus Torvalds { 12221da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1223bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 122416410115SJohan Hovold unsigned value; 12251da177e4SLinus Torvalds int rv; 12261da177e4SLinus Torvalds 122774ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 1228bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); 122974ede0ffSIan Abbott return 0; /* no change */ 12301da177e4SLinus Torvalds } 123174ede0ffSIan Abbott 123274ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 123316410115SJohan Hovold value = 0; 123474ede0ffSIan Abbott if (clear & TIOCM_DTR) 123516410115SJohan Hovold value |= FTDI_SIO_SET_DTR_LOW; 123674ede0ffSIan Abbott if (clear & TIOCM_RTS) 123716410115SJohan Hovold value |= FTDI_SIO_SET_RTS_LOW; 123874ede0ffSIan Abbott if (set & TIOCM_DTR) 123916410115SJohan Hovold value |= FTDI_SIO_SET_DTR_HIGH; 124074ede0ffSIan Abbott if (set & TIOCM_RTS) 124116410115SJohan Hovold value |= FTDI_SIO_SET_RTS_HIGH; 12421da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 12431da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 12441da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 12451da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 124616410115SJohan Hovold value, priv->interface, 124766e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 124874ede0ffSIan Abbott if (rv < 0) { 1249bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", 1250441b62c1SHarvey Harrison __func__, 1251bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1252bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12532c2ee545SJohan Hovold rv = usb_translate_errors(rv); 12541da177e4SLinus Torvalds } else { 1255bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1256bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1257bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12589b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 125974ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 12601da177e4SLinus Torvalds } 12611da177e4SLinus Torvalds return rv; 12621da177e4SLinus Torvalds } 12631da177e4SLinus Torvalds 12641da177e4SLinus Torvalds 1265fd54a99aSJohan Hovold static u32 get_ftdi_divisor(struct tty_struct *tty, 1266464cbb24SAlan Cox struct usb_serial_port *port) 1267e49bbce1SJohan Hovold { 12681da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1269bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 1270fd54a99aSJohan Hovold u32 div_value = 0; 12711da177e4SLinus Torvalds int div_okay = 1; 12721da177e4SLinus Torvalds int baud; 12731da177e4SLinus Torvalds 127495da310eSAlan Cox baud = tty_get_baud_rate(tty); 1275bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); 12761da177e4SLinus Torvalds 127783c9a2d1SJohan Hovold /* 127883c9a2d1SJohan Hovold * Observe deprecated async-compatible custom_divisor hack, update 127983c9a2d1SJohan Hovold * baudrate if needed. 128083c9a2d1SJohan Hovold */ 12811da177e4SLinus Torvalds if (baud == 38400 && 12821da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 12831da177e4SLinus Torvalds (priv->custom_divisor)) { 12841da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1285bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", 1286464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 12871da177e4SLinus Torvalds } 12881da177e4SLinus Torvalds 1289464cbb24SAlan Cox if (!baud) 1290464cbb24SAlan Cox baud = 9600; 12911da177e4SLinus Torvalds switch (priv->chip_type) { 12921da177e4SLinus Torvalds case SIO: /* SIO chip */ 12931da177e4SLinus Torvalds switch (baud) { 12941da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 12951da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 12961da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 12971da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 12981da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 12991da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 13001da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 13011da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 13021da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 13031da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 13041da177e4SLinus Torvalds } /* baud */ 13051da177e4SLinus Torvalds if (div_value == 0) { 1306bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", 1307464cbb24SAlan Cox __func__, baud); 13081da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1309669a6db1SAlan Cox baud = 9600; 13101da177e4SLinus Torvalds div_okay = 0; 13111da177e4SLinus Torvalds } 13121da177e4SLinus Torvalds break; 13131da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 13141da177e4SLinus Torvalds if (baud <= 3000000) { 13151da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 13161da177e4SLinus Torvalds } else { 1317bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1318669a6db1SAlan Cox baud = 9600; 13191da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 13201da177e4SLinus Torvalds div_okay = 0; 13211da177e4SLinus Torvalds } 13221da177e4SLinus Torvalds break; 13231da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 13241da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 1325dc0827c1SJim Paris case FT232RL: /* FT232RL chip */ 1326dc0827c1SJim Paris case FTX: /* FT-X series */ 13271da177e4SLinus Torvalds if (baud <= 3000000) { 1328fd54a99aSJohan Hovold u16 product_id = le16_to_cpu( 1329b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1330fb571101SMathieu OTHACEHE if (((product_id == FTDI_NDI_HUC_PID) || 1331fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_SPECTRA_SCU_PID) || 1332fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_2_PID) || 1333fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_3_PID) || 1334fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_AURORA_SCU_PID)) && 1335b760dac2SMartin Geleynse (baud == 19200)) { 1336b760dac2SMartin Geleynse baud = 1200000; 1337b760dac2SMartin Geleynse } 13381da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 13391da177e4SLinus Torvalds } else { 1340bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 13411da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 13421da177e4SLinus Torvalds div_okay = 0; 1343669a6db1SAlan Cox baud = 9600; 13441da177e4SLinus Torvalds } 13451da177e4SLinus Torvalds break; 1346094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1347094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1348309427b6SUwe Bonnes case FT232H: /* FT232H chip */ 13491862cdd5SIonut Nicu if ((baud <= 12000000) && (baud >= 1200)) { 1350094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1351094c2e6dSMark Adamson } else if (baud < 1200) { 1352094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1353094c2e6dSMark Adamson } else { 1354bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1355094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1356094c2e6dSMark Adamson div_okay = 0; 1357094c2e6dSMark Adamson baud = 9600; 1358094c2e6dSMark Adamson } 1359094c2e6dSMark Adamson break; 13601da177e4SLinus Torvalds } /* priv->chip_type */ 13611da177e4SLinus Torvalds 13621da177e4SLinus Torvalds if (div_okay) { 1363bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", 1364441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 13651da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 13661da177e4SLinus Torvalds } 13671da177e4SLinus Torvalds 136895da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1369464cbb24SAlan Cox return div_value; 13701da177e4SLinus Torvalds } 13711da177e4SLinus Torvalds 137295da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 137395da310eSAlan Cox { 137495da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 137516410115SJohan Hovold u16 value; 137616410115SJohan Hovold u16 index; 137716410115SJohan Hovold u32 index_value; 137895da310eSAlan Cox int rv; 137995da310eSAlan Cox 138016410115SJohan Hovold index_value = get_ftdi_divisor(tty, port); 138116410115SJohan Hovold value = (u16)index_value; 138216410115SJohan Hovold index = (u16)(index_value >> 16); 13830ee404ccSUwe Bonnes if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || 13840ee404ccSUwe Bonnes (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { 13850ee404ccSUwe Bonnes /* Probably the BM type needs the MSB of the encoded fractional 13860ee404ccSUwe Bonnes * divider also moved like for the chips above. Any infos? */ 138716410115SJohan Hovold index = (u16)((index << 8) | priv->interface); 138895da310eSAlan Cox } 138995da310eSAlan Cox 139095da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 139195da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 139295da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 139395da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 139416410115SJohan Hovold value, index, 139566e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 139695da310eSAlan Cox return rv; 139795da310eSAlan Cox } 139895da310eSAlan Cox 1399557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1400557aaa7fSAlan Cox { 1401557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1402557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1403c1284d77SJohan Hovold int rv; 1404557aaa7fSAlan Cox int l = priv->latency; 140595da310eSAlan Cox 14062dea7cd7SIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14072dea7cd7SIan Abbott return -EINVAL; 14082dea7cd7SIan Abbott 1409557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1410557aaa7fSAlan Cox l = 1; 1411557aaa7fSAlan Cox 1412bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); 1413557aaa7fSAlan Cox 1414557aaa7fSAlan Cox rv = usb_control_msg(udev, 1415557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1416557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1417557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1418557aaa7fSAlan Cox l, priv->interface, 141966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1420557aaa7fSAlan Cox if (rv < 0) 1421557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1422557aaa7fSAlan Cox return rv; 1423557aaa7fSAlan Cox } 1424557aaa7fSAlan Cox 14257e1e6cedSIan Abbott static int _read_latency_timer(struct usb_serial_port *port) 1426557aaa7fSAlan Cox { 1427557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1428557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 142954f328d0SJohan Hovold unsigned char *buf; 1430c1284d77SJohan Hovold int rv; 1431557aaa7fSAlan Cox 143254f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 143354f328d0SJohan Hovold if (!buf) 143454f328d0SJohan Hovold return -ENOMEM; 143554f328d0SJohan Hovold 1436557aaa7fSAlan Cox rv = usb_control_msg(udev, 1437557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1438557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1439557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1440557aaa7fSAlan Cox 0, priv->interface, 144154f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 1442e3e574adSJohan Hovold if (rv < 1) { 1443e3e574adSJohan Hovold if (rv >= 0) 1444e3e574adSJohan Hovold rv = -EIO; 1445e3e574adSJohan Hovold } else { 14467e1e6cedSIan Abbott rv = buf[0]; 1447e3e574adSJohan Hovold } 144854f328d0SJohan Hovold 144954f328d0SJohan Hovold kfree(buf); 145054f328d0SJohan Hovold 14518c4f99cdSJohan Hovold return rv; 1452557aaa7fSAlan Cox } 14531da177e4SLinus Torvalds 14547e1e6cedSIan Abbott static int read_latency_timer(struct usb_serial_port *port) 14557e1e6cedSIan Abbott { 14567e1e6cedSIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 14577e1e6cedSIan Abbott int rv; 14587e1e6cedSIan Abbott 14597e1e6cedSIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14607e1e6cedSIan Abbott return -EINVAL; 14617e1e6cedSIan Abbott 14627e1e6cedSIan Abbott rv = _read_latency_timer(port); 14637e1e6cedSIan Abbott if (rv < 0) { 14647e1e6cedSIan Abbott dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 14657e1e6cedSIan Abbott return rv; 14667e1e6cedSIan Abbott } 14677e1e6cedSIan Abbott 14687e1e6cedSIan Abbott priv->latency = rv; 14697e1e6cedSIan Abbott 14707e1e6cedSIan Abbott return 0; 14717e1e6cedSIan Abbott } 14727e1e6cedSIan Abbott 14733ae36bedSAl Viro static int get_serial_info(struct tty_struct *tty, 14743ae36bedSAl Viro struct serial_struct *ss) 14751da177e4SLinus Torvalds { 14763ae36bedSAl Viro struct usb_serial_port *port = tty->driver_data; 14771da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14781da177e4SLinus Torvalds 14793ae36bedSAl Viro ss->flags = priv->flags; 14803ae36bedSAl Viro ss->baud_base = priv->baud_base; 14813ae36bedSAl Viro ss->custom_divisor = priv->custom_divisor; 14821da177e4SLinus Torvalds return 0; 1483e49bbce1SJohan Hovold } 14841da177e4SLinus Torvalds 148595da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 14863ae36bedSAl Viro struct serial_struct *ss) 1487e49bbce1SJohan Hovold { 14883ae36bedSAl Viro struct usb_serial_port *port = tty->driver_data; 14891da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14901da177e4SLinus Torvalds struct ftdi_private old_priv; 14911da177e4SLinus Torvalds 1492bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 14931da177e4SLinus Torvalds old_priv = *priv; 14941da177e4SLinus Torvalds 14951da177e4SLinus Torvalds /* Do error checking and permission checking */ 14961da177e4SLinus Torvalds 14971da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 14983ae36bedSAl Viro if ((ss->flags ^ priv->flags) & ~ASYNC_USR_MASK) { 1499bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15001da177e4SLinus Torvalds return -EPERM; 150164905b48SDan Carpenter } 15021da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 15033ae36bedSAl Viro (ss->flags & ASYNC_USR_MASK)); 15043ae36bedSAl Viro priv->custom_divisor = ss->custom_divisor; 15051da177e4SLinus Torvalds goto check_and_exit; 15061da177e4SLinus Torvalds } 15071da177e4SLinus Torvalds 15083ae36bedSAl Viro if (ss->baud_base != priv->baud_base) { 1509bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15101da177e4SLinus Torvalds return -EINVAL; 15116b447f04SAlan Cox } 15121da177e4SLinus Torvalds 15131da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 15141da177e4SLinus Torvalds 15151da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 15163ae36bedSAl Viro (ss->flags & ASYNC_FLAGS)); 15173ae36bedSAl Viro priv->custom_divisor = ss->custom_divisor; 15181da177e4SLinus Torvalds 1519bb246681SAnthony Mallet check_and_exit: 1520557aaa7fSAlan Cox write_latency_timer(port); 15211da177e4SLinus Torvalds 1522f3e8ae65SJohan Hovold if ((priv->flags ^ old_priv.flags) & ASYNC_SPD_MASK || 1523f3e8ae65SJohan Hovold ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST && 1524f3e8ae65SJohan Hovold priv->custom_divisor != old_priv.custom_divisor)) { 152583c9a2d1SJohan Hovold 152683c9a2d1SJohan Hovold /* warn about deprecation unless clearing */ 152783c9a2d1SJohan Hovold if (priv->flags & ASYNC_SPD_MASK) 152883c9a2d1SJohan Hovold dev_warn_ratelimited(&port->dev, "use of SPD flags is deprecated\n"); 152983c9a2d1SJohan Hovold 153095da310eSAlan Cox change_speed(tty, port); 15311da177e4SLinus Torvalds } 1532bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 153395da310eSAlan Cox return 0; 1534e49bbce1SJohan Hovold } 15351da177e4SLinus Torvalds 1536c466cd2bSGreg Kroah-Hartman static int get_lsr_info(struct usb_serial_port *port, 153759556608SJohan Hovold unsigned int __user *retinfo) 1538c466cd2bSGreg Kroah-Hartman { 1539c466cd2bSGreg Kroah-Hartman struct ftdi_private *priv = usb_get_serial_port_data(port); 1540c466cd2bSGreg Kroah-Hartman unsigned int result = 0; 1541c466cd2bSGreg Kroah-Hartman 1542c466cd2bSGreg Kroah-Hartman if (priv->transmit_empty) 1543c466cd2bSGreg Kroah-Hartman result = TIOCSER_TEMT; 1544c466cd2bSGreg Kroah-Hartman 1545c466cd2bSGreg Kroah-Hartman if (copy_to_user(retinfo, &result, sizeof(unsigned int))) 1546c466cd2bSGreg Kroah-Hartman return -EFAULT; 1547c466cd2bSGreg Kroah-Hartman return 0; 1548c466cd2bSGreg Kroah-Hartman } 1549c466cd2bSGreg Kroah-Hartman 15501da177e4SLinus Torvalds 15518f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 15528f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 15538f977e42SIan Abbott { 15548f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 15558f977e42SIan Abbott struct usb_serial *serial = port->serial; 15568f977e42SIan Abbott struct usb_device *udev = serial->dev; 15578f977e42SIan Abbott unsigned version; 15588f977e42SIan Abbott unsigned interfaces; 15598f977e42SIan Abbott 15608f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1561f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 15628f977e42SIan Abbott 15638f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 15648f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1565bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, 15668f977e42SIan Abbott version, interfaces); 15678f977e42SIan Abbott if (interfaces > 1) { 15688f977e42SIan Abbott int inter; 15698f977e42SIan Abbott 1570094c2e6dSMark Adamson /* Multiple interfaces.*/ 1571094c2e6dSMark Adamson if (version == 0x0800) { 1572094c2e6dSMark Adamson priv->chip_type = FT4232H; 1573094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1574094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1575094c2e6dSMark Adamson } else if (version == 0x0700) { 1576094c2e6dSMark Adamson priv->chip_type = FT2232H; 1577094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1578094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1579094c2e6dSMark Adamson } else 15808f977e42SIan Abbott priv->chip_type = FT2232C; 1581094c2e6dSMark Adamson 15828f977e42SIan Abbott /* Determine interface code. */ 15838f977e42SIan Abbott inter = serial->interface->altsetting->desc.bInterfaceNumber; 1584094c2e6dSMark Adamson if (inter == 0) { 1585094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1586094c2e6dSMark Adamson } else if (inter == 1) { 1587094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1588094c2e6dSMark Adamson } else if (inter == 2) { 1589094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1590094c2e6dSMark Adamson } else if (inter == 3) { 1591094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1592094c2e6dSMark Adamson } 15938f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 15948f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 15958f977e42SIan Abbott if (version < 0x500) { 1596bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, 1597bfc51614SGreg Kroah-Hartman "%s: something fishy - bcdDevice too low for multi-interface device\n", 1598441b62c1SHarvey Harrison __func__); 15998f977e42SIan Abbott } 16008f977e42SIan Abbott } else if (version < 0x200) { 1601330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 16028f977e42SIan Abbott priv->chip_type = SIO; 16038f977e42SIan Abbott priv->baud_base = 12000000 / 16; 16048f977e42SIan Abbott } else if (version < 0x400) { 1605330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 16068f977e42SIan Abbott priv->chip_type = FT8U232AM; 16077e1e6cedSIan Abbott /* 16087e1e6cedSIan Abbott * It might be a BM type because of the iSerialNumber bug. 16097e1e6cedSIan Abbott * If iSerialNumber==0 and the latency timer is readable, 16107e1e6cedSIan Abbott * assume it is BM type. 16117e1e6cedSIan Abbott */ 16127e1e6cedSIan Abbott if (udev->descriptor.iSerialNumber == 0 && 16137e1e6cedSIan Abbott _read_latency_timer(port) >= 0) { 16147e1e6cedSIan Abbott dev_dbg(&port->dev, 16157e1e6cedSIan Abbott "%s: has latency timer so not an AM type\n", 16167e1e6cedSIan Abbott __func__); 16177e1e6cedSIan Abbott priv->chip_type = FT232BM; 16187e1e6cedSIan Abbott } 16193b009c63SDavid Brownell } else if (version < 0x600) { 1620330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 16218f977e42SIan Abbott priv->chip_type = FT232BM; 1622309427b6SUwe Bonnes } else if (version < 0x900) { 1623309427b6SUwe Bonnes /* Assume it's an FT232RL */ 16243b009c63SDavid Brownell priv->chip_type = FT232RL; 1625dc0827c1SJim Paris } else if (version < 0x1000) { 1626309427b6SUwe Bonnes /* Assume it's an FT232H */ 1627309427b6SUwe Bonnes priv->chip_type = FT232H; 1628dc0827c1SJim Paris } else { 1629dc0827c1SJim Paris /* Assume it's an FT-X series device */ 1630dc0827c1SJim Paris priv->chip_type = FTX; 16318f977e42SIan Abbott } 1632dc0827c1SJim Paris 1633c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 16348f977e42SIan Abbott } 16358f977e42SIan Abbott 16368f977e42SIan Abbott 163747e57595SJohan Hovold /* 163847e57595SJohan Hovold * Determine the maximum packet size for the device. This depends on the chip 1639895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 164047e57595SJohan Hovold * device descriptor as the chip will use the appropriate values for the host. 164147e57595SJohan Hovold */ 1642895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1643895f28baSMark Adamson { 1644895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 164547e57595SJohan Hovold struct usb_interface *interface = port->serial->interface; 1646aea1ae87SJohan Hovold struct usb_endpoint_descriptor *ep_desc; 1647895f28baSMark Adamson unsigned num_endpoints; 1648aea1ae87SJohan Hovold unsigned i; 1649895f28baSMark Adamson 1650895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1651aea1ae87SJohan Hovold if (!num_endpoints) 1652aea1ae87SJohan Hovold return; 1653aea1ae87SJohan Hovold 165447e57595SJohan Hovold /* 165547e57595SJohan Hovold * NOTE: Some customers have programmed FT232R/FT245R devices 1656895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1657895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 165847e57595SJohan Hovold * value of 64 for wMaxPacketSize. 165947e57595SJohan Hovold */ 1660895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1661895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 166247e57595SJohan Hovold if (!ep_desc->wMaxPacketSize) { 1663895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1664a90d84adSJohan Hovold dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n", 1665a90d84adSJohan Hovold usb_endpoint_num(ep_desc)); 1666895f28baSMark Adamson } 1667895f28baSMark Adamson } 1668895f28baSMark Adamson 166947e57595SJohan Hovold /* Set max packet size based on last descriptor. */ 167029cc8897SKuninori Morimoto priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1671895f28baSMark Adamson } 1672895f28baSMark Adamson 1673895f28baSMark Adamson 16741da177e4SLinus Torvalds /* 16751da177e4SLinus Torvalds * *************************************************************************** 16761da177e4SLinus Torvalds * Sysfs Attribute 16771da177e4SLinus Torvalds * *************************************************************************** 16781da177e4SLinus Torvalds */ 16791da177e4SLinus Torvalds 1680154547c4SGreg Kroah-Hartman static ssize_t latency_timer_show(struct device *dev, 1681464cbb24SAlan Cox struct device_attribute *attr, char *buf) 16821da177e4SLinus Torvalds { 16831da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16841da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1685557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1686557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1687557aaa7fSAlan Cox else 1688557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 16891da177e4SLinus Torvalds } 1690557aaa7fSAlan Cox 16911da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1692154547c4SGreg Kroah-Hartman static ssize_t latency_timer_store(struct device *dev, 1693154547c4SGreg Kroah-Hartman struct device_attribute *attr, 1694154547c4SGreg Kroah-Hartman const char *valbuf, size_t count) 16951da177e4SLinus Torvalds { 16961da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 16971da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1698db924066SIan Abbott u8 v; 1699c1284d77SJohan Hovold int rv; 17001da177e4SLinus Torvalds 1701db924066SIan Abbott if (kstrtou8(valbuf, 10, &v)) 1702db924066SIan Abbott return -EINVAL; 1703db924066SIan Abbott 1704557aaa7fSAlan Cox priv->latency = v; 1705557aaa7fSAlan Cox rv = write_latency_timer(port); 1706557aaa7fSAlan Cox if (rv < 0) 17071da177e4SLinus Torvalds return -EIO; 17081da177e4SLinus Torvalds return count; 17091da177e4SLinus Torvalds } 1710154547c4SGreg Kroah-Hartman static DEVICE_ATTR_RW(latency_timer); 17111da177e4SLinus Torvalds 17121da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 17131da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1714ca35910aSGreg Kroah-Hartman static ssize_t event_char_store(struct device *dev, 1715464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 17161da177e4SLinus Torvalds { 17171da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 17181da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 171912bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 1720d0559a2fSIan Abbott unsigned int v; 1721c1284d77SJohan Hovold int rv; 17221da177e4SLinus Torvalds 1723f1ce25f2SIan Abbott if (kstrtouint(valbuf, 0, &v) || v >= 0x200) 1724d0559a2fSIan Abbott return -EINVAL; 1725d0559a2fSIan Abbott 1726f1ce25f2SIan Abbott dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v); 17271da177e4SLinus Torvalds 17281da177e4SLinus Torvalds rv = usb_control_msg(udev, 17291da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 17301da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 17311da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 17321da177e4SLinus Torvalds v, priv->interface, 173366e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 17341da177e4SLinus Torvalds if (rv < 0) { 1735bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); 17361da177e4SLinus Torvalds return -EIO; 17371da177e4SLinus Torvalds } 17381da177e4SLinus Torvalds 17391da177e4SLinus Torvalds return count; 17401da177e4SLinus Torvalds } 1741ca35910aSGreg Kroah-Hartman static DEVICE_ATTR_WO(event_char); 17421da177e4SLinus Torvalds 174312bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 17441da177e4SLinus Torvalds { 174512bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 174613f4db9eSGreg Kroah-Hartman int retval = 0; 17471da177e4SLinus Torvalds 17481da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 17491da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 17501da177e4SLinus Torvalds if (priv->chip_type != SIO) { 1751bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 175212bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 175313f4db9eSGreg Kroah-Hartman if ((!retval) && 175497cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 175597cd49ebSStepan Moskovchenko priv->chip_type == FT2232C || 1756094c2e6dSMark Adamson priv->chip_type == FT232RL || 1757094c2e6dSMark Adamson priv->chip_type == FT2232H || 1758309427b6SUwe Bonnes priv->chip_type == FT4232H || 1759dc0827c1SJim Paris priv->chip_type == FT232H || 1760dc0827c1SJim Paris priv->chip_type == FTX)) { 176112bdbe03SJim Radford retval = device_create_file(&port->dev, 176213f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 17631da177e4SLinus Torvalds } 17641da177e4SLinus Torvalds } 176513f4db9eSGreg Kroah-Hartman return retval; 17661da177e4SLinus Torvalds } 17671da177e4SLinus Torvalds 176812bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 17691da177e4SLinus Torvalds { 177012bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 17711da177e4SLinus Torvalds 17721da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 17731da177e4SLinus Torvalds if (priv->chip_type != SIO) { 177412bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1775ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1776ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1777094c2e6dSMark Adamson priv->chip_type == FT232RL || 1778094c2e6dSMark Adamson priv->chip_type == FT2232H || 1779309427b6SUwe Bonnes priv->chip_type == FT4232H || 1780dc0827c1SJim Paris priv->chip_type == FT232H || 1781dc0827c1SJim Paris priv->chip_type == FTX) { 178212bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 17831da177e4SLinus Torvalds } 17841da177e4SLinus Torvalds } 17851da177e4SLinus Torvalds 17861da177e4SLinus Torvalds } 17871da177e4SLinus Torvalds 1788ba93cc7dSKaroly Pados #ifdef CONFIG_GPIOLIB 1789ba93cc7dSKaroly Pados 1790ba93cc7dSKaroly Pados static int ftdi_set_bitmode(struct usb_serial_port *port, u8 mode) 1791ba93cc7dSKaroly Pados { 1792ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1793ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 1794ba93cc7dSKaroly Pados int result; 1795ba93cc7dSKaroly Pados u16 val; 1796ba93cc7dSKaroly Pados 1797a8eda9faSKaroly Pados result = usb_autopm_get_interface(serial->interface); 1798a8eda9faSKaroly Pados if (result) 1799a8eda9faSKaroly Pados return result; 1800a8eda9faSKaroly Pados 1801ba93cc7dSKaroly Pados val = (mode << 8) | (priv->gpio_output << 4) | priv->gpio_value; 1802ba93cc7dSKaroly Pados result = usb_control_msg(serial->dev, 1803ba93cc7dSKaroly Pados usb_sndctrlpipe(serial->dev, 0), 1804ba93cc7dSKaroly Pados FTDI_SIO_SET_BITMODE_REQUEST, 1805ba93cc7dSKaroly Pados FTDI_SIO_SET_BITMODE_REQUEST_TYPE, val, 1806ba93cc7dSKaroly Pados priv->interface, NULL, 0, WDR_TIMEOUT); 1807ba93cc7dSKaroly Pados if (result < 0) { 1808ba93cc7dSKaroly Pados dev_err(&serial->interface->dev, 1809ba93cc7dSKaroly Pados "bitmode request failed for value 0x%04x: %d\n", 1810ba93cc7dSKaroly Pados val, result); 1811ba93cc7dSKaroly Pados } 1812ba93cc7dSKaroly Pados 1813a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1814a8eda9faSKaroly Pados 1815ba93cc7dSKaroly Pados return result; 1816ba93cc7dSKaroly Pados } 1817ba93cc7dSKaroly Pados 1818ba93cc7dSKaroly Pados static int ftdi_set_cbus_pins(struct usb_serial_port *port) 1819ba93cc7dSKaroly Pados { 1820ba93cc7dSKaroly Pados return ftdi_set_bitmode(port, FTDI_SIO_BITMODE_CBUS); 1821ba93cc7dSKaroly Pados } 1822ba93cc7dSKaroly Pados 1823ba93cc7dSKaroly Pados static int ftdi_exit_cbus_mode(struct usb_serial_port *port) 1824ba93cc7dSKaroly Pados { 1825ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1826ba93cc7dSKaroly Pados 1827ba93cc7dSKaroly Pados priv->gpio_output = 0; 1828ba93cc7dSKaroly Pados priv->gpio_value = 0; 1829ba93cc7dSKaroly Pados return ftdi_set_bitmode(port, FTDI_SIO_BITMODE_RESET); 1830ba93cc7dSKaroly Pados } 1831ba93cc7dSKaroly Pados 1832ba93cc7dSKaroly Pados static int ftdi_gpio_request(struct gpio_chip *gc, unsigned int offset) 1833ba93cc7dSKaroly Pados { 1834ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1835ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1836ba93cc7dSKaroly Pados int result; 1837ba93cc7dSKaroly Pados 1838ba93cc7dSKaroly Pados if (priv->gpio_altfunc & BIT(offset)) 1839ba93cc7dSKaroly Pados return -ENODEV; 1840ba93cc7dSKaroly Pados 1841ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1842ba93cc7dSKaroly Pados if (!priv->gpio_used) { 1843ba93cc7dSKaroly Pados /* Set default pin states, as we cannot get them from device */ 1844ba93cc7dSKaroly Pados priv->gpio_output = 0x00; 1845ba93cc7dSKaroly Pados priv->gpio_value = 0x00; 1846ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1847ba93cc7dSKaroly Pados if (result) { 1848ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1849ba93cc7dSKaroly Pados return result; 1850ba93cc7dSKaroly Pados } 1851ba93cc7dSKaroly Pados 1852ba93cc7dSKaroly Pados priv->gpio_used = true; 1853ba93cc7dSKaroly Pados } 1854ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1855ba93cc7dSKaroly Pados 1856ba93cc7dSKaroly Pados return 0; 1857ba93cc7dSKaroly Pados } 1858ba93cc7dSKaroly Pados 1859ba93cc7dSKaroly Pados static int ftdi_read_cbus_pins(struct usb_serial_port *port) 1860ba93cc7dSKaroly Pados { 1861ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1862ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 1863ba93cc7dSKaroly Pados unsigned char *buf; 1864ba93cc7dSKaroly Pados int result; 1865ba93cc7dSKaroly Pados 1866a8eda9faSKaroly Pados result = usb_autopm_get_interface(serial->interface); 1867a8eda9faSKaroly Pados if (result) 1868a8eda9faSKaroly Pados return result; 1869a8eda9faSKaroly Pados 1870ba93cc7dSKaroly Pados buf = kmalloc(1, GFP_KERNEL); 1871a8eda9faSKaroly Pados if (!buf) { 1872a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1873ba93cc7dSKaroly Pados return -ENOMEM; 1874a8eda9faSKaroly Pados } 1875ba93cc7dSKaroly Pados 1876ba93cc7dSKaroly Pados result = usb_control_msg(serial->dev, 1877ba93cc7dSKaroly Pados usb_rcvctrlpipe(serial->dev, 0), 1878ba93cc7dSKaroly Pados FTDI_SIO_READ_PINS_REQUEST, 1879ba93cc7dSKaroly Pados FTDI_SIO_READ_PINS_REQUEST_TYPE, 0, 1880ba93cc7dSKaroly Pados priv->interface, buf, 1, WDR_TIMEOUT); 1881ba93cc7dSKaroly Pados if (result < 1) { 1882ba93cc7dSKaroly Pados if (result >= 0) 1883ba93cc7dSKaroly Pados result = -EIO; 1884ba93cc7dSKaroly Pados } else { 1885ba93cc7dSKaroly Pados result = buf[0]; 1886ba93cc7dSKaroly Pados } 1887ba93cc7dSKaroly Pados 1888ba93cc7dSKaroly Pados kfree(buf); 1889a8eda9faSKaroly Pados usb_autopm_put_interface(serial->interface); 1890ba93cc7dSKaroly Pados 1891ba93cc7dSKaroly Pados return result; 1892ba93cc7dSKaroly Pados } 1893ba93cc7dSKaroly Pados 1894ba93cc7dSKaroly Pados static int ftdi_gpio_get(struct gpio_chip *gc, unsigned int gpio) 1895ba93cc7dSKaroly Pados { 1896ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1897ba93cc7dSKaroly Pados int result; 1898ba93cc7dSKaroly Pados 1899ba93cc7dSKaroly Pados result = ftdi_read_cbus_pins(port); 1900ba93cc7dSKaroly Pados if (result < 0) 1901ba93cc7dSKaroly Pados return result; 1902ba93cc7dSKaroly Pados 1903ba93cc7dSKaroly Pados return !!(result & BIT(gpio)); 1904ba93cc7dSKaroly Pados } 1905ba93cc7dSKaroly Pados 1906ba93cc7dSKaroly Pados static void ftdi_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) 1907ba93cc7dSKaroly Pados { 1908ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1909ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1910ba93cc7dSKaroly Pados 1911ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1912ba93cc7dSKaroly Pados 1913ba93cc7dSKaroly Pados if (value) 1914ba93cc7dSKaroly Pados priv->gpio_value |= BIT(gpio); 1915ba93cc7dSKaroly Pados else 1916ba93cc7dSKaroly Pados priv->gpio_value &= ~BIT(gpio); 1917ba93cc7dSKaroly Pados 1918ba93cc7dSKaroly Pados ftdi_set_cbus_pins(port); 1919ba93cc7dSKaroly Pados 1920ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1921ba93cc7dSKaroly Pados } 1922ba93cc7dSKaroly Pados 1923ba93cc7dSKaroly Pados static int ftdi_gpio_get_multiple(struct gpio_chip *gc, unsigned long *mask, 1924ba93cc7dSKaroly Pados unsigned long *bits) 1925ba93cc7dSKaroly Pados { 1926ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1927ba93cc7dSKaroly Pados int result; 1928ba93cc7dSKaroly Pados 1929ba93cc7dSKaroly Pados result = ftdi_read_cbus_pins(port); 1930ba93cc7dSKaroly Pados if (result < 0) 1931ba93cc7dSKaroly Pados return result; 1932ba93cc7dSKaroly Pados 1933ba93cc7dSKaroly Pados *bits = result & *mask; 1934ba93cc7dSKaroly Pados 1935ba93cc7dSKaroly Pados return 0; 1936ba93cc7dSKaroly Pados } 1937ba93cc7dSKaroly Pados 1938ba93cc7dSKaroly Pados static void ftdi_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask, 1939ba93cc7dSKaroly Pados unsigned long *bits) 1940ba93cc7dSKaroly Pados { 1941ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1942ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1943ba93cc7dSKaroly Pados 1944ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1945ba93cc7dSKaroly Pados 1946ba93cc7dSKaroly Pados priv->gpio_value &= ~(*mask); 1947ba93cc7dSKaroly Pados priv->gpio_value |= *bits & *mask; 1948ba93cc7dSKaroly Pados ftdi_set_cbus_pins(port); 1949ba93cc7dSKaroly Pados 1950ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1951ba93cc7dSKaroly Pados } 1952ba93cc7dSKaroly Pados 1953ba93cc7dSKaroly Pados static int ftdi_gpio_direction_get(struct gpio_chip *gc, unsigned int gpio) 1954ba93cc7dSKaroly Pados { 1955ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1956ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1957ba93cc7dSKaroly Pados 1958ba93cc7dSKaroly Pados return !(priv->gpio_output & BIT(gpio)); 1959ba93cc7dSKaroly Pados } 1960ba93cc7dSKaroly Pados 1961ba93cc7dSKaroly Pados static int ftdi_gpio_direction_input(struct gpio_chip *gc, unsigned int gpio) 1962ba93cc7dSKaroly Pados { 1963ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1964ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1965ba93cc7dSKaroly Pados int result; 1966ba93cc7dSKaroly Pados 1967ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1968ba93cc7dSKaroly Pados 1969ba93cc7dSKaroly Pados priv->gpio_output &= ~BIT(gpio); 1970ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1971ba93cc7dSKaroly Pados 1972ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1973ba93cc7dSKaroly Pados 1974ba93cc7dSKaroly Pados return result; 1975ba93cc7dSKaroly Pados } 1976ba93cc7dSKaroly Pados 1977ba93cc7dSKaroly Pados static int ftdi_gpio_direction_output(struct gpio_chip *gc, unsigned int gpio, 1978ba93cc7dSKaroly Pados int value) 1979ba93cc7dSKaroly Pados { 1980ba93cc7dSKaroly Pados struct usb_serial_port *port = gpiochip_get_data(gc); 1981ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 1982ba93cc7dSKaroly Pados int result; 1983ba93cc7dSKaroly Pados 1984ba93cc7dSKaroly Pados mutex_lock(&priv->gpio_lock); 1985ba93cc7dSKaroly Pados 1986ba93cc7dSKaroly Pados priv->gpio_output |= BIT(gpio); 1987ba93cc7dSKaroly Pados if (value) 1988ba93cc7dSKaroly Pados priv->gpio_value |= BIT(gpio); 1989ba93cc7dSKaroly Pados else 1990ba93cc7dSKaroly Pados priv->gpio_value &= ~BIT(gpio); 1991ba93cc7dSKaroly Pados 1992ba93cc7dSKaroly Pados result = ftdi_set_cbus_pins(port); 1993ba93cc7dSKaroly Pados 1994ba93cc7dSKaroly Pados mutex_unlock(&priv->gpio_lock); 1995ba93cc7dSKaroly Pados 1996ba93cc7dSKaroly Pados return result; 1997ba93cc7dSKaroly Pados } 1998ba93cc7dSKaroly Pados 1999ba93cc7dSKaroly Pados static int ftdi_read_eeprom(struct usb_serial *serial, void *dst, u16 addr, 2000ba93cc7dSKaroly Pados u16 nbytes) 2001ba93cc7dSKaroly Pados { 2002ba93cc7dSKaroly Pados int read = 0; 2003ba93cc7dSKaroly Pados 2004ba93cc7dSKaroly Pados if (addr % 2 != 0) 2005ba93cc7dSKaroly Pados return -EINVAL; 2006ba93cc7dSKaroly Pados if (nbytes % 2 != 0) 2007ba93cc7dSKaroly Pados return -EINVAL; 2008ba93cc7dSKaroly Pados 2009ba93cc7dSKaroly Pados /* Read EEPROM two bytes at a time */ 2010ba93cc7dSKaroly Pados while (read < nbytes) { 2011ba93cc7dSKaroly Pados int rv; 2012ba93cc7dSKaroly Pados 2013ba93cc7dSKaroly Pados rv = usb_control_msg(serial->dev, 2014ba93cc7dSKaroly Pados usb_rcvctrlpipe(serial->dev, 0), 2015ba93cc7dSKaroly Pados FTDI_SIO_READ_EEPROM_REQUEST, 2016ba93cc7dSKaroly Pados FTDI_SIO_READ_EEPROM_REQUEST_TYPE, 2017ba93cc7dSKaroly Pados 0, (addr + read) / 2, dst + read, 2, 2018ba93cc7dSKaroly Pados WDR_TIMEOUT); 2019ba93cc7dSKaroly Pados if (rv < 2) { 2020ba93cc7dSKaroly Pados if (rv >= 0) 2021ba93cc7dSKaroly Pados return -EIO; 2022ba93cc7dSKaroly Pados else 2023ba93cc7dSKaroly Pados return rv; 2024ba93cc7dSKaroly Pados } 2025ba93cc7dSKaroly Pados 2026ba93cc7dSKaroly Pados read += rv; 2027ba93cc7dSKaroly Pados } 2028ba93cc7dSKaroly Pados 2029ba93cc7dSKaroly Pados return 0; 2030ba93cc7dSKaroly Pados } 2031ba93cc7dSKaroly Pados 20327a786b84SMatthew Michilot static int ftdi_gpio_init_ft232h(struct usb_serial_port *port) 20337a786b84SMatthew Michilot { 20347a786b84SMatthew Michilot struct ftdi_private *priv = usb_get_serial_port_data(port); 20357a786b84SMatthew Michilot u16 cbus_config; 20367a786b84SMatthew Michilot u8 *buf; 20377a786b84SMatthew Michilot int ret; 20387a786b84SMatthew Michilot int i; 20397a786b84SMatthew Michilot 20407a786b84SMatthew Michilot buf = kmalloc(4, GFP_KERNEL); 20417a786b84SMatthew Michilot if (!buf) 20427a786b84SMatthew Michilot return -ENOMEM; 20437a786b84SMatthew Michilot 20447a786b84SMatthew Michilot ret = ftdi_read_eeprom(port->serial, buf, 0x1a, 4); 20457a786b84SMatthew Michilot if (ret < 0) 20467a786b84SMatthew Michilot goto out_free; 20477a786b84SMatthew Michilot 20487a786b84SMatthew Michilot /* 20497a786b84SMatthew Michilot * FT232H CBUS Memory Map 20507a786b84SMatthew Michilot * 20517a786b84SMatthew Michilot * 0x1a: X- (upper nibble -> AC5) 20527a786b84SMatthew Michilot * 0x1b: -X (lower nibble -> AC6) 20537a786b84SMatthew Michilot * 0x1c: XX (upper nibble -> AC9 | lower nibble -> AC8) 20547a786b84SMatthew Michilot */ 20557a786b84SMatthew Michilot cbus_config = buf[2] << 8 | (buf[1] & 0xf) << 4 | (buf[0] & 0xf0) >> 4; 20567a786b84SMatthew Michilot 20577a786b84SMatthew Michilot priv->gc.ngpio = 4; 20587a786b84SMatthew Michilot priv->gpio_altfunc = 0xff; 20597a786b84SMatthew Michilot 20607a786b84SMatthew Michilot for (i = 0; i < priv->gc.ngpio; ++i) { 20617a786b84SMatthew Michilot if ((cbus_config & 0xf) == FTDI_FTX_CBUS_MUX_GPIO) 20627a786b84SMatthew Michilot priv->gpio_altfunc &= ~BIT(i); 20637a786b84SMatthew Michilot cbus_config >>= 4; 20647a786b84SMatthew Michilot } 20657a786b84SMatthew Michilot 20667a786b84SMatthew Michilot out_free: 20677a786b84SMatthew Michilot kfree(buf); 20687a786b84SMatthew Michilot 20697a786b84SMatthew Michilot return ret; 20707a786b84SMatthew Michilot } 20717a786b84SMatthew Michilot 2072ff32d97eSJohan Hovold static int ftdi_gpio_init_ft232r(struct usb_serial_port *port) 2073ff32d97eSJohan Hovold { 2074ff32d97eSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2075ff32d97eSJohan Hovold u16 cbus_config; 2076ff32d97eSJohan Hovold u8 *buf; 2077ff32d97eSJohan Hovold int ret; 2078ff32d97eSJohan Hovold int i; 2079ff32d97eSJohan Hovold 2080ff32d97eSJohan Hovold buf = kmalloc(2, GFP_KERNEL); 2081ff32d97eSJohan Hovold if (!buf) 2082ff32d97eSJohan Hovold return -ENOMEM; 2083ff32d97eSJohan Hovold 2084ff32d97eSJohan Hovold ret = ftdi_read_eeprom(port->serial, buf, 0x14, 2); 2085ff32d97eSJohan Hovold if (ret < 0) 2086ff32d97eSJohan Hovold goto out_free; 2087ff32d97eSJohan Hovold 2088ff32d97eSJohan Hovold cbus_config = le16_to_cpup((__le16 *)buf); 2089ff32d97eSJohan Hovold dev_dbg(&port->dev, "cbus_config = 0x%04x\n", cbus_config); 2090ff32d97eSJohan Hovold 2091ff32d97eSJohan Hovold priv->gc.ngpio = 4; 2092ff32d97eSJohan Hovold 2093ff32d97eSJohan Hovold priv->gpio_altfunc = 0xff; 2094ff32d97eSJohan Hovold for (i = 0; i < priv->gc.ngpio; ++i) { 2095ff32d97eSJohan Hovold if ((cbus_config & 0xf) == FTDI_FT232R_CBUS_MUX_GPIO) 2096ff32d97eSJohan Hovold priv->gpio_altfunc &= ~BIT(i); 2097ff32d97eSJohan Hovold cbus_config >>= 4; 2098ff32d97eSJohan Hovold } 2099ff32d97eSJohan Hovold out_free: 2100ff32d97eSJohan Hovold kfree(buf); 2101ff32d97eSJohan Hovold 2102ff32d97eSJohan Hovold return ret; 2103ff32d97eSJohan Hovold } 2104ff32d97eSJohan Hovold 2105ff32d97eSJohan Hovold static int ftdi_gpio_init_ftx(struct usb_serial_port *port) 2106ba93cc7dSKaroly Pados { 2107ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2108ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 2109ba93cc7dSKaroly Pados const u16 cbus_cfg_addr = 0x1a; 2110ba93cc7dSKaroly Pados const u16 cbus_cfg_size = 4; 2111ba93cc7dSKaroly Pados u8 *cbus_cfg_buf; 2112ba93cc7dSKaroly Pados int result; 2113ba93cc7dSKaroly Pados u8 i; 2114ba93cc7dSKaroly Pados 2115ba93cc7dSKaroly Pados cbus_cfg_buf = kmalloc(cbus_cfg_size, GFP_KERNEL); 2116ba93cc7dSKaroly Pados if (!cbus_cfg_buf) 2117ba93cc7dSKaroly Pados return -ENOMEM; 2118ba93cc7dSKaroly Pados 2119ba93cc7dSKaroly Pados result = ftdi_read_eeprom(serial, cbus_cfg_buf, 2120ba93cc7dSKaroly Pados cbus_cfg_addr, cbus_cfg_size); 2121ba93cc7dSKaroly Pados if (result < 0) 2122ba93cc7dSKaroly Pados goto out_free; 2123ba93cc7dSKaroly Pados 2124ba93cc7dSKaroly Pados /* FIXME: FT234XD alone has 1 GPIO, but how to recognize this IC? */ 2125ba93cc7dSKaroly Pados priv->gc.ngpio = 4; 2126ba93cc7dSKaroly Pados 2127ba93cc7dSKaroly Pados /* Determine which pins are configured for CBUS bitbanging */ 2128ba93cc7dSKaroly Pados priv->gpio_altfunc = 0xff; 2129ba93cc7dSKaroly Pados for (i = 0; i < priv->gc.ngpio; ++i) { 2130ba93cc7dSKaroly Pados if (cbus_cfg_buf[i] == FTDI_FTX_CBUS_MUX_GPIO) 2131ba93cc7dSKaroly Pados priv->gpio_altfunc &= ~BIT(i); 2132ba93cc7dSKaroly Pados } 2133ba93cc7dSKaroly Pados 2134ba93cc7dSKaroly Pados out_free: 2135ba93cc7dSKaroly Pados kfree(cbus_cfg_buf); 2136ba93cc7dSKaroly Pados 2137ba93cc7dSKaroly Pados return result; 2138ba93cc7dSKaroly Pados } 2139ba93cc7dSKaroly Pados 2140ba93cc7dSKaroly Pados static int ftdi_gpio_init(struct usb_serial_port *port) 2141ba93cc7dSKaroly Pados { 2142ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2143ba93cc7dSKaroly Pados struct usb_serial *serial = port->serial; 2144ba93cc7dSKaroly Pados int result; 2145ba93cc7dSKaroly Pados 2146ba93cc7dSKaroly Pados switch (priv->chip_type) { 21477a786b84SMatthew Michilot case FT232H: 21487a786b84SMatthew Michilot result = ftdi_gpio_init_ft232h(port); 21497a786b84SMatthew Michilot break; 2150ff32d97eSJohan Hovold case FT232RL: 2151ff32d97eSJohan Hovold result = ftdi_gpio_init_ft232r(port); 2152ff32d97eSJohan Hovold break; 2153ba93cc7dSKaroly Pados case FTX: 2154ff32d97eSJohan Hovold result = ftdi_gpio_init_ftx(port); 2155ba93cc7dSKaroly Pados break; 2156ba93cc7dSKaroly Pados default: 2157ba93cc7dSKaroly Pados return 0; 2158ba93cc7dSKaroly Pados } 2159ba93cc7dSKaroly Pados 2160ba93cc7dSKaroly Pados if (result < 0) 2161ba93cc7dSKaroly Pados return result; 2162ba93cc7dSKaroly Pados 2163ba93cc7dSKaroly Pados mutex_init(&priv->gpio_lock); 2164ba93cc7dSKaroly Pados 2165ba93cc7dSKaroly Pados priv->gc.label = "ftdi-cbus"; 2166ba93cc7dSKaroly Pados priv->gc.request = ftdi_gpio_request; 2167ba93cc7dSKaroly Pados priv->gc.get_direction = ftdi_gpio_direction_get; 2168ba93cc7dSKaroly Pados priv->gc.direction_input = ftdi_gpio_direction_input; 2169ba93cc7dSKaroly Pados priv->gc.direction_output = ftdi_gpio_direction_output; 2170ba93cc7dSKaroly Pados priv->gc.get = ftdi_gpio_get; 2171ba93cc7dSKaroly Pados priv->gc.set = ftdi_gpio_set; 2172ba93cc7dSKaroly Pados priv->gc.get_multiple = ftdi_gpio_get_multiple; 2173ba93cc7dSKaroly Pados priv->gc.set_multiple = ftdi_gpio_set_multiple; 2174ba93cc7dSKaroly Pados priv->gc.owner = THIS_MODULE; 2175ba93cc7dSKaroly Pados priv->gc.parent = &serial->interface->dev; 2176ba93cc7dSKaroly Pados priv->gc.base = -1; 2177ba93cc7dSKaroly Pados priv->gc.can_sleep = true; 2178ba93cc7dSKaroly Pados 2179ba93cc7dSKaroly Pados result = gpiochip_add_data(&priv->gc, port); 2180ba93cc7dSKaroly Pados if (!result) 2181ba93cc7dSKaroly Pados priv->gpio_registered = true; 2182ba93cc7dSKaroly Pados 2183ba93cc7dSKaroly Pados return result; 2184ba93cc7dSKaroly Pados } 2185ba93cc7dSKaroly Pados 2186ba93cc7dSKaroly Pados static void ftdi_gpio_remove(struct usb_serial_port *port) 2187ba93cc7dSKaroly Pados { 2188ba93cc7dSKaroly Pados struct ftdi_private *priv = usb_get_serial_port_data(port); 2189ba93cc7dSKaroly Pados 2190ba93cc7dSKaroly Pados if (priv->gpio_registered) { 2191ba93cc7dSKaroly Pados gpiochip_remove(&priv->gc); 2192ba93cc7dSKaroly Pados priv->gpio_registered = false; 2193ba93cc7dSKaroly Pados } 2194ba93cc7dSKaroly Pados 2195ba93cc7dSKaroly Pados if (priv->gpio_used) { 2196ba93cc7dSKaroly Pados /* Exiting CBUS-mode does not reset pin states. */ 2197ba93cc7dSKaroly Pados ftdi_exit_cbus_mode(port); 2198ba93cc7dSKaroly Pados priv->gpio_used = false; 2199ba93cc7dSKaroly Pados } 2200ba93cc7dSKaroly Pados } 2201ba93cc7dSKaroly Pados 2202ba93cc7dSKaroly Pados #else 2203ba93cc7dSKaroly Pados 2204ba93cc7dSKaroly Pados static int ftdi_gpio_init(struct usb_serial_port *port) 2205ba93cc7dSKaroly Pados { 2206ba93cc7dSKaroly Pados return 0; 2207ba93cc7dSKaroly Pados } 2208ba93cc7dSKaroly Pados 2209ba93cc7dSKaroly Pados static void ftdi_gpio_remove(struct usb_serial_port *port) { } 2210ba93cc7dSKaroly Pados 2211ba93cc7dSKaroly Pados #endif /* CONFIG_GPIOLIB */ 2212ba93cc7dSKaroly Pados 22131da177e4SLinus Torvalds /* 22141da177e4SLinus Torvalds * *************************************************************************** 22151da177e4SLinus Torvalds * FTDI driver specific functions 22161da177e4SLinus Torvalds * *************************************************************************** 22171da177e4SLinus Torvalds */ 22181da177e4SLinus Torvalds 22198f977e42SIan Abbott /* Probe function to check for special devices */ 2220464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 2221464cbb24SAlan Cox const struct usb_device_id *id) 22228f977e42SIan Abbott { 22233c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = 2224464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 2225fa91d43bSTony Lindgren 2226fa91d43bSTony Lindgren if (quirk && quirk->probe) { 2227fa91d43bSTony Lindgren int ret = quirk->probe(serial); 2228fa91d43bSTony Lindgren if (ret != 0) 2229fa91d43bSTony Lindgren return ret; 2230fa91d43bSTony Lindgren } 2231fa91d43bSTony Lindgren 22328f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 22338f977e42SIan Abbott 2234fa91d43bSTony Lindgren return 0; 22358f977e42SIan Abbott } 22368f977e42SIan Abbott 223712bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 22381da177e4SLinus Torvalds { 22391da177e4SLinus Torvalds struct ftdi_private *priv; 22403c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 2241ba93cc7dSKaroly Pados int result; 22421da177e4SLinus Torvalds 224380b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 224410c642d0SJohan Hovold if (!priv) 22451da177e4SLinus Torvalds return -ENOMEM; 22461da177e4SLinus Torvalds 2247bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 22480076b4beSJohan Hovold 22490ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 22500ffbbe25SOliver Neukum quirk->port_probe(priv); 22510ffbbe25SOliver Neukum 225212bdbe03SJim Radford usb_set_serial_port_data(port, priv); 22531da177e4SLinus Torvalds 225412bdbe03SJim Radford ftdi_determine_type(port); 2255895f28baSMark Adamson ftdi_set_max_packet_size(port); 22568c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 22578c4f99cdSJohan Hovold priv->latency = 16; 2258c19db4c9SJohan Hovold write_latency_timer(port); 225912bdbe03SJim Radford create_sysfs_attrs(port); 2260ba93cc7dSKaroly Pados 2261ba93cc7dSKaroly Pados result = ftdi_gpio_init(port); 2262ba93cc7dSKaroly Pados if (result < 0) { 2263ba93cc7dSKaroly Pados dev_err(&port->serial->interface->dev, 2264ba93cc7dSKaroly Pados "GPIO initialisation failed: %d\n", 2265ba93cc7dSKaroly Pados result); 2266ba93cc7dSKaroly Pados } 2267ba93cc7dSKaroly Pados 226812bdbe03SJim Radford return 0; 22691da177e4SLinus Torvalds } 22701da177e4SLinus Torvalds 22718f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 22728f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 22731da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 22740ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 22751da177e4SLinus Torvalds { 22761da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 22771da177e4SLinus Torvalds priv->custom_divisor = 77; 2278669a6db1SAlan Cox priv->force_baud = 38400; 2279e49bbce1SJohan Hovold } 22801da177e4SLinus Torvalds 22818f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 22828f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 2283464cbb24SAlan Cox 22840ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 22858f977e42SIan Abbott { 22861da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 22871da177e4SLinus Torvalds priv->custom_divisor = 240; 2288669a6db1SAlan Cox priv->force_baud = 38400; 22891da177e4SLinus Torvalds priv->force_rtscts = 1; 2290e49bbce1SJohan Hovold } 22911da177e4SLinus Torvalds 2292fa91d43bSTony Lindgren /* 2293b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 2294970e2486SLucas De Marchi * If this value is not set in /etc/modprobe.d/ its value will be set 2295970e2486SLucas De Marchi * to 1ms. 2296b760dac2SMartin Geleynse */ 2297b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 2298b760dac2SMartin Geleynse 2299b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 2300b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 2301b760dac2SMartin Geleynse * 2302b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 2303b760dac2SMartin Geleynse */ 2304b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 2305b760dac2SMartin Geleynse { 2306b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 2307b760dac2SMartin Geleynse int latency = ndi_latency_timer; 2308b760dac2SMartin Geleynse 2309b760dac2SMartin Geleynse if (latency == 0) 2310b760dac2SMartin Geleynse latency = 1; 2311b760dac2SMartin Geleynse if (latency > 99) 2312b760dac2SMartin Geleynse latency = 99; 2313b760dac2SMartin Geleynse 2314bfc51614SGreg Kroah-Hartman dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); 2315bfc51614SGreg Kroah-Hartman dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); 2316b760dac2SMartin Geleynse 2317c1284d77SJohan Hovold /* FIXME: errors are not returned */ 2318c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 2319b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 2320b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 232166e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 2322b760dac2SMartin Geleynse return 0; 2323b760dac2SMartin Geleynse } 2324b760dac2SMartin Geleynse 2325b760dac2SMartin Geleynse /* 232620734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 232720734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 232820734345SHarald Welte * userspace using openocd. 2329fa91d43bSTony Lindgren */ 233020734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 2331fa91d43bSTony Lindgren { 2332fa91d43bSTony Lindgren struct usb_device *udev = serial->dev; 2333fa91d43bSTony Lindgren struct usb_interface *interface = serial->interface; 2334fa91d43bSTony Lindgren 2335fa91d43bSTony Lindgren if (interface == udev->actconfig->interface[0]) { 2336c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, 2337c197a8dbSGreg Kroah-Hartman "Ignoring serial port reserved for JTAG\n"); 2338fa91d43bSTony Lindgren return -ENODEV; 2339fa91d43bSTony Lindgren } 2340fa91d43bSTony Lindgren 2341fa91d43bSTony Lindgren return 0; 2342fa91d43bSTony Lindgren } 23431da177e4SLinus Torvalds 2344c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial) 2345c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { 2346c96fbdd0SJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 2347c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2348b229a0f8SDoug Goldstein if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) 2349b229a0f8SDoug Goldstein return ftdi_jtag_probe(serial); 2350b229a0f8SDoug Goldstein 2351b229a0f8SDoug Goldstein if (udev->product && 2352470b5d6fSVasyl Vavrychuk (!strcmp(udev->product, "Arrow USB Blaster") || 2353470b5d6fSVasyl Vavrychuk !strcmp(udev->product, "BeagleBone/XDS100V2") || 2354b229a0f8SDoug Goldstein !strcmp(udev->product, "SNAP Connect E10"))) 2355c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return ftdi_jtag_probe(serial); 2356c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2357c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return 0; 2358c96fbdd0SJean-Christophe PLAGNIOL-VILLARD } 2359c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 2360546d7eecSKevin Vance /* 236171d9a2b9SAdrian Thomasset * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's 236271d9a2b9SAdrian Thomasset * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and 236371d9a2b9SAdrian Thomasset * can be accessed from userspace. 236471d9a2b9SAdrian Thomasset * The next two ports are enabled as UARTs by default, where port 2 is 236571d9a2b9SAdrian Thomasset * a conventional RS-232 UART. 23666ec2f46cSJean-Christophe PLAGNIOL-VILLARD */ 23676ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial) 23686ec2f46cSJean-Christophe PLAGNIOL-VILLARD { 23696ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 23706ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_interface *interface = serial->interface; 23716ec2f46cSJean-Christophe PLAGNIOL-VILLARD 237271d9a2b9SAdrian Thomasset if (interface == udev->actconfig->interface[0] || 237371d9a2b9SAdrian Thomasset interface == udev->actconfig->interface[1]) { 23746ec2f46cSJean-Christophe PLAGNIOL-VILLARD dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); 23756ec2f46cSJean-Christophe PLAGNIOL-VILLARD return -ENODEV; 23766ec2f46cSJean-Christophe PLAGNIOL-VILLARD } 23776ec2f46cSJean-Christophe PLAGNIOL-VILLARD 237871d9a2b9SAdrian Thomasset return 0; 237971d9a2b9SAdrian Thomasset } 238071d9a2b9SAdrian Thomasset 238112bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 238212bdbe03SJim Radford { 23831da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 23841da177e4SLinus Torvalds 2385ba93cc7dSKaroly Pados ftdi_gpio_remove(port); 2386ba93cc7dSKaroly Pados 238712bdbe03SJim Radford remove_sysfs_attrs(port); 23881da177e4SLinus Torvalds 23894cba98ffSJohan Hovold kfree(priv); 23901da177e4SLinus Torvalds 239112bdbe03SJim Radford return 0; 239212bdbe03SJim Radford } 23931da177e4SLinus Torvalds 2394a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 2395e49bbce1SJohan Hovold { 23961da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 23971da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 23981da177e4SLinus Torvalds 23991da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 24001da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 24011da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 24021da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 24031da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 240466e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 24051da177e4SLinus Torvalds 24061da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 2407c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 24081da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 24091da177e4SLinus Torvalds 24101da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 2411be0278ccSJohan Hovold if (tty) 2412be0278ccSJohan Hovold ftdi_set_termios(tty, port, NULL); 24131da177e4SLinus Torvalds 24144cba98ffSJohan Hovold return usb_serial_generic_open(tty, port); 2415e49bbce1SJohan Hovold } 24161da177e4SLinus Torvalds 2417335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 2418335f8514SAlan Cox { 2419335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 2420335f8514SAlan Cox 2421335f8514SAlan Cox /* Disable flow control */ 2422b2ca6990SJohan Hovold if (!on) { 2423b2ca6990SJohan Hovold if (usb_control_msg(port->serial->dev, 2424335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 2425335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 2426335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 242766e47e60SJohan Hovold 0, priv->interface, NULL, 0, 2428335f8514SAlan Cox WDR_TIMEOUT) < 0) { 2429335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 2430335f8514SAlan Cox } 2431b2ca6990SJohan Hovold } 2432335f8514SAlan Cox /* drop RTS and DTR */ 2433335f8514SAlan Cox if (on) 2434335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2435335f8514SAlan Cox else 2436335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2437335f8514SAlan Cox } 24381da177e4SLinus Torvalds 24391da177e4SLinus Torvalds /* The SIO requires the first byte to have: 24401da177e4SLinus Torvalds * B0 1 24411da177e4SLinus Torvalds * B1 0 24421da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 24431da177e4SLinus Torvalds * 24441da177e4SLinus Torvalds * The new devices do not require this byte 24451da177e4SLinus Torvalds */ 2446d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 2447c23e5fc1SJohan Hovold void *dest, size_t size) 2448e49bbce1SJohan Hovold { 2449d3901a06SJohan Hovold struct ftdi_private *priv; 2450c23e5fc1SJohan Hovold int count; 2451c23e5fc1SJohan Hovold unsigned long flags; 24521da177e4SLinus Torvalds 2453d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 24541da177e4SLinus Torvalds 2455e8770484SJohan Hovold if (priv->chip_type == SIO) { 2456c23e5fc1SJohan Hovold unsigned char *buffer = dest; 2457c23e5fc1SJohan Hovold int i, len, c; 24581da177e4SLinus Torvalds 2459c23e5fc1SJohan Hovold count = 0; 2460c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 2461c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 2462c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 2463c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 2464c23e5fc1SJohan Hovold if (!c) 2465c23e5fc1SJohan Hovold break; 2466cb1676a6SJohan Hovold port->icount.tx += c; 2467c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 2468c23e5fc1SJohan Hovold count += c + 1; 24691da177e4SLinus Torvalds } 2470c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 24711da177e4SLinus Torvalds } else { 2472c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 2473c23e5fc1SJohan Hovold &port->lock); 2474cb1676a6SJohan Hovold port->icount.tx += count; 24751da177e4SLinus Torvalds } 24761da177e4SLinus Torvalds 24771da177e4SLinus Torvalds return count; 247895da310eSAlan Cox } 24791da177e4SLinus Torvalds 2480166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 2481166ceb69SJohan Hovold 248292a19f9cSJiri Slaby static int ftdi_process_packet(struct usb_serial_port *port, 2483ab4cc4efSJohan Hovold struct ftdi_private *priv, unsigned char *buf, int len) 248495da310eSAlan Cox { 2485ab4cc4efSJohan Hovold unsigned char status; 24861da177e4SLinus Torvalds int i; 2487cc01f17dSJohan Hovold char flag; 24881da177e4SLinus Torvalds 2489cc01f17dSJohan Hovold if (len < 2) { 2490bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "malformed packet\n"); 2491cc01f17dSJohan Hovold return 0; 24921da177e4SLinus Torvalds } 24931da177e4SLinus Torvalds 2494464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 2495464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 2496464cbb24SAlan Cox are only processed once. */ 2497ab4cc4efSJohan Hovold status = buf[0] & FTDI_STATUS_B0_MASK; 2498cc01f17dSJohan Hovold if (status != priv->prev_status) { 2499fca5430dSSimon Arlott char diff_status = status ^ priv->prev_status; 2500fca5430dSSimon Arlott 2501fca5430dSSimon Arlott if (diff_status & FTDI_RS0_CTS) 2502cb1676a6SJohan Hovold port->icount.cts++; 2503fca5430dSSimon Arlott if (diff_status & FTDI_RS0_DSR) 2504cb1676a6SJohan Hovold port->icount.dsr++; 2505fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RI) 2506cb1676a6SJohan Hovold port->icount.rng++; 2507d14654dfSPaul Chavent if (diff_status & FTDI_RS0_RLSD) { 2508d14654dfSPaul Chavent struct tty_struct *tty; 2509d14654dfSPaul Chavent 2510cb1676a6SJohan Hovold port->icount.dcd++; 2511d14654dfSPaul Chavent tty = tty_port_tty_get(&port->port); 2512d14654dfSPaul Chavent if (tty) 2513d14654dfSPaul Chavent usb_serial_handle_dcd_change(port, tty, 2514d14654dfSPaul Chavent status & FTDI_RS0_RLSD); 2515d14654dfSPaul Chavent tty_kref_put(tty); 2516d14654dfSPaul Chavent } 2517fca5430dSSimon Arlott 2518f307e5cdSJohan Hovold wake_up_interruptible(&port->port.delta_msr_wait); 2519cc01f17dSJohan Hovold priv->prev_status = status; 25201da177e4SLinus Torvalds } 25211da177e4SLinus Torvalds 2522a6bb1e17SJohan Hovold /* save if the transmitter is empty or not */ 2523ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_TEMT) 2524a6bb1e17SJohan Hovold priv->transmit_empty = 1; 2525a6bb1e17SJohan Hovold else 2526a6bb1e17SJohan Hovold priv->transmit_empty = 0; 2527a6bb1e17SJohan Hovold 2528*ce054039SJohan Hovold if (len == 2) 2529a6bb1e17SJohan Hovold return 0; /* status only */ 2530a6bb1e17SJohan Hovold 2531a6bb1e17SJohan Hovold /* 2532a6bb1e17SJohan Hovold * Break and error status must only be processed for packets with 2533a6bb1e17SJohan Hovold * data payload to avoid over-reporting. 2534a6bb1e17SJohan Hovold */ 2535cc01f17dSJohan Hovold flag = TTY_NORMAL; 2536ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_ERR_MASK) { 2537166ceb69SJohan Hovold /* Break takes precedence over parity, which takes precedence 2538166ceb69SJohan Hovold * over framing errors */ 2539ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_BI) { 2540cc01f17dSJohan Hovold flag = TTY_BREAK; 2541cb1676a6SJohan Hovold port->icount.brk++; 254272fda3caSJason Wessel usb_serial_handle_break(port); 2543ab4cc4efSJohan Hovold } else if (buf[1] & FTDI_RS_PE) { 2544cc01f17dSJohan Hovold flag = TTY_PARITY; 2545cb1676a6SJohan Hovold port->icount.parity++; 2546ab4cc4efSJohan Hovold } else if (buf[1] & FTDI_RS_FE) { 2547cc01f17dSJohan Hovold flag = TTY_FRAME; 2548cb1676a6SJohan Hovold port->icount.frame++; 2549166ceb69SJohan Hovold } 2550166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 2551ab4cc4efSJohan Hovold if (buf[1] & FTDI_RS_OE) { 2552cb1676a6SJohan Hovold port->icount.overrun++; 255392a19f9cSJiri Slaby tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 25541da177e4SLinus Torvalds } 2555005b3cdeSUwe Bonnes } 25561da177e4SLinus Torvalds 2557*ce054039SJohan Hovold port->icount.rx += len - 2; 2558cc01f17dSJohan Hovold 255949b2597aSJohan Hovold if (port->port.console && port->sysrq) { 2560*ce054039SJohan Hovold for (i = 2; i < len; i++) { 2561*ce054039SJohan Hovold if (usb_serial_handle_sysrq_char(port, buf[i])) 2562*ce054039SJohan Hovold continue; 2563*ce054039SJohan Hovold tty_insert_flip_char(&port->port, buf[i], flag); 2564cc01f17dSJohan Hovold } 256549b2597aSJohan Hovold } else { 2566*ce054039SJohan Hovold tty_insert_flip_string_fixed_flag(&port->port, buf + 2, flag, 2567*ce054039SJohan Hovold len - 2); 2568cc01f17dSJohan Hovold } 256949b2597aSJohan Hovold 2570*ce054039SJohan Hovold return len - 2; 2571cc01f17dSJohan Hovold } 2572cc01f17dSJohan Hovold 25731b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 2574cc01f17dSJohan Hovold { 25751b551015SJohan Hovold struct usb_serial_port *port = urb->context; 2576cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2577cc01f17dSJohan Hovold char *data = (char *)urb->transfer_buffer; 2578cc01f17dSJohan Hovold int i; 2579cc01f17dSJohan Hovold int len; 2580cc01f17dSJohan Hovold int count = 0; 2581cc01f17dSJohan Hovold 2582cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 2583cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 258492a19f9cSJiri Slaby count += ftdi_process_packet(port, priv, &data[i], len); 2585cc01f17dSJohan Hovold } 2586cc01f17dSJohan Hovold 2587cc01f17dSJohan Hovold if (count) 25882e124b4aSJiri Slaby tty_flip_buffer_push(&port->port); 2589cc01f17dSJohan Hovold } 25901da177e4SLinus Torvalds 259195da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 25921da177e4SLinus Torvalds { 259395da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 25941da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 259516410115SJohan Hovold u16 value; 25961da177e4SLinus Torvalds 25971da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 25981da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 259916410115SJohan Hovold /* last_set_data_value NEVER has the break bit set in it */ 26001da177e4SLinus Torvalds 2601464cbb24SAlan Cox if (break_state) 260216410115SJohan Hovold value = priv->last_set_data_value | FTDI_SIO_SET_BREAK; 2603464cbb24SAlan Cox else 260416410115SJohan Hovold value = priv->last_set_data_value; 26051da177e4SLinus Torvalds 2606464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 2607464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 26081da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 26091da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 261016410115SJohan Hovold value , priv->interface, 261166e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2612bfc51614SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", 2613bfc51614SGreg Kroah-Hartman __func__, break_state); 26141da177e4SLinus Torvalds } 26151da177e4SLinus Torvalds 2616bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, 261716410115SJohan Hovold break_state, value); 26181da177e4SLinus Torvalds 26191da177e4SLinus Torvalds } 26201da177e4SLinus Torvalds 2621a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port) 26226f602912SJarkko Huijts { 26235fb0432eSJohan Hovold unsigned char buf[2]; 26246f602912SJarkko Huijts int ret; 26256f602912SJarkko Huijts 2626c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 26275fb0432eSJohan Hovold if (ret == 2) { 26286f602912SJarkko Huijts if (!(buf[1] & FTDI_RS_TEMT)) 2629a37025b5SJohan Hovold return false; 26305fb0432eSJohan Hovold } 26316f602912SJarkko Huijts 2632a37025b5SJohan Hovold return true; 26336f602912SJarkko Huijts } 26346f602912SJarkko Huijts 26351da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 26361da177e4SLinus Torvalds * the new setting to be used 26371da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 26381da177e4SLinus Torvalds */ 263995da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 264095da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 2641e49bbce1SJohan Hovold { 26421da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 2643bfc51614SGreg Kroah-Hartman struct device *ddev = &port->dev; 26441da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2645adc8d746SAlan Cox struct ktermios *termios = &tty->termios; 2646669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 2647df1cd63dSJohan Hovold u16 value, index; 2648df1cd63dSJohan Hovold int ret; 26491da177e4SLinus Torvalds 2650464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 2651464cbb24SAlan Cox B0. */ 2652669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 2653bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); 265495da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 2655bd5e47ccSAndrew Morton priv->force_baud); 26561da177e4SLinus Torvalds } 26571da177e4SLinus Torvalds 26581da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 26591da177e4SLinus Torvalds if (priv->force_rtscts) { 2660bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); 2661669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 26621da177e4SLinus Torvalds } 26631da177e4SLinus Torvalds 26648704211fSColin Leitner /* 2665c1f15196SColin Leitner * All FTDI UART chips are limited to CS7/8. We shouldn't pretend to 26668704211fSColin Leitner * support CS5/6 and revert the CSIZE setting instead. 2667c1f15196SColin Leitner * 2668c1f15196SColin Leitner * CS5 however is used to control some smartcard readers which abuse 2669c1f15196SColin Leitner * this limitation to switch modes. Original FTDI chips fall back to 2670c1f15196SColin Leitner * eight data bits. 2671c1f15196SColin Leitner * 2672c1f15196SColin Leitner * TODO: Implement a quirk to only allow this with mentioned 2673c1f15196SColin Leitner * readers. One I know of (Argolis Smartreader V1) 2674c1f15196SColin Leitner * returns "USB smartcard server" as iInterface string. 2675c1f15196SColin Leitner * The vendor didn't bother with a custom VID/PID of 2676c1f15196SColin Leitner * course. 26778704211fSColin Leitner */ 2678c1f15196SColin Leitner if (C_CSIZE(tty) == CS6) { 26798704211fSColin Leitner dev_warn(ddev, "requested CSIZE setting not supported\n"); 26808704211fSColin Leitner 26818704211fSColin Leitner termios->c_cflag &= ~CSIZE; 26828704211fSColin Leitner if (old_termios) 26838704211fSColin Leitner termios->c_cflag |= old_termios->c_cflag & CSIZE; 26848704211fSColin Leitner else 26858704211fSColin Leitner termios->c_cflag |= CS8; 26868704211fSColin Leitner } 26878704211fSColin Leitner 2688669a6db1SAlan Cox cflag = termios->c_cflag; 26891da177e4SLinus Torvalds 2690a816e311SYing Xue if (!old_termios) 2691c515598eSAndrew Worsley goto no_skip; 2692c515598eSAndrew Worsley 2693b1ffb4c8SAndrew Worsley if (old_termios->c_cflag == termios->c_cflag 2694b1ffb4c8SAndrew Worsley && old_termios->c_ispeed == termios->c_ispeed 2695b1ffb4c8SAndrew Worsley && old_termios->c_ospeed == termios->c_ospeed) 2696b1ffb4c8SAndrew Worsley goto no_c_cflag_changes; 2697b1ffb4c8SAndrew Worsley 26981da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 2699464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 2700464cbb24SAlan Cox don't see any problems yet */ 27011da177e4SLinus Torvalds 2702b1ffb4c8SAndrew Worsley if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) == 2703b1ffb4c8SAndrew Worsley (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) 2704b1ffb4c8SAndrew Worsley goto no_data_parity_stop_changes; 2705b1ffb4c8SAndrew Worsley 2706c515598eSAndrew Worsley no_skip: 27071da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 27081da177e4SLinus Torvalds 270916410115SJohan Hovold value = 0; 271016410115SJohan Hovold value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 27111da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 271238fcb830SRoland Koebler if (cflag & PARENB) { 271338fcb830SRoland Koebler if (cflag & CMSPAR) 271416410115SJohan Hovold value |= cflag & PARODD ? 271538fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 271638fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 271738fcb830SRoland Koebler else 271816410115SJohan Hovold value |= cflag & PARODD ? 271938fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 272038fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 272138fcb830SRoland Koebler } else { 272216410115SJohan Hovold value |= FTDI_SIO_SET_DATA_PARITY_NONE; 272338fcb830SRoland Koebler } 27241da177e4SLinus Torvalds switch (cflag & CSIZE) { 2725c1f15196SColin Leitner case CS5: 2726c1f15196SColin Leitner dev_dbg(ddev, "Setting CS5 quirk\n"); 2727c1f15196SColin Leitner break; 2728bfc51614SGreg Kroah-Hartman case CS7: 272916410115SJohan Hovold value |= 7; 2730bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS7\n"); 2731bfc51614SGreg Kroah-Hartman break; 27328704211fSColin Leitner default: 2733bfc51614SGreg Kroah-Hartman case CS8: 273416410115SJohan Hovold value |= 8; 2735bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS8\n"); 2736bfc51614SGreg Kroah-Hartman break; 27371da177e4SLinus Torvalds } 27381da177e4SLinus Torvalds 2739464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 2740464cbb24SAlan Cox - but is or'ed with this value */ 274116410115SJohan Hovold priv->last_set_data_value = value; 27421da177e4SLinus Torvalds 27431da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 27441da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 27451da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 274616410115SJohan Hovold value , priv->interface, 274766e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 2748bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", 2749bfc51614SGreg Kroah-Hartman __func__); 27501da177e4SLinus Torvalds } 27511da177e4SLinus Torvalds 27521da177e4SLinus Torvalds /* Now do the baudrate */ 2753b1ffb4c8SAndrew Worsley no_data_parity_stop_changes: 27541da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 27551da177e4SLinus Torvalds /* Disable flow control */ 27561da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 27571da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 27581da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 27591da177e4SLinus Torvalds 0, priv->interface, 276066e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2761bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s error from disable flowcontrol urb\n", 2762194343d9SGreg Kroah-Hartman __func__); 27631da177e4SLinus Torvalds } 27641da177e4SLinus Torvalds /* Drop RTS and DTR */ 276574ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 27661da177e4SLinus Torvalds } else { 27671da177e4SLinus Torvalds /* set the baudrate determined before */ 27689c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 2769464cbb24SAlan Cox if (change_speed(tty, port)) 2770bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s urb failed to set baudrate\n", __func__); 27719c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 277272a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 27733177130fSJohan Hovold if (old_termios && (old_termios->c_cflag & CBAUD) == B0) 277474ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 27751da177e4SLinus Torvalds } 27761da177e4SLinus Torvalds 2777b1ffb4c8SAndrew Worsley no_c_cflag_changes: 2778df1cd63dSJohan Hovold /* Set hardware-assisted flow control */ 2779df1cd63dSJohan Hovold value = 0; 27801da177e4SLinus Torvalds 2781df1cd63dSJohan Hovold if (C_CRTSCTS(tty)) { 2782df1cd63dSJohan Hovold dev_dbg(&port->dev, "enabling rts/cts flow control\n"); 2783df1cd63dSJohan Hovold index = FTDI_SIO_RTS_CTS_HS; 2784df1cd63dSJohan Hovold } else if (I_IXON(tty)) { 2785df1cd63dSJohan Hovold dev_dbg(&port->dev, "enabling xon/xoff flow control\n"); 2786df1cd63dSJohan Hovold index = FTDI_SIO_XON_XOFF_HS; 2787df1cd63dSJohan Hovold value = STOP_CHAR(tty) << 8 | START_CHAR(tty); 27881da177e4SLinus Torvalds } else { 2789df1cd63dSJohan Hovold dev_dbg(&port->dev, "disabling flow control\n"); 2790df1cd63dSJohan Hovold index = FTDI_SIO_DISABLE_FLOW_CTRL; 2791df1cd63dSJohan Hovold } 2792df1cd63dSJohan Hovold 2793df1cd63dSJohan Hovold index |= priv->interface; 2794df1cd63dSJohan Hovold 2795df1cd63dSJohan Hovold ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 27961da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 27971da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 2798df1cd63dSJohan Hovold value, index, NULL, 0, WDR_TIMEOUT); 2799df1cd63dSJohan Hovold if (ret < 0) 2800df1cd63dSJohan Hovold dev_err(&port->dev, "failed to set flow control: %d\n", ret); 280195da310eSAlan Cox } 28021da177e4SLinus Torvalds 2803a4afff6bSJohan Hovold /* 2804a4afff6bSJohan Hovold * Get modem-control status. 2805a4afff6bSJohan Hovold * 2806a4afff6bSJohan Hovold * Returns the number of status bytes retrieved (device dependant), or 2807a4afff6bSJohan Hovold * negative error code. 2808a4afff6bSJohan Hovold */ 2809c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 2810a4afff6bSJohan Hovold unsigned char status[2]) 28111da177e4SLinus Torvalds { 28121da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 281366e47e60SJohan Hovold unsigned char *buf; 2814a3f8168bSJohan Hovold int len; 28151da177e4SLinus Torvalds int ret; 28161da177e4SLinus Torvalds 281766e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 281866e47e60SJohan Hovold if (!buf) 281966e47e60SJohan Hovold return -ENOMEM; 2820a3f8168bSJohan Hovold /* 2821a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2822a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2823a3f8168bSJohan Hovold */ 28241da177e4SLinus Torvalds switch (priv->chip_type) { 28251da177e4SLinus Torvalds case SIO: 2826a3f8168bSJohan Hovold len = 1; 28271da177e4SLinus Torvalds break; 28281da177e4SLinus Torvalds case FT8U232AM: 28291da177e4SLinus Torvalds case FT232BM: 28301da177e4SLinus Torvalds case FT2232C: 2831ed6e5282SAndrew M. Bishop case FT232RL: 2832094c2e6dSMark Adamson case FT2232H: 2833094c2e6dSMark Adamson case FT4232H: 2834309427b6SUwe Bonnes case FT232H: 2835dc0827c1SJim Paris case FTX: 2836a3f8168bSJohan Hovold len = 2; 28371da177e4SLinus Torvalds break; 28381da177e4SLinus Torvalds default: 283966e47e60SJohan Hovold ret = -EFAULT; 284066e47e60SJohan Hovold goto out; 28411da177e4SLinus Torvalds } 28421da177e4SLinus Torvalds 2843a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2844a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2845a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2846a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2847a3f8168bSJohan Hovold 0, priv->interface, 2848a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 2849427c3a95SJohan Hovold 2850427c3a95SJohan Hovold /* NOTE: We allow short responses and handle that below. */ 2851427c3a95SJohan Hovold if (ret < 1) { 2852a4afff6bSJohan Hovold dev_err(&port->dev, "failed to get modem status: %d\n", ret); 2853427c3a95SJohan Hovold if (ret >= 0) 2854427c3a95SJohan Hovold ret = -EIO; 28552c2ee545SJohan Hovold ret = usb_translate_errors(ret); 2856a3f8168bSJohan Hovold goto out; 28572c2ee545SJohan Hovold } 2858a3f8168bSJohan Hovold 2859a4afff6bSJohan Hovold status[0] = buf[0]; 2860a4afff6bSJohan Hovold if (ret > 1) 2861a4afff6bSJohan Hovold status[1] = buf[1]; 2862a4afff6bSJohan Hovold else 2863a4afff6bSJohan Hovold status[1] = 0; 2864a4afff6bSJohan Hovold 2865a4afff6bSJohan Hovold dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0], 2866a4afff6bSJohan Hovold status[1]); 2867a4afff6bSJohan Hovold out: 2868a4afff6bSJohan Hovold kfree(buf); 2869a4afff6bSJohan Hovold 2870a4afff6bSJohan Hovold return ret; 2871a4afff6bSJohan Hovold } 2872a4afff6bSJohan Hovold 2873a4afff6bSJohan Hovold static int ftdi_tiocmget(struct tty_struct *tty) 2874a4afff6bSJohan Hovold { 2875a4afff6bSJohan Hovold struct usb_serial_port *port = tty->driver_data; 2876a4afff6bSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2877a4afff6bSJohan Hovold unsigned char buf[2]; 2878a4afff6bSJohan Hovold int ret; 2879a4afff6bSJohan Hovold 2880c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 2881a4afff6bSJohan Hovold if (ret < 0) 2882a4afff6bSJohan Hovold return ret; 2883a4afff6bSJohan Hovold 288466e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 28851da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 28861da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 28871da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 28881da177e4SLinus Torvalds priv->last_dtr_rts; 2889a4afff6bSJohan Hovold 289066e47e60SJohan Hovold return ret; 28911da177e4SLinus Torvalds } 28921da177e4SLinus Torvalds 289320b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 289495da310eSAlan Cox unsigned int set, unsigned int clear) 28951da177e4SLinus Torvalds { 289695da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2897a09aa7ddSGreg Kroah-Hartman 289874ede0ffSIan Abbott return update_mctrl(port, set, clear); 28991da177e4SLinus Torvalds } 29001da177e4SLinus Torvalds 290100a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 2902464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 29031da177e4SLinus Torvalds { 290495da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 290559556608SJohan Hovold void __user *argp = (void __user *)arg; 29061da177e4SLinus Torvalds 29071da177e4SLinus Torvalds switch (cmd) { 2908c466cd2bSGreg Kroah-Hartman case TIOCSERGETLSR: 290959556608SJohan Hovold return get_lsr_info(port, argp); 29101da177e4SLinus Torvalds default: 29111da177e4SLinus Torvalds break; 29121da177e4SLinus Torvalds } 29134d5147ecSJohan Hovold 291495da310eSAlan Cox return -ENOIOCTLCMD; 291595da310eSAlan Cox } 29161da177e4SLinus Torvalds 2917e17c1aa2SJohan Hovold module_usb_serial_driver(serial_drivers, id_table_combined); 29181da177e4SLinus Torvalds 29191da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 29201da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 29211da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 29221da177e4SLinus Torvalds 2923b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2924b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2925