11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * USB FTDI SIO driver 31da177e4SLinus Torvalds * 4659597b7SJohan Hovold * Copyright (C) 2009 - 2013 5d3901a06SJohan Hovold * Johan Hovold (jhovold@gmail.com) 61da177e4SLinus Torvalds * Copyright (C) 1999 - 2001 71da177e4SLinus Torvalds * Greg Kroah-Hartman (greg@kroah.com) 81da177e4SLinus Torvalds * Bill Ryder (bryder@sgi.com) 91da177e4SLinus Torvalds * Copyright (C) 2002 101da177e4SLinus Torvalds * Kuba Ober (kuba@mareimbrium.org) 111da177e4SLinus Torvalds * 121da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 131da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 141da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 151da177e4SLinus Torvalds * (at your option) any later version. 161da177e4SLinus Torvalds * 17464cbb24SAlan Cox * See Documentation/usb/usb-serial.txt for more information on using this 18464cbb24SAlan Cox * driver 191da177e4SLinus Torvalds * 201da177e4SLinus Torvalds * See http://ftdi-usb-sio.sourceforge.net for up to date testing info 211da177e4SLinus Torvalds * and extra documentation 221da177e4SLinus Torvalds * 23504b55ccSGreg Kroah-Hartman * Change entries from 2004 and earlier can be found in versions of this 24504b55ccSGreg Kroah-Hartman * file in kernel versions prior to the 2.6.24 release. 251da177e4SLinus Torvalds * 261da177e4SLinus Torvalds */ 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds /* Bill Ryder - bryder@sgi.com - wrote the FTDI_SIO implementation */ 291da177e4SLinus Torvalds /* Thanx to FTDI for so kindly providing details of the protocol required */ 301da177e4SLinus Torvalds /* to talk to the device */ 31464cbb24SAlan Cox /* Thanx to gkh and the rest of the usb dev group for all code I have 32464cbb24SAlan Cox assimilated :-) */ 331da177e4SLinus Torvalds 341da177e4SLinus Torvalds #include <linux/kernel.h> 351da177e4SLinus Torvalds #include <linux/errno.h> 361da177e4SLinus Torvalds #include <linux/slab.h> 371da177e4SLinus Torvalds #include <linux/tty.h> 381da177e4SLinus Torvalds #include <linux/tty_driver.h> 391da177e4SLinus Torvalds #include <linux/tty_flip.h> 401da177e4SLinus Torvalds #include <linux/module.h> 411da177e4SLinus Torvalds #include <linux/spinlock.h> 42bd09a9f5SAlessio Igor Bogani #include <linux/mutex.h> 43464cbb24SAlan Cox #include <linux/uaccess.h> 441da177e4SLinus Torvalds #include <linux/usb.h> 451da177e4SLinus Torvalds #include <linux/serial.h> 46a969888cSGreg Kroah-Hartman #include <linux/usb/serial.h> 471da177e4SLinus Torvalds #include "ftdi_sio.h" 4831844d55SAndreas Mohr #include "ftdi_sio_ids.h" 491da177e4SLinus Torvalds 50d3901a06SJohan 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>" 511da177e4SLinus Torvalds #define DRIVER_DESC "USB FTDI Serial Converters Driver" 521da177e4SLinus Torvalds 531da177e4SLinus Torvalds 540ffbbe25SOliver Neukum struct ftdi_private { 553bb36aa2SGreg Kroah-Hartman enum ftdi_chip_type chip_type; 56464cbb24SAlan Cox /* type of device, either SIO or FT8U232AM */ 570ffbbe25SOliver Neukum int baud_base; /* baud base clock for divisor setting */ 58464cbb24SAlan Cox int custom_divisor; /* custom_divisor kludge, this is for 59464cbb24SAlan Cox baud_base (different from what goes to the 60464cbb24SAlan Cox chip!) */ 610ffbbe25SOliver Neukum __u16 last_set_data_urb_value ; 62464cbb24SAlan Cox /* the last data state set - needed for doing 63464cbb24SAlan Cox * a break 64464cbb24SAlan Cox */ 650ffbbe25SOliver Neukum int flags; /* some ASYNC_xxxx flags are supported */ 660ffbbe25SOliver Neukum unsigned long last_dtr_rts; /* saved modem control outputs */ 67fca5430dSSimon Arlott char prev_status; /* Used for TIOCMIWAIT */ 68c466cd2bSGreg Kroah-Hartman char transmit_empty; /* If transmitter is empty or not */ 69094c2e6dSMark Adamson __u16 interface; /* FT2232C, FT2232H or FT4232H port interface 70094c2e6dSMark Adamson (0 for FT232/245) */ 710ffbbe25SOliver Neukum 72464cbb24SAlan Cox speed_t force_baud; /* if non-zero, force the baud rate to 73464cbb24SAlan Cox this value */ 74464cbb24SAlan Cox int force_rtscts; /* if non-zero, force RTS-CTS to always 75464cbb24SAlan Cox be enabled */ 760ffbbe25SOliver Neukum 77557aaa7fSAlan Cox unsigned int latency; /* latency setting in use */ 78895f28baSMark Adamson unsigned short max_packet_size; 799c67d28eSAlessio Igor Bogani struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ 800ffbbe25SOliver Neukum }; 810ffbbe25SOliver Neukum 828f977e42SIan Abbott /* struct ftdi_sio_quirk is used by devices requiring special attention. */ 838f977e42SIan Abbott struct ftdi_sio_quirk { 84fa91d43bSTony Lindgren int (*probe)(struct usb_serial *); 85464cbb24SAlan Cox /* Special settings for probed ports. */ 86464cbb24SAlan Cox void (*port_probe)(struct ftdi_private *); 878f977e42SIan Abbott }; 888f977e42SIan Abbott 8920734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial); 90b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial); 916ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial); 92c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial); 930ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 940ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 958f977e42SIan Abbott 963c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_jtag_quirk = { 9720734345SHarald Welte .probe = ftdi_jtag_probe, 98fa91d43bSTony Lindgren }; 99fa91d43bSTony Lindgren 1003c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_NDI_device_quirk = { 101b760dac2SMartin Geleynse .probe = ftdi_NDI_device_setup, 102b760dac2SMartin Geleynse }; 103b760dac2SMartin Geleynse 1043c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 1050ffbbe25SOliver Neukum .port_probe = ftdi_USB_UIRT_setup, 1068f977e42SIan Abbott }; 1078f977e42SIan Abbott 1083c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { 1090ffbbe25SOliver Neukum .port_probe = ftdi_HE_TIRA1_setup, 1101da177e4SLinus Torvalds }; 1111da177e4SLinus Torvalds 1123c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_stmclite_quirk = { 1136ec2f46cSJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_stmclite_probe, 1146ec2f46cSJean-Christophe PLAGNIOL-VILLARD }; 1156ec2f46cSJean-Christophe PLAGNIOL-VILLARD 1163c77f7c9SJulia Lawall static const struct ftdi_sio_quirk ftdi_8u2232c_quirk = { 117c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_8u2232c_probe, 118c96fbdd0SJean-Christophe PLAGNIOL-VILLARD }; 119c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1201da177e4SLinus Torvalds /* 1211da177e4SLinus Torvalds * The 8U232AM has the same API as the sio except for: 1221da177e4SLinus Torvalds * - it can support MUCH higher baudrates; up to: 1231da177e4SLinus Torvalds * o 921600 for RS232 and 2000000 for RS422/485 at 48MHz 1241da177e4SLinus Torvalds * o 230400 at 12MHz 1251da177e4SLinus Torvalds * so .. 8U232AM's baudrate setting codes are different 1261da177e4SLinus Torvalds * - it has a two byte status code. 1271da177e4SLinus Torvalds * - it returns characters every 16ms (the FTDI does it every 40ms) 1281da177e4SLinus Torvalds * 1291da177e4SLinus Torvalds * the bcdDevice value is used to differentiate FT232BM and FT245BM from 1301da177e4SLinus Torvalds * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 1311da177e4SLinus Torvalds * combinations in both tables. 1328f977e42SIan Abbott * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices, 1338f977e42SIan Abbott * but I don't know if those ever went into mass production. [Ian Abbott] 1341da177e4SLinus Torvalds */ 1351da177e4SLinus Torvalds 1361da177e4SLinus Torvalds 1371da177e4SLinus Torvalds 13865e1ec67SAndreas Mohr /* 139e17c1aa2SJohan Hovold * Device ID not listed? Test it using 140e17c1aa2SJohan Hovold * /sys/bus/usb-serial/drivers/ftdi_sio/new_id and send a patch or report. 14165e1ec67SAndreas Mohr */ 1425c6b98ddSJohan Hovold static const struct usb_device_id id_table_combined[] = { 1437f2719f0SPerry Hung { USB_DEVICE(FTDI_VID, FTDI_BRICK_PID) }, 144ce7e9065SArtur Zimmer { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, 1455a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) }, 1465a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) }, 1472011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 1482011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 14901ba0856SAndrew Ewert { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 1506552cc7fSJohan Hovold { USB_DEVICE(FTDI_VID, FTDI_BM_ATOM_NANO_PID) }, 15165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 15267847baeSBjørn Mork { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, 1536e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, 1546e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, 1556e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, 1566e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) }, 1576e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) }, 1586e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, 1596e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, 1606e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, 161b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, 162b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, 163b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, 16472a9f958SRazvan Gavril { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 1651da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 16669737dfaSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 167d099321bSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, 168fad14a0dSFrank Sievertsen { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, 1691da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 1701da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 1711da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 172d8b21606SGard Spreemann { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, 173c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) , 174c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, 175094c2e6dSMark Adamson { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 176309427b6SUwe Bonnes { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, 177dc0827c1SJim Paris { USB_DEVICE(FTDI_VID, FTDI_FTX_PID) }, 178c0f8d561SChristophe Mariac { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 1791da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 1802adb80e9SGuido Scholz { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, 181ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) }, 182ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 183ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 18499c1e4f8SRainer Keller { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, 18558f8b6c4SStefani Seibold { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) }, 186d7e14b37SMartin Teichmann { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, 18771381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_CC_PID) }, 18871381439SGomella, Andrew (NIH/NHLBI) [F] { USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) }, 1891da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 1901da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 191f2ee6955SAlan Cox { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 19276f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, 19376f24e3fSUlrich Hahn { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, 194ea233f80SGalen Seitz { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, 1951da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 1961da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, 1971da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, 1981da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_633_PID) }, 1991da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_631_PID) }, 2001da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_635_PID) }, 2011da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_640_PID) }, 2021da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_642_PID) }, 2031da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) }, 20474bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_0_PID) }, 20574bdf22bSHakan Kvist { USB_DEVICE(FTDI_VID, FTDI_URBAN_1_PID) }, 2061da177e4SLinus Torvalds { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) }, 2071da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) }, 2088f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_0_PID) }, 2098f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_1_PID) }, 2108f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_2_PID) }, 2118f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_3_PID) }, 2128f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 2138f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 2148f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 215b34efeeaSFolkert van Heusden { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, 2166fdbad80SJacques Viviers { USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) }, 217ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 218ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 219ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 220ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0103_PID) }, 221ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0104_PID) }, 222ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0105_PID) }, 223ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0106_PID) }, 224ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0107_PID) }, 225ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0108_PID) }, 226ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0109_PID) }, 227ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010A_PID) }, 228ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010B_PID) }, 229ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010C_PID) }, 230ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010D_PID) }, 231ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010E_PID) }, 232ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010F_PID) }, 233ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0110_PID) }, 234ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0111_PID) }, 235ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0112_PID) }, 236ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0113_PID) }, 237ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0114_PID) }, 238ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0115_PID) }, 239ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0116_PID) }, 240ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0117_PID) }, 241ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0118_PID) }, 242ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0119_PID) }, 243ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011A_PID) }, 244ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011B_PID) }, 245ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011C_PID) }, 246ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011D_PID) }, 247ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011E_PID) }, 248ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011F_PID) }, 249ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0120_PID) }, 250ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0121_PID) }, 251ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0122_PID) }, 252ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0123_PID) }, 253ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0124_PID) }, 254ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0125_PID) }, 255ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0126_PID) }, 25619de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID) }, 257ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 258ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 259ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 260ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 26119de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID) }, 262ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 263ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 264ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, 265ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0130_PID) }, 266ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0131_PID) }, 267ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0132_PID) }, 268ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0133_PID) }, 269ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0134_PID) }, 270ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0135_PID) }, 271ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0136_PID) }, 272ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0137_PID) }, 273ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0138_PID) }, 274ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0139_PID) }, 275ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013A_PID) }, 276ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013B_PID) }, 277ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013C_PID) }, 278ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013D_PID) }, 279ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013E_PID) }, 280ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013F_PID) }, 281ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0140_PID) }, 282ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0141_PID) }, 283ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0142_PID) }, 284ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0143_PID) }, 285ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0144_PID) }, 286ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0145_PID) }, 287ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0146_PID) }, 288ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0147_PID) }, 289ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0148_PID) }, 290ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0149_PID) }, 291ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014A_PID) }, 292ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014B_PID) }, 293ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014C_PID) }, 294ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014D_PID) }, 295ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014E_PID) }, 296ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014F_PID) }, 297ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 298ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 299ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 30019de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID) }, 30119de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID) }, 30219de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID) }, 30319de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID) }, 30419de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID) }, 30519de4278SJohan Hovold { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID) }, 306ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 307ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 308ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, 309ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015C_PID) }, 310ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015D_PID) }, 311ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015E_PID) }, 312ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015F_PID) }, 313ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0160_PID) }, 314ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0161_PID) }, 315ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0162_PID) }, 316ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0163_PID) }, 317ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0164_PID) }, 318ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0165_PID) }, 319ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0166_PID) }, 320ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0167_PID) }, 321ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0168_PID) }, 322ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0169_PID) }, 323ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016A_PID) }, 324ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016B_PID) }, 325ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016C_PID) }, 326ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016D_PID) }, 327ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016E_PID) }, 328ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016F_PID) }, 329ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0170_PID) }, 330ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0171_PID) }, 331ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0172_PID) }, 332ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0173_PID) }, 333ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0174_PID) }, 334ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0175_PID) }, 335ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0176_PID) }, 336ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0177_PID) }, 337ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0178_PID) }, 338ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0179_PID) }, 339ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017A_PID) }, 340ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017B_PID) }, 341ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017C_PID) }, 342ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017D_PID) }, 343ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017E_PID) }, 344ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017F_PID) }, 345ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0180_PID) }, 346ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0181_PID) }, 347ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0182_PID) }, 348ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0183_PID) }, 349ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0184_PID) }, 350ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0185_PID) }, 351ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0186_PID) }, 352ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0187_PID) }, 353ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0188_PID) }, 354ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0189_PID) }, 355ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018A_PID) }, 356ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018B_PID) }, 357ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018C_PID) }, 358ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018D_PID) }, 359ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018E_PID) }, 360ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018F_PID) }, 361ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0190_PID) }, 362ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0191_PID) }, 363ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0192_PID) }, 364ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0193_PID) }, 365ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0194_PID) }, 366ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0195_PID) }, 367ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0196_PID) }, 368ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0197_PID) }, 369ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0198_PID) }, 370ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0199_PID) }, 371ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019A_PID) }, 372ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019B_PID) }, 373ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019C_PID) }, 374ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019D_PID) }, 375ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019E_PID) }, 376ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019F_PID) }, 377ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A0_PID) }, 378ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A1_PID) }, 379ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A2_PID) }, 380ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A3_PID) }, 381ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A4_PID) }, 382ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A5_PID) }, 383ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A6_PID) }, 384ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A7_PID) }, 385ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A8_PID) }, 386ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A9_PID) }, 387ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AA_PID) }, 388ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AB_PID) }, 389ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AC_PID) }, 390ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AD_PID) }, 391ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AE_PID) }, 392ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AF_PID) }, 393ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B0_PID) }, 394ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B1_PID) }, 395ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B2_PID) }, 396ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B3_PID) }, 397ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B4_PID) }, 398ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B5_PID) }, 399ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B6_PID) }, 400ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B7_PID) }, 401ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B8_PID) }, 402ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B9_PID) }, 403ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BA_PID) }, 404ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BB_PID) }, 405ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BC_PID) }, 406ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BD_PID) }, 407ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BE_PID) }, 408ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BF_PID) }, 409ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C0_PID) }, 410ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C1_PID) }, 411ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C2_PID) }, 412ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C3_PID) }, 413ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C4_PID) }, 414ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C5_PID) }, 415ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C6_PID) }, 416ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C7_PID) }, 417ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C8_PID) }, 418ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C9_PID) }, 419ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CA_PID) }, 420ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CB_PID) }, 421ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CC_PID) }, 422ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CD_PID) }, 423ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CE_PID) }, 424ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CF_PID) }, 425ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D0_PID) }, 426ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D1_PID) }, 427ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D2_PID) }, 428ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D3_PID) }, 429ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D4_PID) }, 430ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D5_PID) }, 431ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D6_PID) }, 432ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D7_PID) }, 433ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D8_PID) }, 434ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D9_PID) }, 435ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DA_PID) }, 436ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DB_PID) }, 437ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DC_PID) }, 438ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DD_PID) }, 439ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DE_PID) }, 440ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DF_PID) }, 441ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E0_PID) }, 442ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E1_PID) }, 443ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E2_PID) }, 444ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E3_PID) }, 445ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E4_PID) }, 446ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E5_PID) }, 447ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E6_PID) }, 448ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E7_PID) }, 449ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E8_PID) }, 450ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E9_PID) }, 451ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EA_PID) }, 452ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EB_PID) }, 453ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EC_PID) }, 454ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01ED_PID) }, 455ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EE_PID) }, 456ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EF_PID) }, 457ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F0_PID) }, 458ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F1_PID) }, 459ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F2_PID) }, 460ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F3_PID) }, 461ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F4_PID) }, 462ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F5_PID) }, 463ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F6_PID) }, 464ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F7_PID) }, 465ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F8_PID) }, 466ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F9_PID) }, 467ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FA_PID) }, 468ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FB_PID) }, 469ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FC_PID) }, 470ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 471ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 472ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 473204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) }, 474204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) }, 475204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) }, 476204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) }, 477204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) }, 478204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) }, 479204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) }, 480204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) }, 481204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) }, 482204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) }, 483204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) }, 484204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) }, 485204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) }, 486204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) }, 487204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) }, 488204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) }, 489204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) }, 490204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) }, 491204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) }, 492204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) }, 493204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) }, 494204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) }, 495204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) }, 496204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) }, 497204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) }, 498204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) }, 499204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) }, 500204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) }, 501204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) }, 502204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) }, 503204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) }, 504204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) }, 505204ec6e0STroy Clark { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) }, 5068f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 5071da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 508274a4bbcSDave Platt { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 509868e440dSJelle Foks { USB_DEVICE(FTDI_VID, FTDI_USBX_707_PID) }, 5101da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 5111da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 5121da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 5131da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, 514a1484827SJustin Carlson { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, 5151da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, 5161da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, 5171da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, 5181da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_2_PID) }, 5191da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_1_PID) }, 5201da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_2_PID) }, 5211da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_1_PID) }, 5221da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_2_PID) }, 5231da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_3_PID) }, 5241da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_4_PID) }, 5251da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_1_PID) }, 5261da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_2_PID) }, 5271da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_3_PID) }, 5281da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_4_PID) }, 5291da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_1_PID) }, 5301da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_2_PID) }, 5311da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_3_PID) }, 5321da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_4_PID) }, 5331da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_1_PID) }, 5341da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_2_PID) }, 5351da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_3_PID) }, 5361da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_4_PID) }, 5371da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_5_PID) }, 5381da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_6_PID) }, 5391da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_7_PID) }, 5401da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_8_PID) }, 5411da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_1_PID) }, 5421da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_2_PID) }, 5431da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_3_PID) }, 5441da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_4_PID) }, 5451da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_5_PID) }, 5461da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_6_PID) }, 5471da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_7_PID) }, 5481da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_8_PID) }, 5491da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_1_PID) }, 5501da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_2_PID) }, 5511da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_3_PID) }, 5521da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_4_PID) }, 5531da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_5_PID) }, 5541da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) }, 5551da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) }, 5561da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 5576d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_1_PID) }, 5586d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_2_PID) }, 5596d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_3_PID) }, 5606d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_4_PID) }, 5611da177e4SLinus Torvalds { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 5621da177e4SLinus Torvalds { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 56311a31d84SJohan Hovold { USB_DEVICE(OCT_VID, OCT_DK201_PID) }, 5648f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID), 5658f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk }, 5668f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID), 5678f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk }, 5681da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 5691da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 5701da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 5711da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 5728f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) }, 5738f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) }, 5748f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) }, 5758f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) }, 5768f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) }, 5778f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) }, 5788f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) }, 5798f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) }, 5808f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) }, 5818f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) }, 5828f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) }, 5838f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) }, 5848f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) }, 5858f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) }, 5868f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) }, 5878f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) }, 5881da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 58947900743SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 590e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UR100_PID) }, 591e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 592207c47e1SThomas Riewe { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 593bde62185SMartin Hagelin { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 5944eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, 5954eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, 5964eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, 5974eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, 5984eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, 5994eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, 6004eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, 6014eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, 60237909fe5SBenedek László { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) }, 60354575b05SAntonio Ospite { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID), 60454575b05SAntonio Ospite .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 605d0839d75SGeorge McCollister { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID), 606d0839d75SGeorge McCollister .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 6074899c054SDoug Goldstein { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, 6081fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) }, 6091fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) }, 6101fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) }, 6111fb8dc36SMatthijs Kooijman { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) }, 612e6ac4a40SIan Abbott /* 61365e1ec67SAndreas Mohr * ELV devices: 614e6ac4a40SIan Abbott */ 615c249f911SSven Killig { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, 61665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 61765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 61865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, 61965e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) }, 62065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) }, 62165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) }, 62265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) }, 62365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) }, 62442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) }, 62542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) }, 62642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) }, 62742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDF77_PID) }, 62842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UIO88_PID) }, 62942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UAD8_PID) }, 63042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDA7_PID) }, 63142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_USI2_PID) }, 63242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_T1100_PID) }, 63342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCD200_PID) }, 63442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_ULA200_PID) }, 63542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CSI8_PID) }, 63642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1000DL_PID) }, 63742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) }, 63842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) }, 63942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, 64065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) }, 64142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, 64265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) }, 64342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, 6444ae897dfSSven Andersen { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, 64542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, 646b5894a50SAndré Schenk { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) }, 64765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) }, 64865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) }, 64965e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) }, 65065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) }, 6516977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_PALMSENS_PID) }, 6526977495cSRobert Deliën { USB_DEVICE(FTDI_VID, FTDI_IVIUM_XSTAT_PID) }, 6538f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, 6548f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, 6558f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) }, 6568f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) }, 6578f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) }, 6581da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 6591da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 660ec434e9bSJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 6619d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) }, 6629d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) }, 6639d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) }, 6641da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 6651da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 6661da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 6671da177e4SLinus Torvalds { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 668e6ac4a40SIan Abbott { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 6691da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 670c3d36c45SVladimir Vukicevic { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, 671ef31fec0SMichael Olberg { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, 6726f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 67328fe2eb0SMichael Williamson { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, 67446b72d78SDaniel Sangorrin { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, 675482b0b5dSKonstantin Holoborodko { USB_DEVICE(MITSUBISHI_VID, MITSUBISHI_FXUSB_PID) }, 6761da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 6771da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 6781da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, 679a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) }, 680a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) }, 681a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) }, 682a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) }, 683a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) }, 684a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) }, 685a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) }, 686a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) }, 687a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) }, 688a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) }, 689a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) }, 690a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) }, 691a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) }, 692a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) }, 6931da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 6946f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 6956f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 696a26d31ceSSteffen Sledz { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) }, 697e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 698e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 699e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 700e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_3_PID) }, 701e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_4_PID) }, 702e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 703e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 704e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 705edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_DONGLE_PID) }, 706edd74ffaSFrans Klaver { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, 7074bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, 7081df5b888SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, 7094bdcde35SPatrick Riphagen { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, 7100ba3b2ccSPetr Kubánek { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 7116f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 7128f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 71334d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 71434d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 7159b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 7169b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 71734d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 71834d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 71934d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 72034d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 721740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 722740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 7239b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 724c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 725c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 726c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 727c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 72809c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 729c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 73009c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 73134910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 732b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 733b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 734effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 735641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 7367e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 737a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 738a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 739ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 740cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 7417e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 74226a538b9SHorst Schirmeier { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 743a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 744a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 745a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 746a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 747a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 748a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 749a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 750a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 751a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 752a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 753a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 75420a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 755eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 75648437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 7575a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_1_PID) }, 7585a7fbe7eSBert Vermeulen { USB_DEVICE(TESTO_VID, TESTO_3_PID) }, 759eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 7609978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 7619978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 7629978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 76340c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 764b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 765b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 766b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 767b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 768b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 769b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 770b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 771b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 772b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 773b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 774822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 775ee444609SJohan Hovold { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) }, 776fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, 777fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, 778fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, 779fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, 780fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, 781fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, 782fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, 783fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, 784fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, 785fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, 786fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, 787fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, 788fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, 789fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, 790fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, 791fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, 792fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, 793fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, 794fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, 795fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, 796fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, 797fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, 798fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, 799fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, 800fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, 801fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, 802fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, 803fed1f1edSRick Farina (Zero_Chaos) { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, 804762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 805a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 806d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 8074bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 80811171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 809307369b0SMarcin Kościelnicki { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 810c7d373c3SMax Mansfield { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), 811c7d373c3SMax Mansfield .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 812fa91d43bSTony Lindgren { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 81320734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 814b88ccf6fSJF Argentino { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), 815b88ccf6fSJF Argentino .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 81620734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 81720734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 81820734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 81920734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 820a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 821a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 822a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 823a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8243687f641SPeter Stuge { USB_DEVICE(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID), 8253687f641SPeter Stuge .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82614511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 82714511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 82826ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 829e03cdf22SGreg Kroah-Hartman { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, 8302542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 83159c6ccd9SDaniel Suchy 83259c6ccd9SDaniel Suchy /* Papouch devices based on FTDI chip */ 83359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) }, 83459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) }, 83559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) }, 83659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) }, 83759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) }, 83859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) }, 83959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) }, 84059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) }, 84159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) }, 84259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) }, 84359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 84459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) }, 84559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) }, 84659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) }, 847a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 84859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) }, 84959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) }, 85059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) }, 85159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) }, 85259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) }, 85359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) }, 85459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) }, 85559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) }, 85659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) }, 85759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) }, 858a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 85959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) }, 86059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) }, 86159c6ccd9SDaniel Suchy 86296285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 86396285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 86445eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 865ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 8667f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 8677f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 8687f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 869b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 870b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 87111eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 87211eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 873f08dea73SBjørn Mork { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 874f08dea73SBjørn Mork USB_CLASS_VENDOR_SPEC, 875f08dea73SBjørn Mork USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 876ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 8771002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 8781002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 879d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 880fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 881dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 882dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 883dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C866_PID) }, 884dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C663_PID) }, 885dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C725_PID) }, 886dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E517_PID) }, 887dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C863_PID) }, 888b69cc672SÉric Piel { USB_DEVICE(PI_VID, PI_E861_PID) }, 889dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C867_PID) }, 890dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E609_PID) }, 891dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E709_PID) }, 892dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_100F_PID) }, 893dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1011_PID) }, 894dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1012_PID) }, 895dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1013_PID) }, 896dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1014_PID) }, 897dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1015_PID) }, 898dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1016_PID) }, 8997724a1edSOzan Çağlayan { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 900c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 90150d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 90250d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 90355f13aeaSPeter Korsgaard { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID), 90455f13aeaSPeter Korsgaard .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 905e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 906c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, 907c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, 908e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 9099714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 9109714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 9119714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 9129714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 91377dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 91477dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91577dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 91677dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91777dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 91877dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 91977dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 92077dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 921afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 9223126d823SRich Mattes { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) }, 923666cc076SMartin Michlmayr { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), 924666cc076SMartin Michlmayr .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 92565737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, 92665737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, 92765737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, 92865737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, 92965737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, 93065737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, 93165737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, 93265737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, 9330f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, 9340f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, 9350f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, 93690451e69SMilan Kocian { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, 9375363cdc3SFlorian Faber { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, 9387fea0f71SSebastien Bourdeauducq { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), 9397fea0f71SSebastien Bourdeauducq .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9409f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_2232_PID), 9419f06d15fSAdrian Thomasset .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 9429f06d15fSAdrian Thomasset { USB_DEVICE(ST_VID, ST_STMCLT_4232_PID), 9436ec2f46cSJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, 944fc216ec3SPeter Naulls { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, 94547594d55SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 94647594d55SMichał Wróbel .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 94757e596f3SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 9488cf65dc3STomasz Mloduchowski /* Crucible Devices */ 9498cf65dc3STomasz Mloduchowski { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 950e1466ad5SАлексей Крамаренко { USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, 9516dbd46c8SJoerg Dorchain /* Cressi Devices */ 9526dbd46c8SJoerg Dorchain { USB_DEVICE(FTDI_VID, FTDI_CRESSI_PID) }, 953efe26e16SMichele Baldessari /* Brainboxes Devices */ 954efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_001_PID) }, 955efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_012_PID) }, 956efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) }, 957efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) }, 958efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) }, 959efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) }, 960efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) }, 961efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) }, 962efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_4_PID) }, 963efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_5_PID) }, 964efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) }, 965efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) }, 966efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) }, 967efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) }, 968efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) }, 969efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) }, 970efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) }, 971efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) }, 972efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) }, 973efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) }, 974efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) }, 975efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) }, 976efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_357_PID) }, 977efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_1_PID) }, 978efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_2_PID) }, 979efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_606_3_PID) }, 980efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_1_PID) }, 981efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_701_2_PID) }, 982efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_1_PID) }, 983efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, 984efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, 985efe26e16SMichele Baldessari { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, 986646907f5SJaša Bartelj /* ekey Devices */ 987646907f5SJaša Bartelj { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) }, 988d8279a40SMichal Sojka /* Infineon Devices */ 989ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) }, 990ca006f78SStefan Tauner { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) }, 9919c491c37STaylor Braun-Jones /* GE Healthcare devices */ 9929c491c37STaylor Braun-Jones { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) }, 993f6950344SMark Glover /* Active Research (Actisense) devices */ 994f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NDC_PID) }, 995f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) }, 996f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) }, 997f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) }, 998f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) }, 999f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) }, 1000f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) }, 1001f6950344SMark Glover { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) }, 1002f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) }, 1003f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) }, 1004f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_NMEA2000_PID) }, 1005f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ETHERNET_PID) }, 1006f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_WIFI_PID) }, 1007f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 1008f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 1009f6950344SMark Glover { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 1010ea6db90eSJosh Boyer /* ICP DAS I-756xU devices */ 1011ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, 1012ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, 1013ea6db90eSJosh Boyer { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, 1014ae34d12cSSheng-Hui J. Chu { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, 10159bfef729SDoug Brown { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), 10169bfef729SDoug Brown .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 10171da177e4SLinus Torvalds { } /* Terminating entry */ 10181da177e4SLinus Torvalds }; 10191da177e4SLinus Torvalds 10201da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 10211da177e4SLinus Torvalds 10224c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 10231da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 10241da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 10251da177e4SLinus Torvalds [FT232BM] = "FT232BM", 10261da177e4SLinus Torvalds [FT2232C] = "FT2232C", 1027d8b21606SGard Spreemann [FT232RL] = "FT232RL", 1028094c2e6dSMark Adamson [FT2232H] = "FT2232H", 1029309427b6SUwe Bonnes [FT4232H] = "FT4232H", 1030dc0827c1SJim Paris [FT232H] = "FT232H", 1031dc0827c1SJim Paris [FTX] = "FT-X" 10321da177e4SLinus Torvalds }; 10331da177e4SLinus Torvalds 10341da177e4SLinus Torvalds 10351da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 10361da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 10371da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 10381da177e4SLinus Torvalds /* End TIOCMIWAIT */ 10391da177e4SLinus Torvalds 10401da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 1041464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1042464cbb24SAlan Cox const struct usb_device_id *id); 104312bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 104412bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 1045a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 1046335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 10471b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 1048d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1049c23e5fc1SJohan Hovold void *dest, size_t size); 1050464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 1051464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 105260b33c13SAlan Cox static int ftdi_tiocmget(struct tty_struct *tty); 105320b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 1054464cbb24SAlan Cox unsigned int set, unsigned int clear); 105500a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 1056464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 105795da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 1058a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port); 1059c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 10605fb0432eSJohan Hovold unsigned char status[2]); 10611da177e4SLinus Torvalds 10621da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 10631da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 10641da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 10651da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud); 1066094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 1067094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud); 10681da177e4SLinus Torvalds 1069ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 107018fcac35SGreg Kroah-Hartman .driver = { 10711da177e4SLinus Torvalds .owner = THIS_MODULE, 1072269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 107318fcac35SGreg Kroah-Hartman }, 1074269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 10758f977e42SIan Abbott .id_table = id_table_combined, 10761da177e4SLinus Torvalds .num_ports = 1, 1077bbcb2b90SJohan Hovold .bulk_in_size = 512, 1078c23e5fc1SJohan Hovold .bulk_out_size = 256, 10798f977e42SIan Abbott .probe = ftdi_sio_probe, 108012bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 108112bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 10821da177e4SLinus Torvalds .open = ftdi_open, 1083335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 10841b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 10851b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 10861b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 1087d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 10881da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 10891da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 1090f307e5cdSJohan Hovold .tiocmiwait = usb_serial_generic_tiocmiwait, 10916f86fec9SJohan Hovold .get_icount = usb_serial_generic_get_icount, 10921da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 10931da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 10941da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 1095a37025b5SJohan Hovold .tx_empty = ftdi_tx_empty, 10961da177e4SLinus Torvalds }; 10971da177e4SLinus Torvalds 109897b6b6d2SAlan Stern static struct usb_serial_driver * const serial_drivers[] = { 109997b6b6d2SAlan Stern &ftdi_sio_device, NULL 110097b6b6d2SAlan Stern }; 110197b6b6d2SAlan Stern 11021da177e4SLinus Torvalds 11031da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 1104279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 11051da177e4SLinus Torvalds 11061da177e4SLinus Torvalds /* 11071da177e4SLinus Torvalds * *************************************************************************** 1108fa91d43bSTony Lindgren * Utility functions 11091da177e4SLinus Torvalds * *************************************************************************** 11101da177e4SLinus Torvalds */ 11111da177e4SLinus Torvalds 11121da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 11131da177e4SLinus Torvalds { 11141da177e4SLinus Torvalds unsigned short int divisor; 1115464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 1116464cbb24SAlan Cox int divisor3 = base / 2 / baud; 1117464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 1118464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 11191da177e4SLinus Torvalds divisor = divisor3 >> 3; 11201da177e4SLinus Torvalds divisor3 &= 0x7; 1121464cbb24SAlan Cox if (divisor3 == 1) 1122464cbb24SAlan Cox divisor |= 0xc000; 1123464cbb24SAlan Cox else if (divisor3 >= 4) 1124464cbb24SAlan Cox divisor |= 0x4000; 1125464cbb24SAlan Cox else if (divisor3 != 0) 1126464cbb24SAlan Cox divisor |= 0x8000; 1127464cbb24SAlan Cox else if (divisor == 1) 1128464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 11291da177e4SLinus Torvalds return divisor; 11301da177e4SLinus Torvalds } 11311da177e4SLinus Torvalds 11321da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 11331da177e4SLinus Torvalds { 1134464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 11351da177e4SLinus Torvalds } 11361da177e4SLinus Torvalds 11371da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 11381da177e4SLinus Torvalds { 11391da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 11401da177e4SLinus Torvalds __u32 divisor; 1141464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 1142464cbb24SAlan Cox int divisor3 = base / 2 / baud; 11431da177e4SLinus Torvalds divisor = divisor3 >> 3; 11441da177e4SLinus Torvalds divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 11451da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 1146464cbb24SAlan Cox if (divisor == 1) 1147464cbb24SAlan Cox divisor = 0; 1148464cbb24SAlan Cox else if (divisor == 0x4001) 1149464cbb24SAlan Cox divisor = 1; 11501da177e4SLinus Torvalds return divisor; 11511da177e4SLinus Torvalds } 11521da177e4SLinus Torvalds 11531da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud) 11541da177e4SLinus Torvalds { 1155464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 11561da177e4SLinus Torvalds } 11571da177e4SLinus Torvalds 1158094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 1159094c2e6dSMark Adamson { 1160094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1161094c2e6dSMark Adamson __u32 divisor; 1162094c2e6dSMark Adamson int divisor3; 1163094c2e6dSMark Adamson 1164094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 1165f6c259a3SDaniel Glöckner divisor3 = base * 8 / (baud * 10); 1166094c2e6dSMark Adamson 1167094c2e6dSMark Adamson divisor = divisor3 >> 3; 1168094c2e6dSMark Adamson divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 1169094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 1170094c2e6dSMark Adamson if (divisor == 1) 1171094c2e6dSMark Adamson divisor = 0; 1172094c2e6dSMark Adamson else if (divisor == 0x4001) 1173094c2e6dSMark Adamson divisor = 1; 1174094c2e6dSMark Adamson /* 1175094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 1176094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 1177094c2e6dSMark Adamson * baud with this bit set 1178094c2e6dSMark Adamson */ 1179094c2e6dSMark Adamson divisor |= 0x00020000; 1180094c2e6dSMark Adamson return divisor; 1181094c2e6dSMark Adamson } 1182094c2e6dSMark Adamson 1183094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud) 1184094c2e6dSMark Adamson { 1185094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 1186094c2e6dSMark Adamson } 1187094c2e6dSMark Adamson 118874ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 118974ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 119074ede0ffSIan Abbott 1191464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 1192464cbb24SAlan Cox unsigned int clear) 11931da177e4SLinus Torvalds { 11941da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1195bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 119674ede0ffSIan Abbott unsigned urb_value; 11971da177e4SLinus Torvalds int rv; 11981da177e4SLinus Torvalds 119974ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 1200bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); 120174ede0ffSIan Abbott return 0; /* no change */ 12021da177e4SLinus Torvalds } 120374ede0ffSIan Abbott 120474ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 120574ede0ffSIan Abbott urb_value = 0; 120674ede0ffSIan Abbott if (clear & TIOCM_DTR) 120774ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_LOW; 120874ede0ffSIan Abbott if (clear & TIOCM_RTS) 120974ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_LOW; 121074ede0ffSIan Abbott if (set & TIOCM_DTR) 121174ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_HIGH; 121274ede0ffSIan Abbott if (set & TIOCM_RTS) 121374ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_HIGH; 12141da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 12151da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 12161da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 12171da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 121874ede0ffSIan Abbott urb_value, priv->interface, 121966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 122074ede0ffSIan Abbott if (rv < 0) { 1221bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", 1222441b62c1SHarvey Harrison __func__, 1223bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1224bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12252c2ee545SJohan Hovold rv = usb_translate_errors(rv); 12261da177e4SLinus Torvalds } else { 1227bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1228bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1229bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 12309b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 123174ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 12321da177e4SLinus Torvalds } 12331da177e4SLinus Torvalds return rv; 12341da177e4SLinus Torvalds } 12351da177e4SLinus Torvalds 12361da177e4SLinus Torvalds 1237464cbb24SAlan Cox static __u32 get_ftdi_divisor(struct tty_struct *tty, 1238464cbb24SAlan Cox struct usb_serial_port *port) 1239e49bbce1SJohan Hovold { 12401da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1241bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 12421da177e4SLinus Torvalds __u32 div_value = 0; 12431da177e4SLinus Torvalds int div_okay = 1; 12441da177e4SLinus Torvalds int baud; 12451da177e4SLinus Torvalds 12461da177e4SLinus Torvalds /* 1247464cbb24SAlan Cox * The logic involved in setting the baudrate can be cleanly split into 1248464cbb24SAlan Cox * 3 steps. 12491da177e4SLinus Torvalds * 1. Standard baud rates are set in tty->termios->c_cflag 1250464cbb24SAlan Cox * 2. If these are not enough, you can set any speed using alt_speed as 1251464cbb24SAlan Cox * follows: 12521da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 12531da177e4SLinus Torvalds * - set your real speed in tty->alt_speed; it gets ignored when 12541da177e4SLinus Torvalds * alt_speed==0, (or) 1255464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1256464cbb24SAlan Cox * follows: 1257464cbb24SAlan Cox * flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], 1258464cbb24SAlan Cox * this just sets alt_speed to (HI: 57600, VHI: 115200, 1259464cbb24SAlan Cox * SHI: 230400, WARP: 460800) 12601da177e4SLinus Torvalds * ** Steps 1, 2 are done courtesy of tty_get_baud_rate 12611da177e4SLinus Torvalds * 3. You can also set baud rate by setting custom divisor as follows 12621da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 1263464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1264464cbb24SAlan Cox * follows: 12651da177e4SLinus Torvalds * o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST 12661da177e4SLinus Torvalds * o custom_divisor set to baud_base / your_new_baudrate 1267464cbb24SAlan Cox * ** Step 3 is done courtesy of code borrowed from serial.c 1268464cbb24SAlan Cox * I should really spend some time and separate + move this common 1269464cbb24SAlan Cox * code to serial.c, it is replicated in nearly every serial driver 1270464cbb24SAlan Cox * you see. 12711da177e4SLinus Torvalds */ 12721da177e4SLinus Torvalds 1273464cbb24SAlan Cox /* 1. Get the baud rate from the tty settings, this observes 1274464cbb24SAlan Cox alt_speed hack */ 12751da177e4SLinus Torvalds 127695da310eSAlan Cox baud = tty_get_baud_rate(tty); 1277bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); 12781da177e4SLinus Torvalds 1279464cbb24SAlan Cox /* 2. Observe async-compatible custom_divisor hack, update baudrate 1280464cbb24SAlan Cox if needed */ 12811da177e4SLinus Torvalds 12821da177e4SLinus Torvalds if (baud == 38400 && 12831da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 12841da177e4SLinus Torvalds (priv->custom_divisor)) { 12851da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1286bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", 1287464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 12881da177e4SLinus Torvalds } 12891da177e4SLinus Torvalds 12901da177e4SLinus Torvalds /* 3. Convert baudrate to device-specific divisor */ 12911da177e4SLinus Torvalds 1292464cbb24SAlan Cox if (!baud) 1293464cbb24SAlan Cox baud = 9600; 12941da177e4SLinus Torvalds switch (priv->chip_type) { 12951da177e4SLinus Torvalds case SIO: /* SIO chip */ 12961da177e4SLinus Torvalds switch (baud) { 12971da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 12981da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 12991da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 13001da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 13011da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 13021da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 13031da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 13041da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 13051da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 13061da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 13071da177e4SLinus Torvalds } /* baud */ 13081da177e4SLinus Torvalds if (div_value == 0) { 1309bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", 1310464cbb24SAlan Cox __func__, baud); 13111da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1312669a6db1SAlan Cox baud = 9600; 13131da177e4SLinus Torvalds div_okay = 0; 13141da177e4SLinus Torvalds } 13151da177e4SLinus Torvalds break; 13161da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 13171da177e4SLinus Torvalds if (baud <= 3000000) { 13181da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 13191da177e4SLinus Torvalds } else { 1320bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1321669a6db1SAlan Cox baud = 9600; 13221da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 13231da177e4SLinus Torvalds div_okay = 0; 13241da177e4SLinus Torvalds } 13251da177e4SLinus Torvalds break; 13261da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 13271da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 1328dc0827c1SJim Paris case FT232RL: /* FT232RL chip */ 1329dc0827c1SJim Paris case FTX: /* FT-X series */ 13301da177e4SLinus Torvalds if (baud <= 3000000) { 1331b760dac2SMartin Geleynse __u16 product_id = le16_to_cpu( 1332b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1333fb571101SMathieu OTHACEHE if (((product_id == FTDI_NDI_HUC_PID) || 1334fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_SPECTRA_SCU_PID) || 1335fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_2_PID) || 1336fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_FUTURE_3_PID) || 1337fb571101SMathieu OTHACEHE (product_id == FTDI_NDI_AURORA_SCU_PID)) && 1338b760dac2SMartin Geleynse (baud == 19200)) { 1339b760dac2SMartin Geleynse baud = 1200000; 1340b760dac2SMartin Geleynse } 13411da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 13421da177e4SLinus Torvalds } else { 1343bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 13441da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 13451da177e4SLinus Torvalds div_okay = 0; 1346669a6db1SAlan Cox baud = 9600; 13471da177e4SLinus Torvalds } 13481da177e4SLinus Torvalds break; 1349094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1350094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1351309427b6SUwe Bonnes case FT232H: /* FT232H chip */ 13521862cdd5SIonut Nicu if ((baud <= 12000000) && (baud >= 1200)) { 1353094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1354094c2e6dSMark Adamson } else if (baud < 1200) { 1355094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1356094c2e6dSMark Adamson } else { 1357bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1358094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1359094c2e6dSMark Adamson div_okay = 0; 1360094c2e6dSMark Adamson baud = 9600; 1361094c2e6dSMark Adamson } 1362094c2e6dSMark Adamson break; 13631da177e4SLinus Torvalds } /* priv->chip_type */ 13641da177e4SLinus Torvalds 13651da177e4SLinus Torvalds if (div_okay) { 1366bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", 1367441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 13681da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 13691da177e4SLinus Torvalds } 13701da177e4SLinus Torvalds 137195da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1372464cbb24SAlan Cox return div_value; 13731da177e4SLinus Torvalds } 13741da177e4SLinus Torvalds 137595da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 137695da310eSAlan Cox { 137795da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 137895da310eSAlan Cox __u16 urb_value; 137995da310eSAlan Cox __u16 urb_index; 138095da310eSAlan Cox __u32 urb_index_value; 138195da310eSAlan Cox int rv; 138295da310eSAlan Cox 138395da310eSAlan Cox urb_index_value = get_ftdi_divisor(tty, port); 138495da310eSAlan Cox urb_value = (__u16)urb_index_value; 138595da310eSAlan Cox urb_index = (__u16)(urb_index_value >> 16); 13860ee404ccSUwe Bonnes if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || 13870ee404ccSUwe Bonnes (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { 13880ee404ccSUwe Bonnes /* Probably the BM type needs the MSB of the encoded fractional 13890ee404ccSUwe Bonnes * divider also moved like for the chips above. Any infos? */ 139095da310eSAlan Cox urb_index = (__u16)((urb_index << 8) | priv->interface); 139195da310eSAlan Cox } 139295da310eSAlan Cox 139395da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 139495da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 139595da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 139695da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 139795da310eSAlan Cox urb_value, urb_index, 139866e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 139995da310eSAlan Cox return rv; 140095da310eSAlan Cox } 140195da310eSAlan Cox 1402557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1403557aaa7fSAlan Cox { 1404557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1405557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1406c1284d77SJohan Hovold int rv; 1407557aaa7fSAlan Cox int l = priv->latency; 140895da310eSAlan Cox 14092dea7cd7SIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14102dea7cd7SIan Abbott return -EINVAL; 14112dea7cd7SIan Abbott 1412557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1413557aaa7fSAlan Cox l = 1; 1414557aaa7fSAlan Cox 1415bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); 1416557aaa7fSAlan Cox 1417557aaa7fSAlan Cox rv = usb_control_msg(udev, 1418557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1419557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1420557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1421557aaa7fSAlan Cox l, priv->interface, 142266e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1423557aaa7fSAlan Cox if (rv < 0) 1424557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1425557aaa7fSAlan Cox return rv; 1426557aaa7fSAlan Cox } 1427557aaa7fSAlan Cox 14287e1e6cedSIan Abbott static int _read_latency_timer(struct usb_serial_port *port) 1429557aaa7fSAlan Cox { 1430557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1431557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 143254f328d0SJohan Hovold unsigned char *buf; 1433c1284d77SJohan Hovold int rv; 1434557aaa7fSAlan Cox 143554f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 143654f328d0SJohan Hovold if (!buf) 143754f328d0SJohan Hovold return -ENOMEM; 143854f328d0SJohan Hovold 1439557aaa7fSAlan Cox rv = usb_control_msg(udev, 1440557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1441557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1442557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1443557aaa7fSAlan Cox 0, priv->interface, 144454f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 1445e3e574adSJohan Hovold if (rv < 1) { 1446e3e574adSJohan Hovold if (rv >= 0) 1447e3e574adSJohan Hovold rv = -EIO; 1448e3e574adSJohan Hovold } else { 14497e1e6cedSIan Abbott rv = buf[0]; 1450e3e574adSJohan Hovold } 145154f328d0SJohan Hovold 145254f328d0SJohan Hovold kfree(buf); 145354f328d0SJohan Hovold 14548c4f99cdSJohan Hovold return rv; 1455557aaa7fSAlan Cox } 14561da177e4SLinus Torvalds 14577e1e6cedSIan Abbott static int read_latency_timer(struct usb_serial_port *port) 14587e1e6cedSIan Abbott { 14597e1e6cedSIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 14607e1e6cedSIan Abbott int rv; 14617e1e6cedSIan Abbott 14627e1e6cedSIan Abbott if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 14637e1e6cedSIan Abbott return -EINVAL; 14647e1e6cedSIan Abbott 14657e1e6cedSIan Abbott rv = _read_latency_timer(port); 14667e1e6cedSIan Abbott if (rv < 0) { 14677e1e6cedSIan Abbott dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 14687e1e6cedSIan Abbott return rv; 14697e1e6cedSIan Abbott } 14707e1e6cedSIan Abbott 14717e1e6cedSIan Abbott priv->latency = rv; 14727e1e6cedSIan Abbott 14737e1e6cedSIan Abbott return 0; 14747e1e6cedSIan Abbott } 14757e1e6cedSIan Abbott 1476464cbb24SAlan Cox static int get_serial_info(struct usb_serial_port *port, 1477464cbb24SAlan Cox struct serial_struct __user *retinfo) 14781da177e4SLinus Torvalds { 14791da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14801da177e4SLinus Torvalds struct serial_struct tmp; 14811da177e4SLinus Torvalds 14821da177e4SLinus Torvalds memset(&tmp, 0, sizeof(tmp)); 14831da177e4SLinus Torvalds tmp.flags = priv->flags; 14841da177e4SLinus Torvalds tmp.baud_base = priv->baud_base; 14851da177e4SLinus Torvalds tmp.custom_divisor = priv->custom_divisor; 14861da177e4SLinus Torvalds if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 14871da177e4SLinus Torvalds return -EFAULT; 14881da177e4SLinus Torvalds return 0; 1489e49bbce1SJohan Hovold } 14901da177e4SLinus Torvalds 149195da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 149295da310eSAlan Cox struct usb_serial_port *port, struct serial_struct __user *newinfo) 1493e49bbce1SJohan Hovold { 14941da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14951da177e4SLinus Torvalds struct serial_struct new_serial; 14961da177e4SLinus Torvalds struct ftdi_private old_priv; 14971da177e4SLinus Torvalds 14981da177e4SLinus Torvalds if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) 14991da177e4SLinus Torvalds return -EFAULT; 15006b447f04SAlan Cox 1501bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 15021da177e4SLinus Torvalds old_priv = *priv; 15031da177e4SLinus Torvalds 15041da177e4SLinus Torvalds /* Do error checking and permission checking */ 15051da177e4SLinus Torvalds 15061da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 15071da177e4SLinus Torvalds if (((new_serial.flags & ~ASYNC_USR_MASK) != 150864905b48SDan Carpenter (priv->flags & ~ASYNC_USR_MASK))) { 1509bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15101da177e4SLinus Torvalds return -EPERM; 151164905b48SDan Carpenter } 15121da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 15131da177e4SLinus Torvalds (new_serial.flags & ASYNC_USR_MASK)); 15141da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 15151da177e4SLinus Torvalds goto check_and_exit; 15161da177e4SLinus Torvalds } 15171da177e4SLinus Torvalds 1518eb833a9eSJohan Hovold if (new_serial.baud_base != priv->baud_base) { 1519bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15201da177e4SLinus Torvalds return -EINVAL; 15216b447f04SAlan Cox } 15221da177e4SLinus Torvalds 15231da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 15241da177e4SLinus Torvalds 15251da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 15261da177e4SLinus Torvalds (new_serial.flags & ASYNC_FLAGS)); 15271da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 15281da177e4SLinus Torvalds 1529557aaa7fSAlan Cox write_latency_timer(port); 15301da177e4SLinus Torvalds 15311da177e4SLinus Torvalds check_and_exit: 15321da177e4SLinus Torvalds if ((old_priv.flags & ASYNC_SPD_MASK) != 15331da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) { 15341da177e4SLinus Torvalds if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 153595da310eSAlan Cox tty->alt_speed = 57600; 15361da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 153795da310eSAlan Cox tty->alt_speed = 115200; 15381da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 153995da310eSAlan Cox tty->alt_speed = 230400; 15401da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 154195da310eSAlan Cox tty->alt_speed = 460800; 15421da177e4SLinus Torvalds else 154395da310eSAlan Cox tty->alt_speed = 0; 15441da177e4SLinus Torvalds } 15451da177e4SLinus Torvalds if (((old_priv.flags & ASYNC_SPD_MASK) != 15461da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) || 15471da177e4SLinus Torvalds (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 15481da177e4SLinus Torvalds (old_priv.custom_divisor != priv->custom_divisor))) { 154995da310eSAlan Cox change_speed(tty, port); 15509c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 15511da177e4SLinus Torvalds } 15526b447f04SAlan Cox else 1553bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 155495da310eSAlan Cox return 0; 1555e49bbce1SJohan Hovold } 15561da177e4SLinus Torvalds 1557c466cd2bSGreg Kroah-Hartman static int get_lsr_info(struct usb_serial_port *port, 155859556608SJohan Hovold unsigned int __user *retinfo) 1559c466cd2bSGreg Kroah-Hartman { 1560c466cd2bSGreg Kroah-Hartman struct ftdi_private *priv = usb_get_serial_port_data(port); 1561c466cd2bSGreg Kroah-Hartman unsigned int result = 0; 1562c466cd2bSGreg Kroah-Hartman 1563c466cd2bSGreg Kroah-Hartman if (priv->transmit_empty) 1564c466cd2bSGreg Kroah-Hartman result = TIOCSER_TEMT; 1565c466cd2bSGreg Kroah-Hartman 1566c466cd2bSGreg Kroah-Hartman if (copy_to_user(retinfo, &result, sizeof(unsigned int))) 1567c466cd2bSGreg Kroah-Hartman return -EFAULT; 1568c466cd2bSGreg Kroah-Hartman return 0; 1569c466cd2bSGreg Kroah-Hartman } 1570c466cd2bSGreg Kroah-Hartman 15711da177e4SLinus Torvalds 15728f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 15738f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 15748f977e42SIan Abbott { 15758f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 15768f977e42SIan Abbott struct usb_serial *serial = port->serial; 15778f977e42SIan Abbott struct usb_device *udev = serial->dev; 15788f977e42SIan Abbott unsigned version; 15798f977e42SIan Abbott unsigned interfaces; 15808f977e42SIan Abbott 15818f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1582f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 15838f977e42SIan Abbott 15848f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 15858f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1586bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, 15878f977e42SIan Abbott version, interfaces); 15888f977e42SIan Abbott if (interfaces > 1) { 15898f977e42SIan Abbott int inter; 15908f977e42SIan Abbott 1591094c2e6dSMark Adamson /* Multiple interfaces.*/ 1592094c2e6dSMark Adamson if (version == 0x0800) { 1593094c2e6dSMark Adamson priv->chip_type = FT4232H; 1594094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1595094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1596094c2e6dSMark Adamson } else if (version == 0x0700) { 1597094c2e6dSMark Adamson priv->chip_type = FT2232H; 1598094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1599094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1600094c2e6dSMark Adamson } else 16018f977e42SIan Abbott priv->chip_type = FT2232C; 1602094c2e6dSMark Adamson 16038f977e42SIan Abbott /* Determine interface code. */ 16048f977e42SIan Abbott inter = serial->interface->altsetting->desc.bInterfaceNumber; 1605094c2e6dSMark Adamson if (inter == 0) { 1606094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1607094c2e6dSMark Adamson } else if (inter == 1) { 1608094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1609094c2e6dSMark Adamson } else if (inter == 2) { 1610094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1611094c2e6dSMark Adamson } else if (inter == 3) { 1612094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1613094c2e6dSMark Adamson } 16148f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 16158f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 16168f977e42SIan Abbott if (version < 0x500) { 1617bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, 1618bfc51614SGreg Kroah-Hartman "%s: something fishy - bcdDevice too low for multi-interface device\n", 1619441b62c1SHarvey Harrison __func__); 16208f977e42SIan Abbott } 16218f977e42SIan Abbott } else if (version < 0x200) { 1622330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 16238f977e42SIan Abbott priv->chip_type = SIO; 16248f977e42SIan Abbott priv->baud_base = 12000000 / 16; 16258f977e42SIan Abbott } else if (version < 0x400) { 1626330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 16278f977e42SIan Abbott priv->chip_type = FT8U232AM; 16287e1e6cedSIan Abbott /* 16297e1e6cedSIan Abbott * It might be a BM type because of the iSerialNumber bug. 16307e1e6cedSIan Abbott * If iSerialNumber==0 and the latency timer is readable, 16317e1e6cedSIan Abbott * assume it is BM type. 16327e1e6cedSIan Abbott */ 16337e1e6cedSIan Abbott if (udev->descriptor.iSerialNumber == 0 && 16347e1e6cedSIan Abbott _read_latency_timer(port) >= 0) { 16357e1e6cedSIan Abbott dev_dbg(&port->dev, 16367e1e6cedSIan Abbott "%s: has latency timer so not an AM type\n", 16377e1e6cedSIan Abbott __func__); 16387e1e6cedSIan Abbott priv->chip_type = FT232BM; 16397e1e6cedSIan Abbott } 16403b009c63SDavid Brownell } else if (version < 0x600) { 1641330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 16428f977e42SIan Abbott priv->chip_type = FT232BM; 1643309427b6SUwe Bonnes } else if (version < 0x900) { 1644309427b6SUwe Bonnes /* Assume it's an FT232RL */ 16453b009c63SDavid Brownell priv->chip_type = FT232RL; 1646dc0827c1SJim Paris } else if (version < 0x1000) { 1647309427b6SUwe Bonnes /* Assume it's an FT232H */ 1648309427b6SUwe Bonnes priv->chip_type = FT232H; 1649dc0827c1SJim Paris } else { 1650dc0827c1SJim Paris /* Assume it's an FT-X series device */ 1651dc0827c1SJim Paris priv->chip_type = FTX; 16528f977e42SIan Abbott } 1653dc0827c1SJim Paris 1654c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 16558f977e42SIan Abbott } 16568f977e42SIan Abbott 16578f977e42SIan Abbott 165847e57595SJohan Hovold /* 165947e57595SJohan Hovold * Determine the maximum packet size for the device. This depends on the chip 1660895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 166147e57595SJohan Hovold * device descriptor as the chip will use the appropriate values for the host. 166247e57595SJohan Hovold */ 1663895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1664895f28baSMark Adamson { 1665895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 166647e57595SJohan Hovold struct usb_interface *interface = port->serial->interface; 1667aea1ae87SJohan Hovold struct usb_endpoint_descriptor *ep_desc; 1668895f28baSMark Adamson unsigned num_endpoints; 1669aea1ae87SJohan Hovold unsigned i; 1670895f28baSMark Adamson 1671895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1672aea1ae87SJohan Hovold if (!num_endpoints) 1673aea1ae87SJohan Hovold return; 1674aea1ae87SJohan Hovold 167547e57595SJohan Hovold /* 167647e57595SJohan Hovold * NOTE: Some customers have programmed FT232R/FT245R devices 1677895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1678895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 167947e57595SJohan Hovold * value of 64 for wMaxPacketSize. 168047e57595SJohan Hovold */ 1681895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1682895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 168347e57595SJohan Hovold if (!ep_desc->wMaxPacketSize) { 1684895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1685a90d84adSJohan Hovold dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n", 1686a90d84adSJohan Hovold usb_endpoint_num(ep_desc)); 1687895f28baSMark Adamson } 1688895f28baSMark Adamson } 1689895f28baSMark Adamson 169047e57595SJohan Hovold /* Set max packet size based on last descriptor. */ 169129cc8897SKuninori Morimoto priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1692895f28baSMark Adamson } 1693895f28baSMark Adamson 1694895f28baSMark Adamson 16951da177e4SLinus Torvalds /* 16961da177e4SLinus Torvalds * *************************************************************************** 16971da177e4SLinus Torvalds * Sysfs Attribute 16981da177e4SLinus Torvalds * *************************************************************************** 16991da177e4SLinus Torvalds */ 17001da177e4SLinus Torvalds 1701154547c4SGreg Kroah-Hartman static ssize_t latency_timer_show(struct device *dev, 1702464cbb24SAlan Cox struct device_attribute *attr, char *buf) 17031da177e4SLinus Torvalds { 17041da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 17051da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1706557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1707557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1708557aaa7fSAlan Cox else 1709557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 17101da177e4SLinus Torvalds } 1711557aaa7fSAlan Cox 17121da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1713154547c4SGreg Kroah-Hartman static ssize_t latency_timer_store(struct device *dev, 1714154547c4SGreg Kroah-Hartman struct device_attribute *attr, 1715154547c4SGreg Kroah-Hartman 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); 1719db924066SIan Abbott u8 v; 1720c1284d77SJohan Hovold int rv; 17211da177e4SLinus Torvalds 1722db924066SIan Abbott if (kstrtou8(valbuf, 10, &v)) 1723db924066SIan Abbott return -EINVAL; 1724db924066SIan Abbott 1725557aaa7fSAlan Cox priv->latency = v; 1726557aaa7fSAlan Cox rv = write_latency_timer(port); 1727557aaa7fSAlan Cox if (rv < 0) 17281da177e4SLinus Torvalds return -EIO; 17291da177e4SLinus Torvalds return count; 17301da177e4SLinus Torvalds } 1731154547c4SGreg Kroah-Hartman static DEVICE_ATTR_RW(latency_timer); 17321da177e4SLinus Torvalds 17331da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 17341da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1735464cbb24SAlan Cox static ssize_t store_event_char(struct device *dev, 1736464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 17371da177e4SLinus Torvalds { 17381da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 17391da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 174012bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 1741d0559a2fSIan Abbott unsigned int v; 1742c1284d77SJohan Hovold int rv; 17431da177e4SLinus Torvalds 1744*f1ce25f2SIan Abbott if (kstrtouint(valbuf, 0, &v) || v >= 0x200) 1745d0559a2fSIan Abbott return -EINVAL; 1746d0559a2fSIan Abbott 1747*f1ce25f2SIan Abbott dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v); 17481da177e4SLinus Torvalds 17491da177e4SLinus Torvalds rv = usb_control_msg(udev, 17501da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 17511da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 17521da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 17531da177e4SLinus Torvalds v, priv->interface, 175466e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 17551da177e4SLinus Torvalds if (rv < 0) { 1756bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); 17571da177e4SLinus Torvalds return -EIO; 17581da177e4SLinus Torvalds } 17591da177e4SLinus Torvalds 17601da177e4SLinus Torvalds return count; 17611da177e4SLinus Torvalds } 17621da177e4SLinus Torvalds static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 17631da177e4SLinus Torvalds 176412bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 17651da177e4SLinus Torvalds { 176612bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 176713f4db9eSGreg Kroah-Hartman int retval = 0; 17681da177e4SLinus Torvalds 17691da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 17701da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 17711da177e4SLinus Torvalds if (priv->chip_type != SIO) { 1772bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 177312bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 177413f4db9eSGreg Kroah-Hartman if ((!retval) && 177597cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 177697cd49ebSStepan Moskovchenko 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 retval = device_create_file(&port->dev, 178313f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 17841da177e4SLinus Torvalds } 17851da177e4SLinus Torvalds } 178613f4db9eSGreg Kroah-Hartman return retval; 17871da177e4SLinus Torvalds } 17881da177e4SLinus Torvalds 178912bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 17901da177e4SLinus Torvalds { 179112bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 17921da177e4SLinus Torvalds 17931da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 17941da177e4SLinus Torvalds if (priv->chip_type != SIO) { 179512bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1796ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1797ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1798094c2e6dSMark Adamson priv->chip_type == FT232RL || 1799094c2e6dSMark Adamson priv->chip_type == FT2232H || 1800309427b6SUwe Bonnes priv->chip_type == FT4232H || 1801dc0827c1SJim Paris priv->chip_type == FT232H || 1802dc0827c1SJim Paris priv->chip_type == FTX) { 180312bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 18041da177e4SLinus Torvalds } 18051da177e4SLinus Torvalds } 18061da177e4SLinus Torvalds 18071da177e4SLinus Torvalds } 18081da177e4SLinus Torvalds 18091da177e4SLinus Torvalds /* 18101da177e4SLinus Torvalds * *************************************************************************** 18111da177e4SLinus Torvalds * FTDI driver specific functions 18121da177e4SLinus Torvalds * *************************************************************************** 18131da177e4SLinus Torvalds */ 18141da177e4SLinus Torvalds 18158f977e42SIan Abbott /* Probe function to check for special devices */ 1816464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1817464cbb24SAlan Cox const struct usb_device_id *id) 18188f977e42SIan Abbott { 18193c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = 1820464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 1821fa91d43bSTony Lindgren 1822fa91d43bSTony Lindgren if (quirk && quirk->probe) { 1823fa91d43bSTony Lindgren int ret = quirk->probe(serial); 1824fa91d43bSTony Lindgren if (ret != 0) 1825fa91d43bSTony Lindgren return ret; 1826fa91d43bSTony Lindgren } 1827fa91d43bSTony Lindgren 18288f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 18298f977e42SIan Abbott 1830fa91d43bSTony Lindgren return 0; 18318f977e42SIan Abbott } 18328f977e42SIan Abbott 183312bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 18341da177e4SLinus Torvalds { 18351da177e4SLinus Torvalds struct ftdi_private *priv; 18363c77f7c9SJulia Lawall const struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 18370ffbbe25SOliver Neukum 18381da177e4SLinus Torvalds 183980b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 184010c642d0SJohan Hovold if (!priv) 18411da177e4SLinus Torvalds return -ENOMEM; 18421da177e4SLinus Torvalds 1843bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 18440076b4beSJohan Hovold 18450ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 18460ffbbe25SOliver Neukum quirk->port_probe(priv); 18470ffbbe25SOliver Neukum 184812bdbe03SJim Radford usb_set_serial_port_data(port, priv); 18491da177e4SLinus Torvalds 185012bdbe03SJim Radford ftdi_determine_type(port); 1851895f28baSMark Adamson ftdi_set_max_packet_size(port); 18528c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 18538c4f99cdSJohan Hovold priv->latency = 16; 1854c19db4c9SJohan Hovold write_latency_timer(port); 185512bdbe03SJim Radford create_sysfs_attrs(port); 185612bdbe03SJim Radford return 0; 18571da177e4SLinus Torvalds } 18581da177e4SLinus Torvalds 18598f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 18608f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 18611da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 18620ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 18631da177e4SLinus Torvalds { 18641da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 18651da177e4SLinus Torvalds priv->custom_divisor = 77; 1866669a6db1SAlan Cox priv->force_baud = 38400; 1867e49bbce1SJohan Hovold } 18681da177e4SLinus Torvalds 18698f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 18708f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 1871464cbb24SAlan Cox 18720ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 18738f977e42SIan Abbott { 18741da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 18751da177e4SLinus Torvalds priv->custom_divisor = 240; 1876669a6db1SAlan Cox priv->force_baud = 38400; 18771da177e4SLinus Torvalds priv->force_rtscts = 1; 1878e49bbce1SJohan Hovold } 18791da177e4SLinus Torvalds 1880fa91d43bSTony Lindgren /* 1881b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 1882970e2486SLucas De Marchi * If this value is not set in /etc/modprobe.d/ its value will be set 1883970e2486SLucas De Marchi * to 1ms. 1884b760dac2SMartin Geleynse */ 1885b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 1886b760dac2SMartin Geleynse 1887b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 1888b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 1889b760dac2SMartin Geleynse * 1890b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 1891b760dac2SMartin Geleynse */ 1892b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 1893b760dac2SMartin Geleynse { 1894b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 1895b760dac2SMartin Geleynse int latency = ndi_latency_timer; 1896b760dac2SMartin Geleynse 1897b760dac2SMartin Geleynse if (latency == 0) 1898b760dac2SMartin Geleynse latency = 1; 1899b760dac2SMartin Geleynse if (latency > 99) 1900b760dac2SMartin Geleynse latency = 99; 1901b760dac2SMartin Geleynse 1902bfc51614SGreg Kroah-Hartman dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); 1903bfc51614SGreg Kroah-Hartman dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); 1904b760dac2SMartin Geleynse 1905c1284d77SJohan Hovold /* FIXME: errors are not returned */ 1906c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 1907b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1908b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 190966e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 1910b760dac2SMartin Geleynse return 0; 1911b760dac2SMartin Geleynse } 1912b760dac2SMartin Geleynse 1913b760dac2SMartin Geleynse /* 191420734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 191520734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 191620734345SHarald Welte * userspace using openocd. 1917fa91d43bSTony Lindgren */ 191820734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 1919fa91d43bSTony Lindgren { 1920fa91d43bSTony Lindgren struct usb_device *udev = serial->dev; 1921fa91d43bSTony Lindgren struct usb_interface *interface = serial->interface; 1922fa91d43bSTony Lindgren 1923fa91d43bSTony Lindgren if (interface == udev->actconfig->interface[0]) { 1924c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, 1925c197a8dbSGreg Kroah-Hartman "Ignoring serial port reserved for JTAG\n"); 1926fa91d43bSTony Lindgren return -ENODEV; 1927fa91d43bSTony Lindgren } 1928fa91d43bSTony Lindgren 1929fa91d43bSTony Lindgren return 0; 1930fa91d43bSTony Lindgren } 19311da177e4SLinus Torvalds 1932c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial) 1933c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { 1934c96fbdd0SJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 1935c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1936b229a0f8SDoug Goldstein if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) 1937b229a0f8SDoug Goldstein return ftdi_jtag_probe(serial); 1938b229a0f8SDoug Goldstein 1939b229a0f8SDoug Goldstein if (udev->product && 1940b229a0f8SDoug Goldstein (!strcmp(udev->product, "BeagleBone/XDS100V2") || 1941b229a0f8SDoug Goldstein !strcmp(udev->product, "SNAP Connect E10"))) 1942c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return ftdi_jtag_probe(serial); 1943c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1944c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return 0; 1945c96fbdd0SJean-Christophe PLAGNIOL-VILLARD } 1946c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1947546d7eecSKevin Vance /* 194871d9a2b9SAdrian Thomasset * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's 194971d9a2b9SAdrian Thomasset * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and 195071d9a2b9SAdrian Thomasset * can be accessed from userspace. 195171d9a2b9SAdrian Thomasset * The next two ports are enabled as UARTs by default, where port 2 is 195271d9a2b9SAdrian Thomasset * a conventional RS-232 UART. 19536ec2f46cSJean-Christophe PLAGNIOL-VILLARD */ 19546ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial) 19556ec2f46cSJean-Christophe PLAGNIOL-VILLARD { 19566ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 19576ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_interface *interface = serial->interface; 19586ec2f46cSJean-Christophe PLAGNIOL-VILLARD 195971d9a2b9SAdrian Thomasset if (interface == udev->actconfig->interface[0] || 196071d9a2b9SAdrian Thomasset interface == udev->actconfig->interface[1]) { 19616ec2f46cSJean-Christophe PLAGNIOL-VILLARD dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); 19626ec2f46cSJean-Christophe PLAGNIOL-VILLARD return -ENODEV; 19636ec2f46cSJean-Christophe PLAGNIOL-VILLARD } 19646ec2f46cSJean-Christophe PLAGNIOL-VILLARD 196571d9a2b9SAdrian Thomasset return 0; 196671d9a2b9SAdrian Thomasset } 196771d9a2b9SAdrian Thomasset 196812bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 196912bdbe03SJim Radford { 19701da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 19711da177e4SLinus Torvalds 197212bdbe03SJim Radford remove_sysfs_attrs(port); 19731da177e4SLinus Torvalds 19744cba98ffSJohan Hovold kfree(priv); 19751da177e4SLinus Torvalds 197612bdbe03SJim Radford return 0; 197712bdbe03SJim Radford } 19781da177e4SLinus Torvalds 1979a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 1980e49bbce1SJohan Hovold { 19811da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 19821da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 19831da177e4SLinus Torvalds 19841da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 19851da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 19861da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 19871da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 19881da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 198966e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 19901da177e4SLinus Torvalds 19911da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 1992c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 19931da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 19941da177e4SLinus Torvalds 19951da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 1996be0278ccSJohan Hovold if (tty) 1997be0278ccSJohan Hovold ftdi_set_termios(tty, port, NULL); 19981da177e4SLinus Torvalds 19994cba98ffSJohan Hovold return usb_serial_generic_open(tty, port); 2000e49bbce1SJohan Hovold } 20011da177e4SLinus Torvalds 2002335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 2003335f8514SAlan Cox { 2004335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 2005335f8514SAlan Cox 2006335f8514SAlan Cox /* Disable flow control */ 2007b2ca6990SJohan Hovold if (!on) { 2008b2ca6990SJohan Hovold if (usb_control_msg(port->serial->dev, 2009335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 2010335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 2011335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 201266e47e60SJohan Hovold 0, priv->interface, NULL, 0, 2013335f8514SAlan Cox WDR_TIMEOUT) < 0) { 2014335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 2015335f8514SAlan Cox } 2016b2ca6990SJohan Hovold } 2017335f8514SAlan Cox /* drop RTS and DTR */ 2018335f8514SAlan Cox if (on) 2019335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2020335f8514SAlan Cox else 2021335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2022335f8514SAlan Cox } 20231da177e4SLinus Torvalds 20241da177e4SLinus Torvalds /* The SIO requires the first byte to have: 20251da177e4SLinus Torvalds * B0 1 20261da177e4SLinus Torvalds * B1 0 20271da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 20281da177e4SLinus Torvalds * 20291da177e4SLinus Torvalds * The new devices do not require this byte 20301da177e4SLinus Torvalds */ 2031d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 2032c23e5fc1SJohan Hovold void *dest, size_t size) 2033e49bbce1SJohan Hovold { 2034d3901a06SJohan Hovold struct ftdi_private *priv; 2035c23e5fc1SJohan Hovold int count; 2036c23e5fc1SJohan Hovold unsigned long flags; 20371da177e4SLinus Torvalds 2038d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 20391da177e4SLinus Torvalds 2040e8770484SJohan Hovold if (priv->chip_type == SIO) { 2041c23e5fc1SJohan Hovold unsigned char *buffer = dest; 2042c23e5fc1SJohan Hovold int i, len, c; 20431da177e4SLinus Torvalds 2044c23e5fc1SJohan Hovold count = 0; 2045c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 2046c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 2047c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 2048c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 2049c23e5fc1SJohan Hovold if (!c) 2050c23e5fc1SJohan Hovold break; 2051cb1676a6SJohan Hovold port->icount.tx += c; 2052c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 2053c23e5fc1SJohan Hovold count += c + 1; 20541da177e4SLinus Torvalds } 2055c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 20561da177e4SLinus Torvalds } else { 2057c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 2058c23e5fc1SJohan Hovold &port->lock); 2059cb1676a6SJohan Hovold port->icount.tx += count; 20601da177e4SLinus Torvalds } 20611da177e4SLinus Torvalds 20621da177e4SLinus Torvalds return count; 206395da310eSAlan Cox } 20641da177e4SLinus Torvalds 2065166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 2066166ceb69SJohan Hovold 206792a19f9cSJiri Slaby static int ftdi_process_packet(struct usb_serial_port *port, 206892a19f9cSJiri Slaby struct ftdi_private *priv, char *packet, int len) 206995da310eSAlan Cox { 20701da177e4SLinus Torvalds int i; 2071cc01f17dSJohan Hovold char status; 2072cc01f17dSJohan Hovold char flag; 2073cc01f17dSJohan Hovold char *ch; 20741da177e4SLinus Torvalds 2075cc01f17dSJohan Hovold if (len < 2) { 2076bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "malformed packet\n"); 2077cc01f17dSJohan Hovold return 0; 20781da177e4SLinus Torvalds } 20791da177e4SLinus Torvalds 2080464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 2081464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 2082464cbb24SAlan Cox are only processed once. */ 2083cc01f17dSJohan Hovold status = packet[0] & FTDI_STATUS_B0_MASK; 2084cc01f17dSJohan Hovold if (status != priv->prev_status) { 2085fca5430dSSimon Arlott char diff_status = status ^ priv->prev_status; 2086fca5430dSSimon Arlott 2087fca5430dSSimon Arlott if (diff_status & FTDI_RS0_CTS) 2088cb1676a6SJohan Hovold port->icount.cts++; 2089fca5430dSSimon Arlott if (diff_status & FTDI_RS0_DSR) 2090cb1676a6SJohan Hovold port->icount.dsr++; 2091fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RI) 2092cb1676a6SJohan Hovold port->icount.rng++; 2093d14654dfSPaul Chavent if (diff_status & FTDI_RS0_RLSD) { 2094d14654dfSPaul Chavent struct tty_struct *tty; 2095d14654dfSPaul Chavent 2096cb1676a6SJohan Hovold port->icount.dcd++; 2097d14654dfSPaul Chavent tty = tty_port_tty_get(&port->port); 2098d14654dfSPaul Chavent if (tty) 2099d14654dfSPaul Chavent usb_serial_handle_dcd_change(port, tty, 2100d14654dfSPaul Chavent status & FTDI_RS0_RLSD); 2101d14654dfSPaul Chavent tty_kref_put(tty); 2102d14654dfSPaul Chavent } 2103fca5430dSSimon Arlott 2104f307e5cdSJohan Hovold wake_up_interruptible(&port->port.delta_msr_wait); 2105cc01f17dSJohan Hovold priv->prev_status = status; 21061da177e4SLinus Torvalds } 21071da177e4SLinus Torvalds 2108a6bb1e17SJohan Hovold /* save if the transmitter is empty or not */ 2109a6bb1e17SJohan Hovold if (packet[1] & FTDI_RS_TEMT) 2110a6bb1e17SJohan Hovold priv->transmit_empty = 1; 2111a6bb1e17SJohan Hovold else 2112a6bb1e17SJohan Hovold priv->transmit_empty = 0; 2113a6bb1e17SJohan Hovold 2114a6bb1e17SJohan Hovold len -= 2; 2115a6bb1e17SJohan Hovold if (!len) 2116a6bb1e17SJohan Hovold return 0; /* status only */ 2117a6bb1e17SJohan Hovold 2118a6bb1e17SJohan Hovold /* 2119a6bb1e17SJohan Hovold * Break and error status must only be processed for packets with 2120a6bb1e17SJohan Hovold * data payload to avoid over-reporting. 2121a6bb1e17SJohan Hovold */ 2122cc01f17dSJohan Hovold flag = TTY_NORMAL; 2123166ceb69SJohan Hovold if (packet[1] & FTDI_RS_ERR_MASK) { 2124166ceb69SJohan Hovold /* Break takes precedence over parity, which takes precedence 2125166ceb69SJohan Hovold * over framing errors */ 2126cc01f17dSJohan Hovold if (packet[1] & FTDI_RS_BI) { 2127cc01f17dSJohan Hovold flag = TTY_BREAK; 2128cb1676a6SJohan Hovold port->icount.brk++; 212972fda3caSJason Wessel usb_serial_handle_break(port); 2130166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_PE) { 2131cc01f17dSJohan Hovold flag = TTY_PARITY; 2132cb1676a6SJohan Hovold port->icount.parity++; 2133166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_FE) { 2134cc01f17dSJohan Hovold flag = TTY_FRAME; 2135cb1676a6SJohan Hovold port->icount.frame++; 2136166ceb69SJohan Hovold } 2137166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 2138005b3cdeSUwe Bonnes if (packet[1] & FTDI_RS_OE) { 2139cb1676a6SJohan Hovold port->icount.overrun++; 214092a19f9cSJiri Slaby tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 21411da177e4SLinus Torvalds } 2142005b3cdeSUwe Bonnes } 21431da177e4SLinus Torvalds 2144cb1676a6SJohan Hovold port->icount.rx += len; 2145cc01f17dSJohan Hovold ch = packet + 2; 2146cc01f17dSJohan Hovold 214749b2597aSJohan Hovold if (port->port.console && port->sysrq) { 2148cc01f17dSJohan Hovold for (i = 0; i < len; i++, ch++) { 21496ee9f4b4SDmitry Torokhov if (!usb_serial_handle_sysrq_char(port, *ch)) 215092a19f9cSJiri Slaby tty_insert_flip_char(&port->port, *ch, flag); 2151cc01f17dSJohan Hovold } 215249b2597aSJohan Hovold } else { 21532f693357SJiri Slaby tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len); 2154cc01f17dSJohan Hovold } 215549b2597aSJohan Hovold 2156cc01f17dSJohan Hovold return len; 2157cc01f17dSJohan Hovold } 2158cc01f17dSJohan Hovold 21591b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 2160cc01f17dSJohan Hovold { 21611b551015SJohan Hovold struct usb_serial_port *port = urb->context; 2162cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2163cc01f17dSJohan Hovold char *data = (char *)urb->transfer_buffer; 2164cc01f17dSJohan Hovold int i; 2165cc01f17dSJohan Hovold int len; 2166cc01f17dSJohan Hovold int count = 0; 2167cc01f17dSJohan Hovold 2168cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 2169cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 217092a19f9cSJiri Slaby count += ftdi_process_packet(port, priv, &data[i], len); 2171cc01f17dSJohan Hovold } 2172cc01f17dSJohan Hovold 2173cc01f17dSJohan Hovold if (count) 21742e124b4aSJiri Slaby tty_flip_buffer_push(&port->port); 2175cc01f17dSJohan Hovold } 21761da177e4SLinus Torvalds 217795da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 21781da177e4SLinus Torvalds { 217995da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 21801da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2181c1284d77SJohan Hovold __u16 urb_value; 21821da177e4SLinus Torvalds 21831da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 21841da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 21851da177e4SLinus Torvalds /* last_set_data_urb_value NEVER has the break bit set in it */ 21861da177e4SLinus Torvalds 2187464cbb24SAlan Cox if (break_state) 21881da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK; 2189464cbb24SAlan Cox else 21901da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value; 21911da177e4SLinus Torvalds 2192464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 2193464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 21941da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 21951da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 21961da177e4SLinus Torvalds urb_value , priv->interface, 219766e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2198bfc51614SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", 2199bfc51614SGreg Kroah-Hartman __func__, break_state); 22001da177e4SLinus Torvalds } 22011da177e4SLinus Torvalds 2202bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, 2203464cbb24SAlan Cox break_state, urb_value); 22041da177e4SLinus Torvalds 22051da177e4SLinus Torvalds } 22061da177e4SLinus Torvalds 2207a37025b5SJohan Hovold static bool ftdi_tx_empty(struct usb_serial_port *port) 22086f602912SJarkko Huijts { 22095fb0432eSJohan Hovold unsigned char buf[2]; 22106f602912SJarkko Huijts int ret; 22116f602912SJarkko Huijts 2212c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 22135fb0432eSJohan Hovold if (ret == 2) { 22146f602912SJarkko Huijts if (!(buf[1] & FTDI_RS_TEMT)) 2215a37025b5SJohan Hovold return false; 22165fb0432eSJohan Hovold } 22176f602912SJarkko Huijts 2218a37025b5SJohan Hovold return true; 22196f602912SJarkko Huijts } 22206f602912SJarkko Huijts 22211da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 22221da177e4SLinus Torvalds * the new setting to be used 22231da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 22241da177e4SLinus Torvalds */ 222595da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 222695da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 2227e49bbce1SJohan Hovold { 22281da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 2229bfc51614SGreg Kroah-Hartman struct device *ddev = &port->dev; 22301da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2231adc8d746SAlan Cox struct ktermios *termios = &tty->termios; 2232669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 22331da177e4SLinus Torvalds __u16 urb_value; /* will hold the new flags */ 22341da177e4SLinus Torvalds 2235464cbb24SAlan Cox /* Added for xon/xoff support */ 2236669a6db1SAlan Cox unsigned int iflag = termios->c_iflag; 22371da177e4SLinus Torvalds unsigned char vstop; 22381da177e4SLinus Torvalds unsigned char vstart; 22391da177e4SLinus Torvalds 2240464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 2241464cbb24SAlan Cox B0. */ 2242669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 2243bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); 224495da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 2245bd5e47ccSAndrew Morton priv->force_baud); 22461da177e4SLinus Torvalds } 22471da177e4SLinus Torvalds 22481da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 22491da177e4SLinus Torvalds if (priv->force_rtscts) { 2250bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); 2251669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 22521da177e4SLinus Torvalds } 22531da177e4SLinus Torvalds 22548704211fSColin Leitner /* 2255c1f15196SColin Leitner * All FTDI UART chips are limited to CS7/8. We shouldn't pretend to 22568704211fSColin Leitner * support CS5/6 and revert the CSIZE setting instead. 2257c1f15196SColin Leitner * 2258c1f15196SColin Leitner * CS5 however is used to control some smartcard readers which abuse 2259c1f15196SColin Leitner * this limitation to switch modes. Original FTDI chips fall back to 2260c1f15196SColin Leitner * eight data bits. 2261c1f15196SColin Leitner * 2262c1f15196SColin Leitner * TODO: Implement a quirk to only allow this with mentioned 2263c1f15196SColin Leitner * readers. One I know of (Argolis Smartreader V1) 2264c1f15196SColin Leitner * returns "USB smartcard server" as iInterface string. 2265c1f15196SColin Leitner * The vendor didn't bother with a custom VID/PID of 2266c1f15196SColin Leitner * course. 22678704211fSColin Leitner */ 2268c1f15196SColin Leitner if (C_CSIZE(tty) == CS6) { 22698704211fSColin Leitner dev_warn(ddev, "requested CSIZE setting not supported\n"); 22708704211fSColin Leitner 22718704211fSColin Leitner termios->c_cflag &= ~CSIZE; 22728704211fSColin Leitner if (old_termios) 22738704211fSColin Leitner termios->c_cflag |= old_termios->c_cflag & CSIZE; 22748704211fSColin Leitner else 22758704211fSColin Leitner termios->c_cflag |= CS8; 22768704211fSColin Leitner } 22778704211fSColin Leitner 2278669a6db1SAlan Cox cflag = termios->c_cflag; 22791da177e4SLinus Torvalds 2280a816e311SYing Xue if (!old_termios) 2281c515598eSAndrew Worsley goto no_skip; 2282c515598eSAndrew Worsley 2283b1ffb4c8SAndrew Worsley if (old_termios->c_cflag == termios->c_cflag 2284b1ffb4c8SAndrew Worsley && old_termios->c_ispeed == termios->c_ispeed 2285b1ffb4c8SAndrew Worsley && old_termios->c_ospeed == termios->c_ospeed) 2286b1ffb4c8SAndrew Worsley goto no_c_cflag_changes; 2287b1ffb4c8SAndrew Worsley 22881da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 2289464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 2290464cbb24SAlan Cox don't see any problems yet */ 22911da177e4SLinus Torvalds 2292b1ffb4c8SAndrew Worsley if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) == 2293b1ffb4c8SAndrew Worsley (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) 2294b1ffb4c8SAndrew Worsley goto no_data_parity_stop_changes; 2295b1ffb4c8SAndrew Worsley 2296c515598eSAndrew Worsley no_skip: 22971da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 22981da177e4SLinus Torvalds 22991da177e4SLinus Torvalds urb_value = 0; 23001da177e4SLinus Torvalds urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 23011da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 230238fcb830SRoland Koebler if (cflag & PARENB) { 230338fcb830SRoland Koebler if (cflag & CMSPAR) 230438fcb830SRoland Koebler urb_value |= cflag & PARODD ? 230538fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 230638fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 230738fcb830SRoland Koebler else 230838fcb830SRoland Koebler urb_value |= cflag & PARODD ? 230938fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 231038fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 231138fcb830SRoland Koebler } else { 231238fcb830SRoland Koebler urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; 231338fcb830SRoland Koebler } 23141da177e4SLinus Torvalds switch (cflag & CSIZE) { 2315c1f15196SColin Leitner case CS5: 2316c1f15196SColin Leitner dev_dbg(ddev, "Setting CS5 quirk\n"); 2317c1f15196SColin Leitner break; 2318bfc51614SGreg Kroah-Hartman case CS7: 2319bfc51614SGreg Kroah-Hartman urb_value |= 7; 2320bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS7\n"); 2321bfc51614SGreg Kroah-Hartman break; 23228704211fSColin Leitner default: 2323bfc51614SGreg Kroah-Hartman case CS8: 2324bfc51614SGreg Kroah-Hartman urb_value |= 8; 2325bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS8\n"); 2326bfc51614SGreg Kroah-Hartman break; 23271da177e4SLinus Torvalds } 23281da177e4SLinus Torvalds 2329464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 2330464cbb24SAlan Cox - but is or'ed with this value */ 23311da177e4SLinus Torvalds priv->last_set_data_urb_value = urb_value; 23321da177e4SLinus Torvalds 23331da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 23341da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 23351da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 23361da177e4SLinus Torvalds urb_value , priv->interface, 233766e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 2338bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", 2339bfc51614SGreg Kroah-Hartman __func__); 23401da177e4SLinus Torvalds } 23411da177e4SLinus Torvalds 23421da177e4SLinus Torvalds /* Now do the baudrate */ 2343b1ffb4c8SAndrew Worsley no_data_parity_stop_changes: 23441da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 23451da177e4SLinus Torvalds /* Disable flow control */ 23461da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 23471da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23481da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 23491da177e4SLinus Torvalds 0, priv->interface, 235066e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2351bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s error from disable flowcontrol urb\n", 2352194343d9SGreg Kroah-Hartman __func__); 23531da177e4SLinus Torvalds } 23541da177e4SLinus Torvalds /* Drop RTS and DTR */ 235574ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 23561da177e4SLinus Torvalds } else { 23571da177e4SLinus Torvalds /* set the baudrate determined before */ 23589c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 2359464cbb24SAlan Cox if (change_speed(tty, port)) 2360bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s urb failed to set baudrate\n", __func__); 23619c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 236272a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 23633177130fSJohan Hovold if (old_termios && (old_termios->c_cflag & CBAUD) == B0) 236474ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 23651da177e4SLinus Torvalds } 23661da177e4SLinus Torvalds 23671da177e4SLinus Torvalds /* Set flow control */ 23681da177e4SLinus Torvalds /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ 2369b1ffb4c8SAndrew Worsley no_c_cflag_changes: 23701da177e4SLinus Torvalds if (cflag & CRTSCTS) { 2371bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Setting to CRTSCTS flow control\n", __func__); 23721da177e4SLinus Torvalds if (usb_control_msg(dev, 23731da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 23741da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 23751da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 23761da177e4SLinus Torvalds 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), 237766e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2378bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to set to rts/cts flow control\n"); 23791da177e4SLinus Torvalds } 23801da177e4SLinus Torvalds } else { 23811da177e4SLinus Torvalds /* 23821da177e4SLinus Torvalds * Xon/Xoff code 23831da177e4SLinus Torvalds * 2384464cbb24SAlan Cox * Check the IXOFF status in the iflag component of the 2385464cbb24SAlan Cox * termios structure. If IXOFF is not set, the pre-xon/xoff 2386464cbb24SAlan Cox * code is executed. 23871da177e4SLinus Torvalds */ 23881da177e4SLinus Torvalds if (iflag & IXOFF) { 2389bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s request to enable xonxoff iflag=%04x\n", 2390464cbb24SAlan Cox __func__, iflag); 2391464cbb24SAlan Cox /* Try to enable the XON/XOFF on the ftdi_sio 2392464cbb24SAlan Cox * Set the vstart and vstop -- could have been done up 2393464cbb24SAlan Cox * above where a lot of other dereferencing is done but 2394464cbb24SAlan Cox * that would be very inefficient as vstart and vstop 2395464cbb24SAlan Cox * are not always needed. 2396464cbb24SAlan Cox */ 2397669a6db1SAlan Cox vstart = termios->c_cc[VSTART]; 2398669a6db1SAlan Cox vstop = termios->c_cc[VSTOP]; 23991da177e4SLinus Torvalds urb_value = (vstop << 8) | (vstart); 24001da177e4SLinus Torvalds 24011da177e4SLinus Torvalds if (usb_control_msg(dev, 24021da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 24031da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 24041da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 24051da177e4SLinus Torvalds urb_value , (FTDI_SIO_XON_XOFF_HS 24061da177e4SLinus Torvalds | priv->interface), 240766e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2408194343d9SGreg Kroah-Hartman dev_err(&port->dev, "urb failed to set to " 2409194343d9SGreg Kroah-Hartman "xon/xoff flow control\n"); 24101da177e4SLinus Torvalds } 24111da177e4SLinus Torvalds } else { 2412464cbb24SAlan Cox /* else clause to only run if cflag ! CRTSCTS and iflag 2413464cbb24SAlan Cox * ! XOFF. CHECKME Assuming XON/XOFF handled by tty 2414464cbb24SAlan Cox * stack - not by device */ 2415bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Turning off hardware flow control\n", __func__); 24161da177e4SLinus Torvalds if (usb_control_msg(dev, 24171da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 24181da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 24191da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 24201da177e4SLinus Torvalds 0, priv->interface, 242166e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2422bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to clear flow control\n"); 24231da177e4SLinus Torvalds } 24241da177e4SLinus Torvalds } 24251da177e4SLinus Torvalds } 242695da310eSAlan Cox } 24271da177e4SLinus Torvalds 2428a4afff6bSJohan Hovold /* 2429a4afff6bSJohan Hovold * Get modem-control status. 2430a4afff6bSJohan Hovold * 2431a4afff6bSJohan Hovold * Returns the number of status bytes retrieved (device dependant), or 2432a4afff6bSJohan Hovold * negative error code. 2433a4afff6bSJohan Hovold */ 2434c4133648SJohan Hovold static int ftdi_get_modem_status(struct usb_serial_port *port, 2435a4afff6bSJohan Hovold unsigned char status[2]) 24361da177e4SLinus Torvalds { 24371da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 243866e47e60SJohan Hovold unsigned char *buf; 2439a3f8168bSJohan Hovold int len; 24401da177e4SLinus Torvalds int ret; 24411da177e4SLinus Torvalds 244266e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 244366e47e60SJohan Hovold if (!buf) 244466e47e60SJohan Hovold return -ENOMEM; 2445a3f8168bSJohan Hovold /* 2446a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2447a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2448a3f8168bSJohan Hovold */ 24491da177e4SLinus Torvalds switch (priv->chip_type) { 24501da177e4SLinus Torvalds case SIO: 2451a3f8168bSJohan Hovold len = 1; 24521da177e4SLinus Torvalds break; 24531da177e4SLinus Torvalds case FT8U232AM: 24541da177e4SLinus Torvalds case FT232BM: 24551da177e4SLinus Torvalds case FT2232C: 2456ed6e5282SAndrew M. Bishop case FT232RL: 2457094c2e6dSMark Adamson case FT2232H: 2458094c2e6dSMark Adamson case FT4232H: 2459309427b6SUwe Bonnes case FT232H: 2460dc0827c1SJim Paris case FTX: 2461a3f8168bSJohan Hovold len = 2; 24621da177e4SLinus Torvalds break; 24631da177e4SLinus Torvalds default: 246466e47e60SJohan Hovold ret = -EFAULT; 246566e47e60SJohan Hovold goto out; 24661da177e4SLinus Torvalds } 24671da177e4SLinus Torvalds 2468a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2469a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2470a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2471a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2472a3f8168bSJohan Hovold 0, priv->interface, 2473a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 2474427c3a95SJohan Hovold 2475427c3a95SJohan Hovold /* NOTE: We allow short responses and handle that below. */ 2476427c3a95SJohan Hovold if (ret < 1) { 2477a4afff6bSJohan Hovold dev_err(&port->dev, "failed to get modem status: %d\n", ret); 2478427c3a95SJohan Hovold if (ret >= 0) 2479427c3a95SJohan Hovold ret = -EIO; 24802c2ee545SJohan Hovold ret = usb_translate_errors(ret); 2481a3f8168bSJohan Hovold goto out; 24822c2ee545SJohan Hovold } 2483a3f8168bSJohan Hovold 2484a4afff6bSJohan Hovold status[0] = buf[0]; 2485a4afff6bSJohan Hovold if (ret > 1) 2486a4afff6bSJohan Hovold status[1] = buf[1]; 2487a4afff6bSJohan Hovold else 2488a4afff6bSJohan Hovold status[1] = 0; 2489a4afff6bSJohan Hovold 2490a4afff6bSJohan Hovold dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0], 2491a4afff6bSJohan Hovold status[1]); 2492a4afff6bSJohan Hovold out: 2493a4afff6bSJohan Hovold kfree(buf); 2494a4afff6bSJohan Hovold 2495a4afff6bSJohan Hovold return ret; 2496a4afff6bSJohan Hovold } 2497a4afff6bSJohan Hovold 2498a4afff6bSJohan Hovold static int ftdi_tiocmget(struct tty_struct *tty) 2499a4afff6bSJohan Hovold { 2500a4afff6bSJohan Hovold struct usb_serial_port *port = tty->driver_data; 2501a4afff6bSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2502a4afff6bSJohan Hovold unsigned char buf[2]; 2503a4afff6bSJohan Hovold int ret; 2504a4afff6bSJohan Hovold 2505c4133648SJohan Hovold ret = ftdi_get_modem_status(port, buf); 2506a4afff6bSJohan Hovold if (ret < 0) 2507a4afff6bSJohan Hovold return ret; 2508a4afff6bSJohan Hovold 250966e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 25101da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 25111da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 25121da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 25131da177e4SLinus Torvalds priv->last_dtr_rts; 2514a4afff6bSJohan Hovold 251566e47e60SJohan Hovold return ret; 25161da177e4SLinus Torvalds } 25171da177e4SLinus Torvalds 251820b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 251995da310eSAlan Cox unsigned int set, unsigned int clear) 25201da177e4SLinus Torvalds { 252195da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2522a09aa7ddSGreg Kroah-Hartman 252374ede0ffSIan Abbott return update_mctrl(port, set, clear); 25241da177e4SLinus Torvalds } 25251da177e4SLinus Torvalds 252600a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 2527464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 25281da177e4SLinus Torvalds { 252995da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 253059556608SJohan Hovold void __user *argp = (void __user *)arg; 25311da177e4SLinus Torvalds 25321da177e4SLinus Torvalds switch (cmd) { 253359556608SJohan Hovold case TIOCGSERIAL: 253459556608SJohan Hovold return get_serial_info(port, argp); 253559556608SJohan Hovold case TIOCSSERIAL: 253659556608SJohan Hovold return set_serial_info(tty, port, argp); 2537c466cd2bSGreg Kroah-Hartman case TIOCSERGETLSR: 253859556608SJohan Hovold return get_lsr_info(port, argp); 25391da177e4SLinus Torvalds default: 25401da177e4SLinus Torvalds break; 25411da177e4SLinus Torvalds } 25424d5147ecSJohan Hovold 254395da310eSAlan Cox return -ENOIOCTLCMD; 254495da310eSAlan Cox } 25451da177e4SLinus Torvalds 2546e17c1aa2SJohan Hovold module_usb_serial_driver(serial_drivers, id_table_combined); 25471da177e4SLinus Torvalds 25481da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 25491da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 25501da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 25511da177e4SLinus Torvalds 2552b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2553b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2554