11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * USB FTDI SIO driver 31da177e4SLinus Torvalds * 4d3901a06SJohan Hovold * Copyright (C) 2009 - 2010 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/init.h> 371da177e4SLinus Torvalds #include <linux/slab.h> 381da177e4SLinus Torvalds #include <linux/tty.h> 391da177e4SLinus Torvalds #include <linux/tty_driver.h> 401da177e4SLinus Torvalds #include <linux/tty_flip.h> 411da177e4SLinus Torvalds #include <linux/module.h> 421da177e4SLinus Torvalds #include <linux/spinlock.h> 43bd09a9f5SAlessio Igor Bogani #include <linux/mutex.h> 44464cbb24SAlan Cox #include <linux/uaccess.h> 451da177e4SLinus Torvalds #include <linux/usb.h> 461da177e4SLinus Torvalds #include <linux/serial.h> 47a969888cSGreg Kroah-Hartman #include <linux/usb/serial.h> 481da177e4SLinus Torvalds #include "ftdi_sio.h" 4931844d55SAndreas Mohr #include "ftdi_sio_ids.h" 501da177e4SLinus Torvalds 51d3901a06SJohan 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>" 521da177e4SLinus Torvalds #define DRIVER_DESC "USB FTDI Serial Converters Driver" 531da177e4SLinus Torvalds 54fdcb0a0fSIan Abbott static __u16 vendor = FTDI_VID; 55fdcb0a0fSIan Abbott static __u16 product; 561da177e4SLinus Torvalds 570ffbbe25SOliver Neukum struct ftdi_private { 583bb36aa2SGreg Kroah-Hartman enum ftdi_chip_type chip_type; 59464cbb24SAlan Cox /* type of device, either SIO or FT8U232AM */ 600ffbbe25SOliver Neukum int baud_base; /* baud base clock for divisor setting */ 61464cbb24SAlan Cox int custom_divisor; /* custom_divisor kludge, this is for 62464cbb24SAlan Cox baud_base (different from what goes to the 63464cbb24SAlan Cox chip!) */ 640ffbbe25SOliver Neukum __u16 last_set_data_urb_value ; 65464cbb24SAlan Cox /* the last data state set - needed for doing 66464cbb24SAlan Cox * a break 67464cbb24SAlan Cox */ 680ffbbe25SOliver Neukum int flags; /* some ASYNC_xxxx flags are supported */ 690ffbbe25SOliver Neukum unsigned long last_dtr_rts; /* saved modem control outputs */ 70fca5430dSSimon Arlott char prev_status; /* Used for TIOCMIWAIT */ 71c466cd2bSGreg Kroah-Hartman char transmit_empty; /* If transmitter is empty or not */ 72094c2e6dSMark Adamson __u16 interface; /* FT2232C, FT2232H or FT4232H port interface 73094c2e6dSMark Adamson (0 for FT232/245) */ 740ffbbe25SOliver Neukum 75464cbb24SAlan Cox speed_t force_baud; /* if non-zero, force the baud rate to 76464cbb24SAlan Cox this value */ 77464cbb24SAlan Cox int force_rtscts; /* if non-zero, force RTS-CTS to always 78464cbb24SAlan Cox be enabled */ 790ffbbe25SOliver Neukum 80557aaa7fSAlan Cox unsigned int latency; /* latency setting in use */ 81895f28baSMark Adamson unsigned short max_packet_size; 829c67d28eSAlessio Igor Bogani struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ 830ffbbe25SOliver Neukum }; 840ffbbe25SOliver Neukum 858f977e42SIan Abbott /* struct ftdi_sio_quirk is used by devices requiring special attention. */ 868f977e42SIan Abbott struct ftdi_sio_quirk { 87fa91d43bSTony Lindgren int (*probe)(struct usb_serial *); 88464cbb24SAlan Cox /* Special settings for probed ports. */ 89464cbb24SAlan Cox void (*port_probe)(struct ftdi_private *); 908f977e42SIan Abbott }; 918f977e42SIan Abbott 9220734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial); 93546d7eecSKevin Vance static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); 94b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial); 956ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial); 96c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial); 970ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 980ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 998f977e42SIan Abbott 10020734345SHarald Welte static struct ftdi_sio_quirk ftdi_jtag_quirk = { 10120734345SHarald Welte .probe = ftdi_jtag_probe, 102fa91d43bSTony Lindgren }; 103fa91d43bSTony Lindgren 104546d7eecSKevin Vance static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = { 105546d7eecSKevin Vance .probe = ftdi_mtxorb_hack_setup, 106546d7eecSKevin Vance }; 107546d7eecSKevin Vance 108b760dac2SMartin Geleynse static struct ftdi_sio_quirk ftdi_NDI_device_quirk = { 109b760dac2SMartin Geleynse .probe = ftdi_NDI_device_setup, 110b760dac2SMartin Geleynse }; 111b760dac2SMartin Geleynse 1128f977e42SIan Abbott static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 1130ffbbe25SOliver Neukum .port_probe = ftdi_USB_UIRT_setup, 1148f977e42SIan Abbott }; 1158f977e42SIan Abbott 1168f977e42SIan Abbott static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { 1170ffbbe25SOliver Neukum .port_probe = ftdi_HE_TIRA1_setup, 1181da177e4SLinus Torvalds }; 1191da177e4SLinus Torvalds 1206ec2f46cSJean-Christophe PLAGNIOL-VILLARD static struct ftdi_sio_quirk ftdi_stmclite_quirk = { 1216ec2f46cSJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_stmclite_probe, 1226ec2f46cSJean-Christophe PLAGNIOL-VILLARD }; 1236ec2f46cSJean-Christophe PLAGNIOL-VILLARD 124c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static struct ftdi_sio_quirk ftdi_8u2232c_quirk = { 125c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .probe = ftdi_8u2232c_probe, 126c96fbdd0SJean-Christophe PLAGNIOL-VILLARD }; 127c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1281da177e4SLinus Torvalds /* 1291da177e4SLinus Torvalds * The 8U232AM has the same API as the sio except for: 1301da177e4SLinus Torvalds * - it can support MUCH higher baudrates; up to: 1311da177e4SLinus Torvalds * o 921600 for RS232 and 2000000 for RS422/485 at 48MHz 1321da177e4SLinus Torvalds * o 230400 at 12MHz 1331da177e4SLinus Torvalds * so .. 8U232AM's baudrate setting codes are different 1341da177e4SLinus Torvalds * - it has a two byte status code. 1351da177e4SLinus Torvalds * - it returns characters every 16ms (the FTDI does it every 40ms) 1361da177e4SLinus Torvalds * 1371da177e4SLinus Torvalds * the bcdDevice value is used to differentiate FT232BM and FT245BM from 1381da177e4SLinus Torvalds * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 1391da177e4SLinus Torvalds * combinations in both tables. 1408f977e42SIan Abbott * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices, 1418f977e42SIan Abbott * but I don't know if those ever went into mass production. [Ian Abbott] 1421da177e4SLinus Torvalds */ 1431da177e4SLinus Torvalds 1441da177e4SLinus Torvalds 1451da177e4SLinus Torvalds 14665e1ec67SAndreas Mohr /* 14765e1ec67SAndreas Mohr * Device ID not listed? Test via module params product/vendor or 14865e1ec67SAndreas Mohr * /sys/bus/usb/ftdi_sio/new_id, then send patch/report! 14965e1ec67SAndreas Mohr */ 1501da177e4SLinus Torvalds static struct usb_device_id id_table_combined [] = { 151ce7e9065SArtur Zimmer { USB_DEVICE(FTDI_VID, FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID) }, 1525a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) }, 1535a9443f0SChristian Simon { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) }, 1542011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 1552011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 15601ba0856SAndrew Ewert { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 15765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 1586e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, 1596e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, 1606e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, 1616e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) }, 1626e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) }, 1636e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, 1646e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, 1656e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, 166b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, 167b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, 168b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, 16972a9f958SRazvan Gavril { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 1701da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 17169737dfaSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 172d099321bSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, 173fad14a0dSFrank Sievertsen { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, 1741da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 1751da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 1761da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 177d8b21606SGard Spreemann { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, 178c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) , 179c96fbdd0SJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk }, 180094c2e6dSMark Adamson { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 181309427b6SUwe Bonnes { USB_DEVICE(FTDI_VID, FTDI_232H_PID) }, 182dc0827c1SJim Paris { USB_DEVICE(FTDI_VID, FTDI_FTX_PID) }, 183c0f8d561SChristophe Mariac { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 1841da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 1852adb80e9SGuido Scholz { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, 186ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) }, 187ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 188ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 18999c1e4f8SRainer Keller { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, 190d7e14b37SMartin Teichmann { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) }, 1911da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 1921da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 193f2ee6955SAlan Cox { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 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) }, 256ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID), 257546d7eecSKevin Vance .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 258ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 259ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 260ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 261ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 262ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID), 263ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 264ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 265ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 266ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, 267ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0130_PID) }, 268ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0131_PID) }, 269ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0132_PID) }, 270ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0133_PID) }, 271ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0134_PID) }, 272ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0135_PID) }, 273ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0136_PID) }, 274ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0137_PID) }, 275ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0138_PID) }, 276ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0139_PID) }, 277ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013A_PID) }, 278ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013B_PID) }, 279ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013C_PID) }, 280ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013D_PID) }, 281ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013E_PID) }, 282ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013F_PID) }, 283ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0140_PID) }, 284ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0141_PID) }, 285ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0142_PID) }, 286ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0143_PID) }, 287ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0144_PID) }, 288ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0145_PID) }, 289ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0146_PID) }, 290ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0147_PID) }, 291ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0148_PID) }, 292ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0149_PID) }, 293ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014A_PID) }, 294ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014B_PID) }, 295ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014C_PID) }, 296ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014D_PID) }, 297ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014E_PID) }, 298ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014F_PID) }, 299ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 300ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 301ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 302ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID), 303ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 304ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID), 305ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 306ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID), 307ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 308ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID), 309ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 310ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID), 311ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 312ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID), 313ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 314ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 315ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 316ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, 317ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015C_PID) }, 318ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015D_PID) }, 319ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015E_PID) }, 320ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015F_PID) }, 321ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0160_PID) }, 322ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0161_PID) }, 323ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0162_PID) }, 324ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0163_PID) }, 325ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0164_PID) }, 326ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0165_PID) }, 327ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0166_PID) }, 328ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0167_PID) }, 329ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0168_PID) }, 330ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0169_PID) }, 331ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016A_PID) }, 332ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016B_PID) }, 333ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016C_PID) }, 334ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016D_PID) }, 335ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016E_PID) }, 336ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016F_PID) }, 337ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0170_PID) }, 338ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0171_PID) }, 339ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0172_PID) }, 340ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0173_PID) }, 341ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0174_PID) }, 342ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0175_PID) }, 343ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0176_PID) }, 344ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0177_PID) }, 345ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0178_PID) }, 346ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0179_PID) }, 347ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017A_PID) }, 348ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017B_PID) }, 349ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017C_PID) }, 350ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017D_PID) }, 351ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017E_PID) }, 352ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017F_PID) }, 353ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0180_PID) }, 354ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0181_PID) }, 355ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0182_PID) }, 356ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0183_PID) }, 357ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0184_PID) }, 358ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0185_PID) }, 359ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0186_PID) }, 360ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0187_PID) }, 361ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0188_PID) }, 362ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0189_PID) }, 363ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018A_PID) }, 364ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018B_PID) }, 365ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018C_PID) }, 366ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018D_PID) }, 367ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018E_PID) }, 368ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018F_PID) }, 369ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0190_PID) }, 370ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0191_PID) }, 371ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0192_PID) }, 372ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0193_PID) }, 373ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0194_PID) }, 374ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0195_PID) }, 375ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0196_PID) }, 376ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0197_PID) }, 377ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0198_PID) }, 378ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0199_PID) }, 379ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019A_PID) }, 380ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019B_PID) }, 381ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019C_PID) }, 382ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019D_PID) }, 383ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019E_PID) }, 384ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019F_PID) }, 385ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A0_PID) }, 386ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A1_PID) }, 387ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A2_PID) }, 388ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A3_PID) }, 389ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A4_PID) }, 390ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A5_PID) }, 391ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A6_PID) }, 392ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A7_PID) }, 393ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A8_PID) }, 394ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A9_PID) }, 395ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AA_PID) }, 396ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AB_PID) }, 397ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AC_PID) }, 398ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AD_PID) }, 399ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AE_PID) }, 400ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AF_PID) }, 401ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B0_PID) }, 402ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B1_PID) }, 403ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B2_PID) }, 404ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B3_PID) }, 405ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B4_PID) }, 406ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B5_PID) }, 407ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B6_PID) }, 408ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B7_PID) }, 409ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B8_PID) }, 410ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B9_PID) }, 411ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BA_PID) }, 412ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BB_PID) }, 413ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BC_PID) }, 414ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BD_PID) }, 415ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BE_PID) }, 416ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BF_PID) }, 417ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C0_PID) }, 418ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C1_PID) }, 419ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C2_PID) }, 420ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C3_PID) }, 421ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C4_PID) }, 422ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C5_PID) }, 423ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C6_PID) }, 424ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C7_PID) }, 425ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C8_PID) }, 426ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C9_PID) }, 427ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CA_PID) }, 428ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CB_PID) }, 429ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CC_PID) }, 430ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CD_PID) }, 431ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CE_PID) }, 432ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CF_PID) }, 433ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D0_PID) }, 434ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D1_PID) }, 435ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D2_PID) }, 436ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D3_PID) }, 437ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D4_PID) }, 438ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D5_PID) }, 439ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D6_PID) }, 440ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D7_PID) }, 441ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D8_PID) }, 442ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D9_PID) }, 443ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DA_PID) }, 444ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DB_PID) }, 445ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DC_PID) }, 446ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DD_PID) }, 447ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DE_PID) }, 448ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DF_PID) }, 449ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E0_PID) }, 450ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E1_PID) }, 451ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E2_PID) }, 452ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E3_PID) }, 453ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E4_PID) }, 454ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E5_PID) }, 455ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E6_PID) }, 456ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E7_PID) }, 457ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E8_PID) }, 458ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E9_PID) }, 459ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EA_PID) }, 460ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EB_PID) }, 461ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EC_PID) }, 462ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01ED_PID) }, 463ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EE_PID) }, 464ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EF_PID) }, 465ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F0_PID) }, 466ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F1_PID) }, 467ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F2_PID) }, 468ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F3_PID) }, 469ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F4_PID) }, 470ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F5_PID) }, 471ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F6_PID) }, 472ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F7_PID) }, 473ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F8_PID) }, 474ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F9_PID) }, 475ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FA_PID) }, 476ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FB_PID) }, 477ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FC_PID) }, 478ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 479ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 480ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 4818f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 4821da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 483274a4bbcSDave Platt { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 484868e440dSJelle Foks { USB_DEVICE(FTDI_VID, FTDI_USBX_707_PID) }, 4851da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 4861da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 4871da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 4881da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, 489a1484827SJustin Carlson { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, 4901da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, 4911da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, 4921da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, 4931da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_2_PID) }, 4941da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_1_PID) }, 4951da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_2_PID) }, 4961da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_1_PID) }, 4971da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_2_PID) }, 4981da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_3_PID) }, 4991da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_4_PID) }, 5001da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_1_PID) }, 5011da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_2_PID) }, 5021da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_3_PID) }, 5031da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_4_PID) }, 5041da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_1_PID) }, 5051da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_2_PID) }, 5061da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_3_PID) }, 5071da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_4_PID) }, 5081da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_1_PID) }, 5091da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_2_PID) }, 5101da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_3_PID) }, 5111da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_4_PID) }, 5121da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_5_PID) }, 5131da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_6_PID) }, 5141da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_7_PID) }, 5151da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_8_PID) }, 5161da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_1_PID) }, 5171da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_2_PID) }, 5181da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_3_PID) }, 5191da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_4_PID) }, 5201da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_5_PID) }, 5211da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_6_PID) }, 5221da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_7_PID) }, 5231da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_8_PID) }, 5241da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_1_PID) }, 5251da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_2_PID) }, 5261da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_3_PID) }, 5271da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_4_PID) }, 5281da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_5_PID) }, 5291da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) }, 5301da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) }, 5311da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 5326d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_1_PID) }, 5336d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_2_PID) }, 5346d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_3_PID) }, 5356d161b99SScott Dial { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803R_4_PID) }, 5361da177e4SLinus Torvalds { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 5371da177e4SLinus Torvalds { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 53811a31d84SJohan Hovold { USB_DEVICE(OCT_VID, OCT_DK201_PID) }, 5398f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID), 5408f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk }, 5418f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID), 5428f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk }, 5431da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 5441da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 5451da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 5461da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 5478f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) }, 5488f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) }, 5498f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) }, 5508f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) }, 5518f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) }, 5528f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) }, 5538f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) }, 5548f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) }, 5558f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) }, 5568f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) }, 5578f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) }, 5588f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) }, 5598f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) }, 5608f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) }, 5618f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) }, 5628f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) }, 5631da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 56447900743SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 565e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UR100_PID) }, 566e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 567207c47e1SThomas Riewe { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 568bde62185SMartin Hagelin { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 5694eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, 5704eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, 5714eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, 5724eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, 5734eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, 5744eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, 5754eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, 5764eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, 57737909fe5SBenedek László { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) }, 57854575b05SAntonio Ospite { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID), 57954575b05SAntonio Ospite .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 580e6ac4a40SIan Abbott /* 58165e1ec67SAndreas Mohr * ELV devices: 582e6ac4a40SIan Abbott */ 583c249f911SSven Killig { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, 58465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 58565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 58665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, 58765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) }, 58865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) }, 58965e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) }, 59065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) }, 59165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) }, 59242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) }, 59342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) }, 59442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) }, 59542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDF77_PID) }, 59642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UIO88_PID) }, 59742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UAD8_PID) }, 59842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDA7_PID) }, 59942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_USI2_PID) }, 60042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_T1100_PID) }, 60142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCD200_PID) }, 60242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_ULA200_PID) }, 60342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CSI8_PID) }, 60442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1000DL_PID) }, 60542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) }, 60642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) }, 60742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, 60865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) }, 60942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, 61065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) }, 61142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, 6124ae897dfSSven Andersen { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, 61342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, 614b5894a50SAndré Schenk { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) }, 61565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) }, 61665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) }, 61765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) }, 61865e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) }, 6198f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, 6208f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, 6218f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) }, 6228f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) }, 6238f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) }, 6241da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 6251da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 626ec434e9bSJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 6279d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) }, 6289d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) }, 6299d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) }, 6301da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 6311da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 6321da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 6331da177e4SLinus Torvalds { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 634e6ac4a40SIan Abbott { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 6351da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 636c3d36c45SVladimir Vukicevic { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, 637ef31fec0SMichael Olberg { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, 6386f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 63928fe2eb0SMichael Williamson { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, 64046b72d78SDaniel Sangorrin { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, 6411da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 6421da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 6431da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, 644a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) }, 645a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) }, 646a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) }, 647a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) }, 648a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) }, 649a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) }, 650a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) }, 651a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) }, 652a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) }, 653a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) }, 654a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) }, 655a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) }, 656a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) }, 657a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) }, 6581da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 6596f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 6606f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 661a26d31ceSSteffen Sledz { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) }, 662e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 663e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 664e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 665e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_3_PID) }, 666e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_4_PID) }, 667e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 668e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 669e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 6700ba3b2ccSPetr Kubánek { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, 6716f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 6728f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 67334d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 67434d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 6759b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 6769b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 67734d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 67834d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 67934d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 68034d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 681740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 682740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 6839b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 684c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 685c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 686c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 687c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 68809c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 689c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 69009c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 69134910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 692b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 693b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 694effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 695641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 6967e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 697a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 698a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 699ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 700cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 7017e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 70226a538b9SHorst Schirmeier { USB_DEVICE(FTDI_VID, FTDI_NZR_SEM_USB_PID) }, 703a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, 704a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, 705a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, 706a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, 707a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, 708a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, 709a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, 710a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, 711a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, 712a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, 713a9d61bc4SPieter Maes { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, 71420a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 715eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 71648437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 717e1979fefSColin Leroy { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, 718eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 7199978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 7209978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 7219978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 72240c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 723b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 724b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 725b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 726b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 727b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 728b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 729b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 730b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 731b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 732b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 733822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 734fcc6cb78SCorey Minyard { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, 73528942bb6SMichael Stuermer { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, 736e00a54d7SEvan McNabb { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, 737762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 738a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 739d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 7404bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 74111171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 742307369b0SMarcin Kościelnicki { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 743fa91d43bSTony Lindgren { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 74420734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 745b88ccf6fSJF Argentino { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), 746b88ccf6fSJF Argentino .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 74720734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 74820734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 74920734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 75020734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 751a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 752a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 753a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 754a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 7553687f641SPeter Stuge { USB_DEVICE(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID), 7563687f641SPeter Stuge .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 75714511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 75814511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 75926ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 7602542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 76159c6ccd9SDaniel Suchy 76259c6ccd9SDaniel Suchy /* Papouch devices based on FTDI chip */ 76359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) }, 76459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) }, 76559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) }, 76659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) }, 76759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) }, 76859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) }, 76959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) }, 77059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) }, 77159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) }, 77259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) }, 77359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 77459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) }, 77559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) }, 77659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) }, 777a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 77859c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) }, 77959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) }, 78059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) }, 78159c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) }, 78259c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) }, 78359c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) }, 78459c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) }, 78559c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) }, 78659c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) }, 78759c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) }, 788a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 78959c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) }, 79059c6ccd9SDaniel Suchy { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) }, 79159c6ccd9SDaniel Suchy 79296285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 79396285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 79445eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 795ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 7967f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 7977f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 7987f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 799b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 800b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 80111eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 80211eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 803f08dea73SBjørn Mork { USB_DEVICE_AND_INTERFACE_INFO(MICROCHIP_VID, MICROCHIP_USB_BOARD_PID, 804f08dea73SBjørn Mork USB_CLASS_VENDOR_SPEC, 805f08dea73SBjørn Mork USB_SUBCLASS_VENDOR_SPEC, 0x00) }, 806ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 8071002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 8081002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 809d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 810fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 811dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C865_PID) }, 812dafc4f7bSÉric Piel { USB_DEVICE(FTDI_VID, PI_C857_PID) }, 813dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C866_PID) }, 814dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C663_PID) }, 815dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C725_PID) }, 816dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E517_PID) }, 817dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C863_PID) }, 818b69cc672SÉric Piel { USB_DEVICE(PI_VID, PI_E861_PID) }, 819dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_C867_PID) }, 820dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E609_PID) }, 821dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_E709_PID) }, 822dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_100F_PID) }, 823dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1011_PID) }, 824dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1012_PID) }, 825dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1013_PID) }, 826dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1014_PID) }, 827dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1015_PID) }, 828dafc4f7bSÉric Piel { USB_DEVICE(PI_VID, PI_1016_PID) }, 8297724a1edSOzan Çağlayan { USB_DEVICE(KONDO_VID, KONDO_USB_SERIAL_PID) }, 830c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 83150d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 83250d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 83355f13aeaSPeter Korsgaard { USB_DEVICE(FTDI_VID, TI_XDS100V2_PID), 83455f13aeaSPeter Korsgaard .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 835e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 836c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) }, 837c53c2fabSPaul Friedrich { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) }, 838e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 8399714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 8409714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 8419714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 8429714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 84377dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 84477dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 84577dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 84677dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 84777dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 84877dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 84977dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 85077dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 851afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 8523126d823SRich Mattes { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) }, 853666cc076SMartin Michlmayr { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), 854666cc076SMartin Michlmayr .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 85565737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, 85665737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, 85765737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, 85865737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, 85965737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, 86065737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, 86165737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, 86265737388SLuke Lowrey { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, 8630f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) }, 8640f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, 8650f266abdSGreg Kroah-Hartman { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, 86690451e69SMilan Kocian { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, 8675363cdc3SFlorian Faber { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, 8687fea0f71SSebastien Bourdeauducq { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), 8697fea0f71SSebastien Bourdeauducq .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 8706ec2f46cSJean-Christophe PLAGNIOL-VILLARD { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), 8716ec2f46cSJean-Christophe PLAGNIOL-VILLARD .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, 872fc216ec3SPeter Naulls { USB_DEVICE(FTDI_VID, FTDI_RF_R106) }, 87347594d55SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 87447594d55SMichał Wróbel .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 87557e596f3SMichał Wróbel { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 8768cf65dc3STomasz Mloduchowski /* Crucible Devices */ 8778cf65dc3STomasz Mloduchowski { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 878fdcb0a0fSIan Abbott { }, /* Optional parameter entry */ 8791da177e4SLinus Torvalds { } /* Terminating entry */ 8801da177e4SLinus Torvalds }; 8811da177e4SLinus Torvalds 8821da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 8831da177e4SLinus Torvalds 8844c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 8851da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 8861da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 8871da177e4SLinus Torvalds [FT232BM] = "FT232BM", 8881da177e4SLinus Torvalds [FT2232C] = "FT2232C", 889d8b21606SGard Spreemann [FT232RL] = "FT232RL", 890094c2e6dSMark Adamson [FT2232H] = "FT2232H", 891309427b6SUwe Bonnes [FT4232H] = "FT4232H", 892dc0827c1SJim Paris [FT232H] = "FT232H", 893dc0827c1SJim Paris [FTX] = "FT-X" 8941da177e4SLinus Torvalds }; 8951da177e4SLinus Torvalds 8961da177e4SLinus Torvalds 8971da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 8981da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 8991da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 9001da177e4SLinus Torvalds /* End TIOCMIWAIT */ 9011da177e4SLinus Torvalds 9021da177e4SLinus Torvalds #define FTDI_IMPL_ASYNC_FLAGS = (ASYNC_SPD_HI | ASYNC_SPD_VHI \ 903bbc5d276SRoel Kluin | ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP) 9041da177e4SLinus Torvalds 9051da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 906464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 907464cbb24SAlan Cox const struct usb_device_id *id); 90812bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 90912bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 910a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 911335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 9121b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 913d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 914c23e5fc1SJohan Hovold void *dest, size_t size); 915464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 916464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 91760b33c13SAlan Cox static int ftdi_tiocmget(struct tty_struct *tty); 91820b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 919464cbb24SAlan Cox unsigned int set, unsigned int clear); 920c75ccd48SUwe Bonnes static int ftdi_get_icount(struct tty_struct *tty, 921c75ccd48SUwe Bonnes struct serial_icounter_struct *icount); 92200a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 923464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 92495da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 9256f602912SJarkko Huijts static int ftdi_chars_in_buffer(struct tty_struct *tty); 9265fb0432eSJohan Hovold static int ftdi_get_modem_status(struct tty_struct *tty, 9275fb0432eSJohan Hovold unsigned char status[2]); 9281da177e4SLinus Torvalds 9291da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 9301da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 9311da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 9321da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud); 933094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 934094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud); 9351da177e4SLinus Torvalds 936ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 93718fcac35SGreg Kroah-Hartman .driver = { 9381da177e4SLinus Torvalds .owner = THIS_MODULE, 939269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 94018fcac35SGreg Kroah-Hartman }, 941269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 9428f977e42SIan Abbott .id_table = id_table_combined, 9431da177e4SLinus Torvalds .num_ports = 1, 944bbcb2b90SJohan Hovold .bulk_in_size = 512, 945c23e5fc1SJohan Hovold .bulk_out_size = 256, 9468f977e42SIan Abbott .probe = ftdi_sio_probe, 94712bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 94812bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 9491da177e4SLinus Torvalds .open = ftdi_open, 950335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 9511b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 9521b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 9531b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 954d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 9551da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 9561da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 957c75ccd48SUwe Bonnes .get_icount = ftdi_get_icount, 9581da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 9591da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 9601da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 9616f602912SJarkko Huijts .chars_in_buffer = ftdi_chars_in_buffer, 9621da177e4SLinus Torvalds }; 9631da177e4SLinus Torvalds 96497b6b6d2SAlan Stern static struct usb_serial_driver * const serial_drivers[] = { 96597b6b6d2SAlan Stern &ftdi_sio_device, NULL 96697b6b6d2SAlan Stern }; 96797b6b6d2SAlan Stern 9681da177e4SLinus Torvalds 9691da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 970279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 9711da177e4SLinus Torvalds 9721da177e4SLinus Torvalds /* High and low are for DTR, RTS etc etc */ 9731da177e4SLinus Torvalds #define HIGH 1 9741da177e4SLinus Torvalds #define LOW 0 9751da177e4SLinus Torvalds 9761da177e4SLinus Torvalds /* 9771da177e4SLinus Torvalds * *************************************************************************** 978fa91d43bSTony Lindgren * Utility functions 9791da177e4SLinus Torvalds * *************************************************************************** 9801da177e4SLinus Torvalds */ 9811da177e4SLinus Torvalds 9821da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 9831da177e4SLinus Torvalds { 9841da177e4SLinus Torvalds unsigned short int divisor; 985464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 986464cbb24SAlan Cox int divisor3 = base / 2 / baud; 987464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 988464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 9891da177e4SLinus Torvalds divisor = divisor3 >> 3; 9901da177e4SLinus Torvalds divisor3 &= 0x7; 991464cbb24SAlan Cox if (divisor3 == 1) 992464cbb24SAlan Cox divisor |= 0xc000; 993464cbb24SAlan Cox else if (divisor3 >= 4) 994464cbb24SAlan Cox divisor |= 0x4000; 995464cbb24SAlan Cox else if (divisor3 != 0) 996464cbb24SAlan Cox divisor |= 0x8000; 997464cbb24SAlan Cox else if (divisor == 1) 998464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 9991da177e4SLinus Torvalds return divisor; 10001da177e4SLinus Torvalds } 10011da177e4SLinus Torvalds 10021da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 10031da177e4SLinus Torvalds { 1004464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 10051da177e4SLinus Torvalds } 10061da177e4SLinus Torvalds 10071da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 10081da177e4SLinus Torvalds { 10091da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 10101da177e4SLinus Torvalds __u32 divisor; 1011464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 1012464cbb24SAlan Cox int divisor3 = base / 2 / baud; 10131da177e4SLinus Torvalds divisor = divisor3 >> 3; 10141da177e4SLinus Torvalds divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 10151da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 1016464cbb24SAlan Cox if (divisor == 1) 1017464cbb24SAlan Cox divisor = 0; 1018464cbb24SAlan Cox else if (divisor == 0x4001) 1019464cbb24SAlan Cox divisor = 1; 10201da177e4SLinus Torvalds return divisor; 10211da177e4SLinus Torvalds } 10221da177e4SLinus Torvalds 10231da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud) 10241da177e4SLinus Torvalds { 1025464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 10261da177e4SLinus Torvalds } 10271da177e4SLinus Torvalds 1028094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 1029094c2e6dSMark Adamson { 1030094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 1031094c2e6dSMark Adamson __u32 divisor; 1032094c2e6dSMark Adamson int divisor3; 1033094c2e6dSMark Adamson 1034094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 1035f6c259a3SDaniel Glöckner divisor3 = base * 8 / (baud * 10); 1036094c2e6dSMark Adamson 1037094c2e6dSMark Adamson divisor = divisor3 >> 3; 1038094c2e6dSMark Adamson divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 1039094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 1040094c2e6dSMark Adamson if (divisor == 1) 1041094c2e6dSMark Adamson divisor = 0; 1042094c2e6dSMark Adamson else if (divisor == 0x4001) 1043094c2e6dSMark Adamson divisor = 1; 1044094c2e6dSMark Adamson /* 1045094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 1046094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 1047094c2e6dSMark Adamson * baud with this bit set 1048094c2e6dSMark Adamson */ 1049094c2e6dSMark Adamson divisor |= 0x00020000; 1050094c2e6dSMark Adamson return divisor; 1051094c2e6dSMark Adamson } 1052094c2e6dSMark Adamson 1053094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud) 1054094c2e6dSMark Adamson { 1055094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 1056094c2e6dSMark Adamson } 1057094c2e6dSMark Adamson 105874ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 105974ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 106074ede0ffSIan Abbott 1061464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 1062464cbb24SAlan Cox unsigned int clear) 10631da177e4SLinus Torvalds { 10641da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1065bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 106674ede0ffSIan Abbott unsigned urb_value; 10671da177e4SLinus Torvalds int rv; 10681da177e4SLinus Torvalds 106974ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 1070bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); 107174ede0ffSIan Abbott return 0; /* no change */ 10721da177e4SLinus Torvalds } 107374ede0ffSIan Abbott 107474ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 107574ede0ffSIan Abbott urb_value = 0; 107674ede0ffSIan Abbott if (clear & TIOCM_DTR) 107774ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_LOW; 107874ede0ffSIan Abbott if (clear & TIOCM_RTS) 107974ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_LOW; 108074ede0ffSIan Abbott if (set & TIOCM_DTR) 108174ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_HIGH; 108274ede0ffSIan Abbott if (set & TIOCM_RTS) 108374ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_HIGH; 10841da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 10851da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 10861da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 10871da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 108874ede0ffSIan Abbott urb_value, priv->interface, 108966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 109074ede0ffSIan Abbott if (rv < 0) { 1091bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", 1092441b62c1SHarvey Harrison __func__, 1093bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1094bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 10952c2ee545SJohan Hovold rv = usb_translate_errors(rv); 10961da177e4SLinus Torvalds } else { 1097bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1098bfc51614SGreg Kroah-Hartman (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1099bfc51614SGreg Kroah-Hartman (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 11009b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 110174ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 11021da177e4SLinus Torvalds } 11031da177e4SLinus Torvalds return rv; 11041da177e4SLinus Torvalds } 11051da177e4SLinus Torvalds 11061da177e4SLinus Torvalds 1107464cbb24SAlan Cox static __u32 get_ftdi_divisor(struct tty_struct *tty, 1108464cbb24SAlan Cox struct usb_serial_port *port) 1109e49bbce1SJohan Hovold { 11101da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1111bfc51614SGreg Kroah-Hartman struct device *dev = &port->dev; 11121da177e4SLinus Torvalds __u32 div_value = 0; 11131da177e4SLinus Torvalds int div_okay = 1; 11141da177e4SLinus Torvalds int baud; 11151da177e4SLinus Torvalds 11161da177e4SLinus Torvalds /* 1117464cbb24SAlan Cox * The logic involved in setting the baudrate can be cleanly split into 1118464cbb24SAlan Cox * 3 steps. 11191da177e4SLinus Torvalds * 1. Standard baud rates are set in tty->termios->c_cflag 1120464cbb24SAlan Cox * 2. If these are not enough, you can set any speed using alt_speed as 1121464cbb24SAlan Cox * follows: 11221da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 11231da177e4SLinus Torvalds * - set your real speed in tty->alt_speed; it gets ignored when 11241da177e4SLinus Torvalds * alt_speed==0, (or) 1125464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1126464cbb24SAlan Cox * follows: 1127464cbb24SAlan Cox * flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], 1128464cbb24SAlan Cox * this just sets alt_speed to (HI: 57600, VHI: 115200, 1129464cbb24SAlan Cox * SHI: 230400, WARP: 460800) 11301da177e4SLinus Torvalds * ** Steps 1, 2 are done courtesy of tty_get_baud_rate 11311da177e4SLinus Torvalds * 3. You can also set baud rate by setting custom divisor as follows 11321da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 1133464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1134464cbb24SAlan Cox * follows: 11351da177e4SLinus Torvalds * o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST 11361da177e4SLinus Torvalds * o custom_divisor set to baud_base / your_new_baudrate 1137464cbb24SAlan Cox * ** Step 3 is done courtesy of code borrowed from serial.c 1138464cbb24SAlan Cox * I should really spend some time and separate + move this common 1139464cbb24SAlan Cox * code to serial.c, it is replicated in nearly every serial driver 1140464cbb24SAlan Cox * you see. 11411da177e4SLinus Torvalds */ 11421da177e4SLinus Torvalds 1143464cbb24SAlan Cox /* 1. Get the baud rate from the tty settings, this observes 1144464cbb24SAlan Cox alt_speed hack */ 11451da177e4SLinus Torvalds 114695da310eSAlan Cox baud = tty_get_baud_rate(tty); 1147bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); 11481da177e4SLinus Torvalds 1149464cbb24SAlan Cox /* 2. Observe async-compatible custom_divisor hack, update baudrate 1150464cbb24SAlan Cox if needed */ 11511da177e4SLinus Torvalds 11521da177e4SLinus Torvalds if (baud == 38400 && 11531da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 11541da177e4SLinus Torvalds (priv->custom_divisor)) { 11551da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1156bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", 1157464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 11581da177e4SLinus Torvalds } 11591da177e4SLinus Torvalds 11601da177e4SLinus Torvalds /* 3. Convert baudrate to device-specific divisor */ 11611da177e4SLinus Torvalds 1162464cbb24SAlan Cox if (!baud) 1163464cbb24SAlan Cox baud = 9600; 11641da177e4SLinus Torvalds switch (priv->chip_type) { 11651da177e4SLinus Torvalds case SIO: /* SIO chip */ 11661da177e4SLinus Torvalds switch (baud) { 11671da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 11681da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 11691da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 11701da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 11711da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 11721da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 11731da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 11741da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 11751da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 11761da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 11771da177e4SLinus Torvalds } /* baud */ 11781da177e4SLinus Torvalds if (div_value == 0) { 1179bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", 1180464cbb24SAlan Cox __func__, baud); 11811da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1182669a6db1SAlan Cox baud = 9600; 11831da177e4SLinus Torvalds div_okay = 0; 11841da177e4SLinus Torvalds } 11851da177e4SLinus Torvalds break; 11861da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 11871da177e4SLinus Torvalds if (baud <= 3000000) { 11881da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 11891da177e4SLinus Torvalds } else { 1190bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1191669a6db1SAlan Cox baud = 9600; 11921da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 11931da177e4SLinus Torvalds div_okay = 0; 11941da177e4SLinus Torvalds } 11951da177e4SLinus Torvalds break; 11961da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 11971da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 1198dc0827c1SJim Paris case FT232RL: /* FT232RL chip */ 1199dc0827c1SJim Paris case FTX: /* FT-X series */ 12001da177e4SLinus Torvalds if (baud <= 3000000) { 1201b760dac2SMartin Geleynse __u16 product_id = le16_to_cpu( 1202b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1203b760dac2SMartin Geleynse if (((FTDI_NDI_HUC_PID == product_id) || 1204b760dac2SMartin Geleynse (FTDI_NDI_SPECTRA_SCU_PID == product_id) || 1205b760dac2SMartin Geleynse (FTDI_NDI_FUTURE_2_PID == product_id) || 1206b760dac2SMartin Geleynse (FTDI_NDI_FUTURE_3_PID == product_id) || 1207b760dac2SMartin Geleynse (FTDI_NDI_AURORA_SCU_PID == product_id)) && 1208b760dac2SMartin Geleynse (baud == 19200)) { 1209b760dac2SMartin Geleynse baud = 1200000; 1210b760dac2SMartin Geleynse } 12111da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 12121da177e4SLinus Torvalds } else { 1213bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 12141da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 12151da177e4SLinus Torvalds div_okay = 0; 1216669a6db1SAlan Cox baud = 9600; 12171da177e4SLinus Torvalds } 12181da177e4SLinus Torvalds break; 1219094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1220094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1221309427b6SUwe Bonnes case FT232H: /* FT232H chip */ 12221862cdd5SIonut Nicu if ((baud <= 12000000) && (baud >= 1200)) { 1223094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1224094c2e6dSMark Adamson } else if (baud < 1200) { 1225094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1226094c2e6dSMark Adamson } else { 1227bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate too high!\n", __func__); 1228094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1229094c2e6dSMark Adamson div_okay = 0; 1230094c2e6dSMark Adamson baud = 9600; 1231094c2e6dSMark Adamson } 1232094c2e6dSMark Adamson break; 12331da177e4SLinus Torvalds } /* priv->chip_type */ 12341da177e4SLinus Torvalds 12351da177e4SLinus Torvalds if (div_okay) { 1236bfc51614SGreg Kroah-Hartman dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", 1237441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 12381da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 12391da177e4SLinus Torvalds } 12401da177e4SLinus Torvalds 124195da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1242464cbb24SAlan Cox return div_value; 12431da177e4SLinus Torvalds } 12441da177e4SLinus Torvalds 124595da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 124695da310eSAlan Cox { 124795da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 124895da310eSAlan Cox __u16 urb_value; 124995da310eSAlan Cox __u16 urb_index; 125095da310eSAlan Cox __u32 urb_index_value; 125195da310eSAlan Cox int rv; 125295da310eSAlan Cox 125395da310eSAlan Cox urb_index_value = get_ftdi_divisor(tty, port); 125495da310eSAlan Cox urb_value = (__u16)urb_index_value; 125595da310eSAlan Cox urb_index = (__u16)(urb_index_value >> 16); 12560ee404ccSUwe Bonnes if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || 12570ee404ccSUwe Bonnes (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { 12580ee404ccSUwe Bonnes /* Probably the BM type needs the MSB of the encoded fractional 12590ee404ccSUwe Bonnes * divider also moved like for the chips above. Any infos? */ 126095da310eSAlan Cox urb_index = (__u16)((urb_index << 8) | priv->interface); 126195da310eSAlan Cox } 126295da310eSAlan Cox 126395da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 126495da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 126595da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 126695da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 126795da310eSAlan Cox urb_value, urb_index, 126866e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 126995da310eSAlan Cox return rv; 127095da310eSAlan Cox } 127195da310eSAlan Cox 1272557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1273557aaa7fSAlan Cox { 1274557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1275557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1276c1284d77SJohan Hovold int rv; 1277557aaa7fSAlan Cox int l = priv->latency; 127895da310eSAlan Cox 1279557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1280557aaa7fSAlan Cox l = 1; 1281557aaa7fSAlan Cox 1282bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); 1283557aaa7fSAlan Cox 1284557aaa7fSAlan Cox rv = usb_control_msg(udev, 1285557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1286557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1287557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1288557aaa7fSAlan Cox l, priv->interface, 128966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1290557aaa7fSAlan Cox if (rv < 0) 1291557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1292557aaa7fSAlan Cox return rv; 1293557aaa7fSAlan Cox } 1294557aaa7fSAlan Cox 1295557aaa7fSAlan Cox static int read_latency_timer(struct usb_serial_port *port) 1296557aaa7fSAlan Cox { 1297557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1298557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 129954f328d0SJohan Hovold unsigned char *buf; 1300c1284d77SJohan Hovold int rv; 1301557aaa7fSAlan Cox 130254f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 130354f328d0SJohan Hovold if (!buf) 130454f328d0SJohan Hovold return -ENOMEM; 130554f328d0SJohan Hovold 1306557aaa7fSAlan Cox rv = usb_control_msg(udev, 1307557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1308557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1309557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1310557aaa7fSAlan Cox 0, priv->interface, 131154f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 13124357369dSJohan Hovold if (rv < 0) 1313557aaa7fSAlan Cox dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 13144357369dSJohan Hovold else 131554f328d0SJohan Hovold priv->latency = buf[0]; 131654f328d0SJohan Hovold 131754f328d0SJohan Hovold kfree(buf); 131854f328d0SJohan Hovold 13198c4f99cdSJohan Hovold return rv; 1320557aaa7fSAlan Cox } 13211da177e4SLinus Torvalds 1322464cbb24SAlan Cox static int get_serial_info(struct usb_serial_port *port, 1323464cbb24SAlan Cox struct serial_struct __user *retinfo) 13241da177e4SLinus Torvalds { 13251da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 13261da177e4SLinus Torvalds struct serial_struct tmp; 13271da177e4SLinus Torvalds 13281da177e4SLinus Torvalds if (!retinfo) 13291da177e4SLinus Torvalds return -EFAULT; 13301da177e4SLinus Torvalds memset(&tmp, 0, sizeof(tmp)); 13311da177e4SLinus Torvalds tmp.flags = priv->flags; 13321da177e4SLinus Torvalds tmp.baud_base = priv->baud_base; 13331da177e4SLinus Torvalds tmp.custom_divisor = priv->custom_divisor; 13341da177e4SLinus Torvalds if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 13351da177e4SLinus Torvalds return -EFAULT; 13361da177e4SLinus Torvalds return 0; 1337e49bbce1SJohan Hovold } 13381da177e4SLinus Torvalds 133995da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 134095da310eSAlan Cox struct usb_serial_port *port, struct serial_struct __user *newinfo) 1341e49bbce1SJohan Hovold { 13421da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 13431da177e4SLinus Torvalds struct serial_struct new_serial; 13441da177e4SLinus Torvalds struct ftdi_private old_priv; 13451da177e4SLinus Torvalds 13461da177e4SLinus Torvalds if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) 13471da177e4SLinus Torvalds return -EFAULT; 13486b447f04SAlan Cox 1349bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 13501da177e4SLinus Torvalds old_priv = *priv; 13511da177e4SLinus Torvalds 13521da177e4SLinus Torvalds /* Do error checking and permission checking */ 13531da177e4SLinus Torvalds 13541da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 13551da177e4SLinus Torvalds if (((new_serial.flags & ~ASYNC_USR_MASK) != 135664905b48SDan Carpenter (priv->flags & ~ASYNC_USR_MASK))) { 1357bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 13581da177e4SLinus Torvalds return -EPERM; 135964905b48SDan Carpenter } 13601da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 13611da177e4SLinus Torvalds (new_serial.flags & ASYNC_USR_MASK)); 13621da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 13631da177e4SLinus Torvalds goto check_and_exit; 13641da177e4SLinus Torvalds } 13651da177e4SLinus Torvalds 1366eb833a9eSJohan Hovold if (new_serial.baud_base != priv->baud_base) { 1367bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 13681da177e4SLinus Torvalds return -EINVAL; 13696b447f04SAlan Cox } 13701da177e4SLinus Torvalds 13711da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 13721da177e4SLinus Torvalds 13731da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 13741da177e4SLinus Torvalds (new_serial.flags & ASYNC_FLAGS)); 13751da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 13761da177e4SLinus Torvalds 1377557aaa7fSAlan Cox write_latency_timer(port); 13781da177e4SLinus Torvalds 13791da177e4SLinus Torvalds check_and_exit: 13801da177e4SLinus Torvalds if ((old_priv.flags & ASYNC_SPD_MASK) != 13811da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) { 13821da177e4SLinus Torvalds if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 138395da310eSAlan Cox tty->alt_speed = 57600; 13841da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 138595da310eSAlan Cox tty->alt_speed = 115200; 13861da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 138795da310eSAlan Cox tty->alt_speed = 230400; 13881da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 138995da310eSAlan Cox tty->alt_speed = 460800; 13901da177e4SLinus Torvalds else 139195da310eSAlan Cox tty->alt_speed = 0; 13921da177e4SLinus Torvalds } 13931da177e4SLinus Torvalds if (((old_priv.flags & ASYNC_SPD_MASK) != 13941da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) || 13951da177e4SLinus Torvalds (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 13961da177e4SLinus Torvalds (old_priv.custom_divisor != priv->custom_divisor))) { 139795da310eSAlan Cox change_speed(tty, port); 13989c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 13991da177e4SLinus Torvalds } 14006b447f04SAlan Cox else 1401bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 140295da310eSAlan Cox return 0; 1403e49bbce1SJohan Hovold } 14041da177e4SLinus Torvalds 1405c466cd2bSGreg Kroah-Hartman static int get_lsr_info(struct usb_serial_port *port, 1406c466cd2bSGreg Kroah-Hartman struct serial_struct __user *retinfo) 1407c466cd2bSGreg Kroah-Hartman { 1408c466cd2bSGreg Kroah-Hartman struct ftdi_private *priv = usb_get_serial_port_data(port); 1409c466cd2bSGreg Kroah-Hartman unsigned int result = 0; 1410c466cd2bSGreg Kroah-Hartman 1411c466cd2bSGreg Kroah-Hartman if (!retinfo) 1412c466cd2bSGreg Kroah-Hartman return -EFAULT; 1413c466cd2bSGreg Kroah-Hartman 1414c466cd2bSGreg Kroah-Hartman if (priv->transmit_empty) 1415c466cd2bSGreg Kroah-Hartman result = TIOCSER_TEMT; 1416c466cd2bSGreg Kroah-Hartman 1417c466cd2bSGreg Kroah-Hartman if (copy_to_user(retinfo, &result, sizeof(unsigned int))) 1418c466cd2bSGreg Kroah-Hartman return -EFAULT; 1419c466cd2bSGreg Kroah-Hartman return 0; 1420c466cd2bSGreg Kroah-Hartman } 1421c466cd2bSGreg Kroah-Hartman 14221da177e4SLinus Torvalds 14238f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 14248f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 14258f977e42SIan Abbott { 14268f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 14278f977e42SIan Abbott struct usb_serial *serial = port->serial; 14288f977e42SIan Abbott struct usb_device *udev = serial->dev; 14298f977e42SIan Abbott unsigned version; 14308f977e42SIan Abbott unsigned interfaces; 14318f977e42SIan Abbott 14328f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1433f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 14348f977e42SIan Abbott 14358f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 14368f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1437bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, 14388f977e42SIan Abbott version, interfaces); 14398f977e42SIan Abbott if (interfaces > 1) { 14408f977e42SIan Abbott int inter; 14418f977e42SIan Abbott 1442094c2e6dSMark Adamson /* Multiple interfaces.*/ 1443094c2e6dSMark Adamson if (version == 0x0800) { 1444094c2e6dSMark Adamson priv->chip_type = FT4232H; 1445094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1446094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1447094c2e6dSMark Adamson } else if (version == 0x0700) { 1448094c2e6dSMark Adamson priv->chip_type = FT2232H; 1449094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1450094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1451094c2e6dSMark Adamson } else 14528f977e42SIan Abbott priv->chip_type = FT2232C; 1453094c2e6dSMark Adamson 14548f977e42SIan Abbott /* Determine interface code. */ 14558f977e42SIan Abbott inter = serial->interface->altsetting->desc.bInterfaceNumber; 1456094c2e6dSMark Adamson if (inter == 0) { 1457094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1458094c2e6dSMark Adamson } else if (inter == 1) { 1459094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1460094c2e6dSMark Adamson } else if (inter == 2) { 1461094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1462094c2e6dSMark Adamson } else if (inter == 3) { 1463094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1464094c2e6dSMark Adamson } 14658f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 14668f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 14678f977e42SIan Abbott if (version < 0x500) { 1468bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, 1469bfc51614SGreg Kroah-Hartman "%s: something fishy - bcdDevice too low for multi-interface device\n", 1470441b62c1SHarvey Harrison __func__); 14718f977e42SIan Abbott } 14728f977e42SIan Abbott } else if (version < 0x200) { 1473330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 14748f977e42SIan Abbott priv->chip_type = SIO; 14758f977e42SIan Abbott priv->baud_base = 12000000 / 16; 14768f977e42SIan Abbott } else if (version < 0x400) { 1477330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 14788f977e42SIan Abbott /* (It might be a BM because of the iSerialNumber bug, 14798f977e42SIan Abbott * but it will still work as an AM device.) */ 14808f977e42SIan Abbott priv->chip_type = FT8U232AM; 14813b009c63SDavid Brownell } else if (version < 0x600) { 1482330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 14838f977e42SIan Abbott priv->chip_type = FT232BM; 1484309427b6SUwe Bonnes } else if (version < 0x900) { 1485309427b6SUwe Bonnes /* Assume it's an FT232RL */ 14863b009c63SDavid Brownell priv->chip_type = FT232RL; 1487dc0827c1SJim Paris } else if (version < 0x1000) { 1488309427b6SUwe Bonnes /* Assume it's an FT232H */ 1489309427b6SUwe Bonnes priv->chip_type = FT232H; 1490dc0827c1SJim Paris } else { 1491dc0827c1SJim Paris /* Assume it's an FT-X series device */ 1492dc0827c1SJim Paris priv->chip_type = FTX; 14938f977e42SIan Abbott } 1494dc0827c1SJim Paris 1495c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 14968f977e42SIan Abbott } 14978f977e42SIan Abbott 14988f977e42SIan Abbott 1499895f28baSMark Adamson /* Determine the maximum packet size for the device. This depends on the chip 1500895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 1501895f28baSMark Adamson * device descriptor as the chip will use the appropriate values for the host.*/ 1502895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1503895f28baSMark Adamson { 1504895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 1505895f28baSMark Adamson struct usb_serial *serial = port->serial; 1506895f28baSMark Adamson struct usb_device *udev = serial->dev; 1507895f28baSMark Adamson 1508895f28baSMark Adamson struct usb_interface *interface = serial->interface; 1509895f28baSMark Adamson struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; 1510895f28baSMark Adamson 1511895f28baSMark Adamson unsigned num_endpoints; 1512c1284d77SJohan Hovold int i; 1513895f28baSMark Adamson 1514895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1515895f28baSMark Adamson dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 1516895f28baSMark Adamson 1517895f28baSMark Adamson /* NOTE: some customers have programmed FT232R/FT245R devices 1518895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1519895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 1520895f28baSMark Adamson * value of 64 for wMaxPacketSize */ 1521895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1522895f28baSMark Adamson dev_info(&udev->dev, "Endpoint %d MaxPacketSize %d\n", i+1, 1523895f28baSMark Adamson interface->cur_altsetting->endpoint[i].desc.wMaxPacketSize); 1524895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 1525895f28baSMark Adamson if (ep_desc->wMaxPacketSize == 0) { 1526895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1527895f28baSMark Adamson dev_info(&udev->dev, "Overriding wMaxPacketSize on endpoint %d\n", i); 1528895f28baSMark Adamson } 1529895f28baSMark Adamson } 1530895f28baSMark Adamson 1531895f28baSMark Adamson /* set max packet size based on descriptor */ 153229cc8897SKuninori Morimoto priv->max_packet_size = usb_endpoint_maxp(ep_desc); 1533895f28baSMark Adamson 1534895f28baSMark Adamson dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size); 1535895f28baSMark Adamson } 1536895f28baSMark Adamson 1537895f28baSMark Adamson 15381da177e4SLinus Torvalds /* 15391da177e4SLinus Torvalds * *************************************************************************** 15401da177e4SLinus Torvalds * Sysfs Attribute 15411da177e4SLinus Torvalds * *************************************************************************** 15421da177e4SLinus Torvalds */ 15431da177e4SLinus Torvalds 1544464cbb24SAlan Cox static ssize_t show_latency_timer(struct device *dev, 1545464cbb24SAlan Cox struct device_attribute *attr, char *buf) 15461da177e4SLinus Torvalds { 15471da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 15481da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1549557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1550557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1551557aaa7fSAlan Cox else 1552557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 15531da177e4SLinus Torvalds } 1554557aaa7fSAlan Cox 15551da177e4SLinus Torvalds 15561da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1557464cbb24SAlan Cox static ssize_t store_latency_timer(struct device *dev, 1558464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, 15591da177e4SLinus Torvalds size_t count) 15601da177e4SLinus Torvalds { 15611da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 15621da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 15631da177e4SLinus Torvalds int v = simple_strtoul(valbuf, NULL, 10); 1564c1284d77SJohan Hovold int rv; 15651da177e4SLinus Torvalds 1566557aaa7fSAlan Cox priv->latency = v; 1567557aaa7fSAlan Cox rv = write_latency_timer(port); 1568557aaa7fSAlan Cox if (rv < 0) 15691da177e4SLinus Torvalds return -EIO; 15701da177e4SLinus Torvalds return count; 15711da177e4SLinus Torvalds } 15721da177e4SLinus Torvalds 15731da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 15741da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1575464cbb24SAlan Cox static ssize_t store_event_char(struct device *dev, 1576464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 15771da177e4SLinus Torvalds { 15781da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 15791da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 158012bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 15811da177e4SLinus Torvalds int v = simple_strtoul(valbuf, NULL, 10); 1582c1284d77SJohan Hovold int rv; 15831da177e4SLinus Torvalds 1584bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s: setting event char = %i\n", __func__, v); 15851da177e4SLinus Torvalds 15861da177e4SLinus Torvalds rv = usb_control_msg(udev, 15871da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 15881da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 15891da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 15901da177e4SLinus Torvalds v, priv->interface, 159166e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 15921da177e4SLinus Torvalds if (rv < 0) { 1593bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); 15941da177e4SLinus Torvalds return -EIO; 15951da177e4SLinus Torvalds } 15961da177e4SLinus Torvalds 15971da177e4SLinus Torvalds return count; 15981da177e4SLinus Torvalds } 15991da177e4SLinus Torvalds 1600464cbb24SAlan Cox static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, 1601464cbb24SAlan Cox store_latency_timer); 16021da177e4SLinus Torvalds static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 16031da177e4SLinus Torvalds 160412bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 16051da177e4SLinus Torvalds { 160612bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 160713f4db9eSGreg Kroah-Hartman int retval = 0; 16081da177e4SLinus Torvalds 16091da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 16101da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 16111da177e4SLinus Torvalds if (priv->chip_type != SIO) { 1612bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 161312bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 161413f4db9eSGreg Kroah-Hartman if ((!retval) && 161597cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 161697cd49ebSStepan Moskovchenko priv->chip_type == FT2232C || 1617094c2e6dSMark Adamson priv->chip_type == FT232RL || 1618094c2e6dSMark Adamson priv->chip_type == FT2232H || 1619309427b6SUwe Bonnes priv->chip_type == FT4232H || 1620dc0827c1SJim Paris priv->chip_type == FT232H || 1621dc0827c1SJim Paris priv->chip_type == FTX)) { 162212bdbe03SJim Radford retval = device_create_file(&port->dev, 162313f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 16241da177e4SLinus Torvalds } 16251da177e4SLinus Torvalds } 162613f4db9eSGreg Kroah-Hartman return retval; 16271da177e4SLinus Torvalds } 16281da177e4SLinus Torvalds 162912bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 16301da177e4SLinus Torvalds { 163112bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 16321da177e4SLinus Torvalds 16331da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 16341da177e4SLinus Torvalds if (priv->chip_type != SIO) { 163512bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1636ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1637ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1638094c2e6dSMark Adamson priv->chip_type == FT232RL || 1639094c2e6dSMark Adamson priv->chip_type == FT2232H || 1640309427b6SUwe Bonnes priv->chip_type == FT4232H || 1641dc0827c1SJim Paris priv->chip_type == FT232H || 1642dc0827c1SJim Paris priv->chip_type == FTX) { 164312bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 16441da177e4SLinus Torvalds } 16451da177e4SLinus Torvalds } 16461da177e4SLinus Torvalds 16471da177e4SLinus Torvalds } 16481da177e4SLinus Torvalds 16491da177e4SLinus Torvalds /* 16501da177e4SLinus Torvalds * *************************************************************************** 16511da177e4SLinus Torvalds * FTDI driver specific functions 16521da177e4SLinus Torvalds * *************************************************************************** 16531da177e4SLinus Torvalds */ 16541da177e4SLinus Torvalds 16558f977e42SIan Abbott /* Probe function to check for special devices */ 1656464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1657464cbb24SAlan Cox const struct usb_device_id *id) 16588f977e42SIan Abbott { 1659464cbb24SAlan Cox struct ftdi_sio_quirk *quirk = 1660464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 1661fa91d43bSTony Lindgren 1662fa91d43bSTony Lindgren if (quirk && quirk->probe) { 1663fa91d43bSTony Lindgren int ret = quirk->probe(serial); 1664fa91d43bSTony Lindgren if (ret != 0) 1665fa91d43bSTony Lindgren return ret; 1666fa91d43bSTony Lindgren } 1667fa91d43bSTony Lindgren 16688f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 16698f977e42SIan Abbott 1670fa91d43bSTony Lindgren return 0; 16718f977e42SIan Abbott } 16728f977e42SIan Abbott 167312bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 16741da177e4SLinus Torvalds { 16751da177e4SLinus Torvalds struct ftdi_private *priv; 16760ffbbe25SOliver Neukum struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 16770ffbbe25SOliver Neukum 16781da177e4SLinus Torvalds 167980b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 16801da177e4SLinus Torvalds if (!priv) { 1681194343d9SGreg Kroah-Hartman dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__, 1682464cbb24SAlan Cox sizeof(struct ftdi_private)); 16831da177e4SLinus Torvalds return -ENOMEM; 16841da177e4SLinus Torvalds } 16851da177e4SLinus Torvalds 1686bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 16870076b4beSJohan Hovold 16881da177e4SLinus Torvalds priv->flags = ASYNC_LOW_LATENCY; 16891da177e4SLinus Torvalds 16900ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 16910ffbbe25SOliver Neukum quirk->port_probe(priv); 16920ffbbe25SOliver Neukum 169312bdbe03SJim Radford usb_set_serial_port_data(port, priv); 16941da177e4SLinus Torvalds 169512bdbe03SJim Radford ftdi_determine_type(port); 1696895f28baSMark Adamson ftdi_set_max_packet_size(port); 16978c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 16988c4f99cdSJohan Hovold priv->latency = 16; 1699c19db4c9SJohan Hovold write_latency_timer(port); 170012bdbe03SJim Radford create_sysfs_attrs(port); 170112bdbe03SJim Radford return 0; 17021da177e4SLinus Torvalds } 17031da177e4SLinus Torvalds 17048f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 17058f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 17061da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 17070ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 17081da177e4SLinus Torvalds { 17091da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 17101da177e4SLinus Torvalds priv->custom_divisor = 77; 1711669a6db1SAlan Cox priv->force_baud = 38400; 1712e49bbce1SJohan Hovold } 17131da177e4SLinus Torvalds 17148f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 17158f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 1716464cbb24SAlan Cox 17170ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 17188f977e42SIan Abbott { 17191da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 17201da177e4SLinus Torvalds priv->custom_divisor = 240; 1721669a6db1SAlan Cox priv->force_baud = 38400; 17221da177e4SLinus Torvalds priv->force_rtscts = 1; 1723e49bbce1SJohan Hovold } 17241da177e4SLinus Torvalds 1725fa91d43bSTony Lindgren /* 1726b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 1727970e2486SLucas De Marchi * If this value is not set in /etc/modprobe.d/ its value will be set 1728970e2486SLucas De Marchi * to 1ms. 1729b760dac2SMartin Geleynse */ 1730b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 1731b760dac2SMartin Geleynse 1732b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 1733b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 1734b760dac2SMartin Geleynse * 1735b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 1736b760dac2SMartin Geleynse */ 1737b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 1738b760dac2SMartin Geleynse { 1739b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 1740b760dac2SMartin Geleynse int latency = ndi_latency_timer; 1741b760dac2SMartin Geleynse 1742b760dac2SMartin Geleynse if (latency == 0) 1743b760dac2SMartin Geleynse latency = 1; 1744b760dac2SMartin Geleynse if (latency > 99) 1745b760dac2SMartin Geleynse latency = 99; 1746b760dac2SMartin Geleynse 1747bfc51614SGreg Kroah-Hartman dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); 1748bfc51614SGreg Kroah-Hartman dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); 1749b760dac2SMartin Geleynse 1750c1284d77SJohan Hovold /* FIXME: errors are not returned */ 1751c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 1752b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1753b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 175466e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 1755b760dac2SMartin Geleynse return 0; 1756b760dac2SMartin Geleynse } 1757b760dac2SMartin Geleynse 1758b760dac2SMartin Geleynse /* 175920734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 176020734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 176120734345SHarald Welte * userspace using openocd. 1762fa91d43bSTony Lindgren */ 176320734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 1764fa91d43bSTony Lindgren { 1765fa91d43bSTony Lindgren struct usb_device *udev = serial->dev; 1766fa91d43bSTony Lindgren struct usb_interface *interface = serial->interface; 1767fa91d43bSTony Lindgren 1768fa91d43bSTony Lindgren if (interface == udev->actconfig->interface[0]) { 1769c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, 1770c197a8dbSGreg Kroah-Hartman "Ignoring serial port reserved for JTAG\n"); 1771fa91d43bSTony Lindgren return -ENODEV; 1772fa91d43bSTony Lindgren } 1773fa91d43bSTony Lindgren 1774fa91d43bSTony Lindgren return 0; 1775fa91d43bSTony Lindgren } 17761da177e4SLinus Torvalds 1777c96fbdd0SJean-Christophe PLAGNIOL-VILLARD static int ftdi_8u2232c_probe(struct usb_serial *serial) 1778c96fbdd0SJean-Christophe PLAGNIOL-VILLARD { 1779c96fbdd0SJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 1780c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1781444aa7faSPeter Korsgaard if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) || 17821a88d5eeSPeter Korsgaard (udev->product && !strcmp(udev->product, "BeagleBone/XDS100V2"))) 1783c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return ftdi_jtag_probe(serial); 1784c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1785c96fbdd0SJean-Christophe PLAGNIOL-VILLARD return 0; 1786c96fbdd0SJean-Christophe PLAGNIOL-VILLARD } 1787c96fbdd0SJean-Christophe PLAGNIOL-VILLARD 1788546d7eecSKevin Vance /* 17896ec2f46cSJean-Christophe PLAGNIOL-VILLARD * First and second port on STMCLiteadaptors is reserved for JTAG interface 17906ec2f46cSJean-Christophe PLAGNIOL-VILLARD * and the forth port for pio 17916ec2f46cSJean-Christophe PLAGNIOL-VILLARD */ 17926ec2f46cSJean-Christophe PLAGNIOL-VILLARD static int ftdi_stmclite_probe(struct usb_serial *serial) 17936ec2f46cSJean-Christophe PLAGNIOL-VILLARD { 17946ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_device *udev = serial->dev; 17956ec2f46cSJean-Christophe PLAGNIOL-VILLARD struct usb_interface *interface = serial->interface; 17966ec2f46cSJean-Christophe PLAGNIOL-VILLARD 17976ec2f46cSJean-Christophe PLAGNIOL-VILLARD if (interface == udev->actconfig->interface[2]) 17986ec2f46cSJean-Christophe PLAGNIOL-VILLARD return 0; 17996ec2f46cSJean-Christophe PLAGNIOL-VILLARD 18006ec2f46cSJean-Christophe PLAGNIOL-VILLARD dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); 18016ec2f46cSJean-Christophe PLAGNIOL-VILLARD 18026ec2f46cSJean-Christophe PLAGNIOL-VILLARD return -ENODEV; 18036ec2f46cSJean-Christophe PLAGNIOL-VILLARD } 18046ec2f46cSJean-Christophe PLAGNIOL-VILLARD 18056ec2f46cSJean-Christophe PLAGNIOL-VILLARD /* 1806546d7eecSKevin Vance * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. 1807546d7eecSKevin Vance * We have to correct it if we want to read from it. 1808546d7eecSKevin Vance */ 1809546d7eecSKevin Vance static int ftdi_mtxorb_hack_setup(struct usb_serial *serial) 1810546d7eecSKevin Vance { 1811546d7eecSKevin Vance struct usb_host_endpoint *ep = serial->dev->ep_in[1]; 1812546d7eecSKevin Vance struct usb_endpoint_descriptor *ep_desc = &ep->desc; 1813546d7eecSKevin Vance 1814546d7eecSKevin Vance if (ep->enabled && ep_desc->wMaxPacketSize == 0) { 1815fd05e720SAl Viro ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1816c197a8dbSGreg Kroah-Hartman dev_info(&serial->dev->dev, 1817c197a8dbSGreg Kroah-Hartman "Fixing invalid wMaxPacketSize on read pipe\n"); 1818546d7eecSKevin Vance } 1819546d7eecSKevin Vance 1820546d7eecSKevin Vance return 0; 1821546d7eecSKevin Vance } 1822546d7eecSKevin Vance 182312bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 182412bdbe03SJim Radford { 18251da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 18261da177e4SLinus Torvalds 182771ccb9b0SJohan Hovold wake_up_interruptible(&port->delta_msr_wait); 1828876ae50dSSimon Arlott 182912bdbe03SJim Radford remove_sysfs_attrs(port); 18301da177e4SLinus Torvalds 18314cba98ffSJohan Hovold kfree(priv); 18321da177e4SLinus Torvalds 183312bdbe03SJim Radford return 0; 183412bdbe03SJim Radford } 18351da177e4SLinus Torvalds 1836a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 1837e49bbce1SJohan Hovold { 1838108e02b1SJohan Hovold struct ktermios dummy; 18391da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 18401da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 18411da177e4SLinus Torvalds 18421da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 18431da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 18441da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 18451da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 18461da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 184766e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 18481da177e4SLinus Torvalds 18491da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 1850c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 18511da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 18521da177e4SLinus Torvalds 18531da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 1854108e02b1SJohan Hovold if (tty) { 1855108e02b1SJohan Hovold memset(&dummy, 0, sizeof(dummy)); 1856108e02b1SJohan Hovold ftdi_set_termios(tty, port, &dummy); 1857108e02b1SJohan Hovold } 18581da177e4SLinus Torvalds 18594cba98ffSJohan Hovold return usb_serial_generic_open(tty, port); 1860e49bbce1SJohan Hovold } 18611da177e4SLinus Torvalds 1862335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 1863335f8514SAlan Cox { 1864335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1865335f8514SAlan Cox 1866335f8514SAlan Cox /* Disable flow control */ 1867b2ca6990SJohan Hovold if (!on) { 1868b2ca6990SJohan Hovold if (usb_control_msg(port->serial->dev, 1869335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 1870335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 1871335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 187266e47e60SJohan Hovold 0, priv->interface, NULL, 0, 1873335f8514SAlan Cox WDR_TIMEOUT) < 0) { 1874335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 1875335f8514SAlan Cox } 1876b2ca6990SJohan Hovold } 1877335f8514SAlan Cox /* drop RTS and DTR */ 1878335f8514SAlan Cox if (on) 1879335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1880335f8514SAlan Cox else 1881335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1882335f8514SAlan Cox } 18831da177e4SLinus Torvalds 18841da177e4SLinus Torvalds /* The SIO requires the first byte to have: 18851da177e4SLinus Torvalds * B0 1 18861da177e4SLinus Torvalds * B1 0 18871da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 18881da177e4SLinus Torvalds * 18891da177e4SLinus Torvalds * The new devices do not require this byte 18901da177e4SLinus Torvalds */ 1891d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1892c23e5fc1SJohan Hovold void *dest, size_t size) 1893e49bbce1SJohan Hovold { 1894d3901a06SJohan Hovold struct ftdi_private *priv; 1895c23e5fc1SJohan Hovold int count; 1896c23e5fc1SJohan Hovold unsigned long flags; 18971da177e4SLinus Torvalds 1898d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 18991da177e4SLinus Torvalds 1900e8770484SJohan Hovold if (priv->chip_type == SIO) { 1901c23e5fc1SJohan Hovold unsigned char *buffer = dest; 1902c23e5fc1SJohan Hovold int i, len, c; 19031da177e4SLinus Torvalds 1904c23e5fc1SJohan Hovold count = 0; 1905c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 1906c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 1907c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 1908c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 1909c23e5fc1SJohan Hovold if (!c) 1910c23e5fc1SJohan Hovold break; 1911*cb1676a6SJohan Hovold port->icount.tx += c; 1912c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 1913c23e5fc1SJohan Hovold count += c + 1; 19141da177e4SLinus Torvalds } 1915c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 19161da177e4SLinus Torvalds } else { 1917c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 1918c23e5fc1SJohan Hovold &port->lock); 1919*cb1676a6SJohan Hovold port->icount.tx += count; 19201da177e4SLinus Torvalds } 19211da177e4SLinus Torvalds 19221da177e4SLinus Torvalds return count; 192395da310eSAlan Cox } 19241da177e4SLinus Torvalds 1925166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 1926166ceb69SJohan Hovold 192792a19f9cSJiri Slaby static int ftdi_process_packet(struct usb_serial_port *port, 192892a19f9cSJiri Slaby struct ftdi_private *priv, char *packet, int len) 192995da310eSAlan Cox { 19301da177e4SLinus Torvalds int i; 1931cc01f17dSJohan Hovold char status; 1932cc01f17dSJohan Hovold char flag; 1933cc01f17dSJohan Hovold char *ch; 19341da177e4SLinus Torvalds 1935cc01f17dSJohan Hovold if (len < 2) { 1936bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "malformed packet\n"); 1937cc01f17dSJohan Hovold return 0; 19381da177e4SLinus Torvalds } 19391da177e4SLinus Torvalds 1940464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 1941464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 1942464cbb24SAlan Cox are only processed once. */ 1943cc01f17dSJohan Hovold status = packet[0] & FTDI_STATUS_B0_MASK; 1944cc01f17dSJohan Hovold if (status != priv->prev_status) { 1945fca5430dSSimon Arlott char diff_status = status ^ priv->prev_status; 1946fca5430dSSimon Arlott 1947fca5430dSSimon Arlott if (diff_status & FTDI_RS0_CTS) 1948*cb1676a6SJohan Hovold port->icount.cts++; 1949fca5430dSSimon Arlott if (diff_status & FTDI_RS0_DSR) 1950*cb1676a6SJohan Hovold port->icount.dsr++; 1951fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RI) 1952*cb1676a6SJohan Hovold port->icount.rng++; 1953fca5430dSSimon Arlott if (diff_status & FTDI_RS0_RLSD) 1954*cb1676a6SJohan Hovold port->icount.dcd++; 1955fca5430dSSimon Arlott 195671ccb9b0SJohan Hovold wake_up_interruptible(&port->delta_msr_wait); 1957cc01f17dSJohan Hovold priv->prev_status = status; 19581da177e4SLinus Torvalds } 19591da177e4SLinus Torvalds 1960cc01f17dSJohan Hovold flag = TTY_NORMAL; 1961166ceb69SJohan Hovold if (packet[1] & FTDI_RS_ERR_MASK) { 1962166ceb69SJohan Hovold /* Break takes precedence over parity, which takes precedence 1963166ceb69SJohan Hovold * over framing errors */ 1964cc01f17dSJohan Hovold if (packet[1] & FTDI_RS_BI) { 1965cc01f17dSJohan Hovold flag = TTY_BREAK; 1966*cb1676a6SJohan Hovold port->icount.brk++; 196772fda3caSJason Wessel usb_serial_handle_break(port); 1968166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_PE) { 1969cc01f17dSJohan Hovold flag = TTY_PARITY; 1970*cb1676a6SJohan Hovold port->icount.parity++; 1971166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_FE) { 1972cc01f17dSJohan Hovold flag = TTY_FRAME; 1973*cb1676a6SJohan Hovold port->icount.frame++; 1974166ceb69SJohan Hovold } 1975166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 1976005b3cdeSUwe Bonnes if (packet[1] & FTDI_RS_OE) { 1977*cb1676a6SJohan Hovold port->icount.overrun++; 197892a19f9cSJiri Slaby tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 19791da177e4SLinus Torvalds } 1980005b3cdeSUwe Bonnes } 19811da177e4SLinus Torvalds 1982c466cd2bSGreg Kroah-Hartman /* save if the transmitter is empty or not */ 1983c466cd2bSGreg Kroah-Hartman if (packet[1] & FTDI_RS_TEMT) 1984c466cd2bSGreg Kroah-Hartman priv->transmit_empty = 1; 1985c466cd2bSGreg Kroah-Hartman else 1986c466cd2bSGreg Kroah-Hartman priv->transmit_empty = 0; 1987c466cd2bSGreg Kroah-Hartman 1988cc01f17dSJohan Hovold len -= 2; 1989cc01f17dSJohan Hovold if (!len) 1990cc01f17dSJohan Hovold return 0; /* status only */ 1991*cb1676a6SJohan Hovold port->icount.rx += len; 1992cc01f17dSJohan Hovold ch = packet + 2; 1993cc01f17dSJohan Hovold 199449b2597aSJohan Hovold if (port->port.console && port->sysrq) { 1995cc01f17dSJohan Hovold for (i = 0; i < len; i++, ch++) { 19966ee9f4b4SDmitry Torokhov if (!usb_serial_handle_sysrq_char(port, *ch)) 199792a19f9cSJiri Slaby tty_insert_flip_char(&port->port, *ch, flag); 1998cc01f17dSJohan Hovold } 199949b2597aSJohan Hovold } else { 20002f693357SJiri Slaby tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len); 2001cc01f17dSJohan Hovold } 200249b2597aSJohan Hovold 2003cc01f17dSJohan Hovold return len; 2004cc01f17dSJohan Hovold } 2005cc01f17dSJohan Hovold 20061b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 2007cc01f17dSJohan Hovold { 20081b551015SJohan Hovold struct usb_serial_port *port = urb->context; 2009cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2010cc01f17dSJohan Hovold char *data = (char *)urb->transfer_buffer; 2011cc01f17dSJohan Hovold int i; 2012cc01f17dSJohan Hovold int len; 2013cc01f17dSJohan Hovold int count = 0; 2014cc01f17dSJohan Hovold 2015cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 2016cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 201792a19f9cSJiri Slaby count += ftdi_process_packet(port, priv, &data[i], len); 2018cc01f17dSJohan Hovold } 2019cc01f17dSJohan Hovold 2020cc01f17dSJohan Hovold if (count) 20212e124b4aSJiri Slaby tty_flip_buffer_push(&port->port); 2022cc01f17dSJohan Hovold } 20231da177e4SLinus Torvalds 202495da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 20251da177e4SLinus Torvalds { 202695da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 20271da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2028c1284d77SJohan Hovold __u16 urb_value; 20291da177e4SLinus Torvalds 20301da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 20311da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 20321da177e4SLinus Torvalds /* last_set_data_urb_value NEVER has the break bit set in it */ 20331da177e4SLinus Torvalds 2034464cbb24SAlan Cox if (break_state) 20351da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK; 2036464cbb24SAlan Cox else 20371da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value; 20381da177e4SLinus Torvalds 2039464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 2040464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 20411da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 20421da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 20431da177e4SLinus Torvalds urb_value , priv->interface, 204466e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2045bfc51614SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", 2046bfc51614SGreg Kroah-Hartman __func__, break_state); 20471da177e4SLinus Torvalds } 20481da177e4SLinus Torvalds 2049bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, 2050464cbb24SAlan Cox break_state, urb_value); 20511da177e4SLinus Torvalds 20521da177e4SLinus Torvalds } 20531da177e4SLinus Torvalds 20546f602912SJarkko Huijts static int ftdi_chars_in_buffer(struct tty_struct *tty) 20556f602912SJarkko Huijts { 20566f602912SJarkko Huijts struct usb_serial_port *port = tty->driver_data; 20576f602912SJarkko Huijts int chars; 20585fb0432eSJohan Hovold unsigned char buf[2]; 20596f602912SJarkko Huijts int ret; 20606f602912SJarkko Huijts 2061755b6040SJohan Hovold chars = usb_serial_generic_chars_in_buffer(tty); 20628da636d9SJohan Hovold if (chars) 20635fb0432eSJohan Hovold goto out; 20646f602912SJarkko Huijts 20655fb0432eSJohan Hovold /* Check if hardware buffer is empty. */ 20665fb0432eSJohan Hovold ret = ftdi_get_modem_status(tty, buf); 20675fb0432eSJohan Hovold if (ret == 2) { 20686f602912SJarkko Huijts if (!(buf[1] & FTDI_RS_TEMT)) 20695fb0432eSJohan Hovold chars = 1; 20705fb0432eSJohan Hovold } 20715fb0432eSJohan Hovold out: 20725fb0432eSJohan Hovold dev_dbg(&port->dev, "%s - %d\n", __func__, chars); 20736f602912SJarkko Huijts 20746f602912SJarkko Huijts return chars; 20756f602912SJarkko Huijts } 20766f602912SJarkko Huijts 20771da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 20781da177e4SLinus Torvalds * the new setting to be used 20791da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 20801da177e4SLinus Torvalds */ 208195da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 208295da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 2083e49bbce1SJohan Hovold { 20841da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 2085bfc51614SGreg Kroah-Hartman struct device *ddev = &port->dev; 20861da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 2087adc8d746SAlan Cox struct ktermios *termios = &tty->termios; 2088669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 20891da177e4SLinus Torvalds __u16 urb_value; /* will hold the new flags */ 20901da177e4SLinus Torvalds 2091464cbb24SAlan Cox /* Added for xon/xoff support */ 2092669a6db1SAlan Cox unsigned int iflag = termios->c_iflag; 20931da177e4SLinus Torvalds unsigned char vstop; 20941da177e4SLinus Torvalds unsigned char vstart; 20951da177e4SLinus Torvalds 2096464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 2097464cbb24SAlan Cox B0. */ 2098669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 2099bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); 210095da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 2101bd5e47ccSAndrew Morton priv->force_baud); 21021da177e4SLinus Torvalds } 21031da177e4SLinus Torvalds 21041da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 21051da177e4SLinus Torvalds if (priv->force_rtscts) { 2106bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); 2107669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 21081da177e4SLinus Torvalds } 21091da177e4SLinus Torvalds 2110669a6db1SAlan Cox cflag = termios->c_cflag; 21111da177e4SLinus Torvalds 2112a816e311SYing Xue if (!old_termios) 2113c515598eSAndrew Worsley goto no_skip; 2114c515598eSAndrew Worsley 2115b1ffb4c8SAndrew Worsley if (old_termios->c_cflag == termios->c_cflag 2116b1ffb4c8SAndrew Worsley && old_termios->c_ispeed == termios->c_ispeed 2117b1ffb4c8SAndrew Worsley && old_termios->c_ospeed == termios->c_ospeed) 2118b1ffb4c8SAndrew Worsley goto no_c_cflag_changes; 2119b1ffb4c8SAndrew Worsley 21201da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 2121464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 2122464cbb24SAlan Cox don't see any problems yet */ 21231da177e4SLinus Torvalds 2124b1ffb4c8SAndrew Worsley if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) == 2125b1ffb4c8SAndrew Worsley (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB))) 2126b1ffb4c8SAndrew Worsley goto no_data_parity_stop_changes; 2127b1ffb4c8SAndrew Worsley 2128c515598eSAndrew Worsley no_skip: 21291da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 21301da177e4SLinus Torvalds 21311da177e4SLinus Torvalds urb_value = 0; 21321da177e4SLinus Torvalds urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 21331da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 213438fcb830SRoland Koebler if (cflag & PARENB) { 213538fcb830SRoland Koebler if (cflag & CMSPAR) 213638fcb830SRoland Koebler urb_value |= cflag & PARODD ? 213738fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 213838fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 213938fcb830SRoland Koebler else 214038fcb830SRoland Koebler urb_value |= cflag & PARODD ? 214138fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 214238fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 214338fcb830SRoland Koebler } else { 214438fcb830SRoland Koebler urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; 214538fcb830SRoland Koebler } 21461da177e4SLinus Torvalds if (cflag & CSIZE) { 21471da177e4SLinus Torvalds switch (cflag & CSIZE) { 2148bfc51614SGreg Kroah-Hartman case CS7: 2149bfc51614SGreg Kroah-Hartman urb_value |= 7; 2150bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS7\n"); 2151bfc51614SGreg Kroah-Hartman break; 2152bfc51614SGreg Kroah-Hartman case CS8: 2153bfc51614SGreg Kroah-Hartman urb_value |= 8; 2154bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "Setting CS8\n"); 2155bfc51614SGreg Kroah-Hartman break; 21561da177e4SLinus Torvalds default: 2157bfc51614SGreg Kroah-Hartman dev_err(ddev, "CSIZE was set but not CS7-CS8\n"); 21581da177e4SLinus Torvalds } 21591da177e4SLinus Torvalds } 21601da177e4SLinus Torvalds 2161464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 2162464cbb24SAlan Cox - but is or'ed with this value */ 21631da177e4SLinus Torvalds priv->last_set_data_urb_value = urb_value; 21641da177e4SLinus Torvalds 21651da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 21661da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 21671da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 21681da177e4SLinus Torvalds urb_value , priv->interface, 216966e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 2170bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", 2171bfc51614SGreg Kroah-Hartman __func__); 21721da177e4SLinus Torvalds } 21731da177e4SLinus Torvalds 21741da177e4SLinus Torvalds /* Now do the baudrate */ 2175b1ffb4c8SAndrew Worsley no_data_parity_stop_changes: 21761da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 21771da177e4SLinus Torvalds /* Disable flow control */ 21781da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 21791da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 21801da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 21811da177e4SLinus Torvalds 0, priv->interface, 218266e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2183bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s error from disable flowcontrol urb\n", 2184194343d9SGreg Kroah-Hartman __func__); 21851da177e4SLinus Torvalds } 21861da177e4SLinus Torvalds /* Drop RTS and DTR */ 218774ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 21881da177e4SLinus Torvalds } else { 21891da177e4SLinus Torvalds /* set the baudrate determined before */ 21909c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 2191464cbb24SAlan Cox if (change_speed(tty, port)) 2192bfc51614SGreg Kroah-Hartman dev_err(ddev, "%s urb failed to set baudrate\n", __func__); 21939c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 219472a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 2195464cbb24SAlan Cox if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) 219674ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 21971da177e4SLinus Torvalds } 21981da177e4SLinus Torvalds 21991da177e4SLinus Torvalds /* Set flow control */ 22001da177e4SLinus Torvalds /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ 2201b1ffb4c8SAndrew Worsley no_c_cflag_changes: 22021da177e4SLinus Torvalds if (cflag & CRTSCTS) { 2203bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Setting to CRTSCTS flow control\n", __func__); 22041da177e4SLinus Torvalds if (usb_control_msg(dev, 22051da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 22061da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 22071da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 22081da177e4SLinus Torvalds 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), 220966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2210bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to set to rts/cts flow control\n"); 22111da177e4SLinus Torvalds } 22121da177e4SLinus Torvalds } else { 22131da177e4SLinus Torvalds /* 22141da177e4SLinus Torvalds * Xon/Xoff code 22151da177e4SLinus Torvalds * 2216464cbb24SAlan Cox * Check the IXOFF status in the iflag component of the 2217464cbb24SAlan Cox * termios structure. If IXOFF is not set, the pre-xon/xoff 2218464cbb24SAlan Cox * code is executed. 22191da177e4SLinus Torvalds */ 22201da177e4SLinus Torvalds if (iflag & IXOFF) { 2221bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s request to enable xonxoff iflag=%04x\n", 2222464cbb24SAlan Cox __func__, iflag); 2223464cbb24SAlan Cox /* Try to enable the XON/XOFF on the ftdi_sio 2224464cbb24SAlan Cox * Set the vstart and vstop -- could have been done up 2225464cbb24SAlan Cox * above where a lot of other dereferencing is done but 2226464cbb24SAlan Cox * that would be very inefficient as vstart and vstop 2227464cbb24SAlan Cox * are not always needed. 2228464cbb24SAlan Cox */ 2229669a6db1SAlan Cox vstart = termios->c_cc[VSTART]; 2230669a6db1SAlan Cox vstop = termios->c_cc[VSTOP]; 22311da177e4SLinus Torvalds urb_value = (vstop << 8) | (vstart); 22321da177e4SLinus Torvalds 22331da177e4SLinus Torvalds if (usb_control_msg(dev, 22341da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 22351da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 22361da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 22371da177e4SLinus Torvalds urb_value , (FTDI_SIO_XON_XOFF_HS 22381da177e4SLinus Torvalds | priv->interface), 223966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2240194343d9SGreg Kroah-Hartman dev_err(&port->dev, "urb failed to set to " 2241194343d9SGreg Kroah-Hartman "xon/xoff flow control\n"); 22421da177e4SLinus Torvalds } 22431da177e4SLinus Torvalds } else { 2244464cbb24SAlan Cox /* else clause to only run if cflag ! CRTSCTS and iflag 2245464cbb24SAlan Cox * ! XOFF. CHECKME Assuming XON/XOFF handled by tty 2246464cbb24SAlan Cox * stack - not by device */ 2247bfc51614SGreg Kroah-Hartman dev_dbg(ddev, "%s Turning off hardware flow control\n", __func__); 22481da177e4SLinus Torvalds if (usb_control_msg(dev, 22491da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 22501da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 22511da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 22521da177e4SLinus Torvalds 0, priv->interface, 225366e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2254bfc51614SGreg Kroah-Hartman dev_err(ddev, "urb failed to clear flow control\n"); 22551da177e4SLinus Torvalds } 22561da177e4SLinus Torvalds } 22571da177e4SLinus Torvalds } 225895da310eSAlan Cox } 22591da177e4SLinus Torvalds 2260a4afff6bSJohan Hovold /* 2261a4afff6bSJohan Hovold * Get modem-control status. 2262a4afff6bSJohan Hovold * 2263a4afff6bSJohan Hovold * Returns the number of status bytes retrieved (device dependant), or 2264a4afff6bSJohan Hovold * negative error code. 2265a4afff6bSJohan Hovold */ 2266a4afff6bSJohan Hovold static int ftdi_get_modem_status(struct tty_struct *tty, 2267a4afff6bSJohan Hovold unsigned char status[2]) 22681da177e4SLinus Torvalds { 226995da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 22701da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 227166e47e60SJohan Hovold unsigned char *buf; 2272a3f8168bSJohan Hovold int len; 22731da177e4SLinus Torvalds int ret; 22741da177e4SLinus Torvalds 227566e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 227666e47e60SJohan Hovold if (!buf) 227766e47e60SJohan Hovold return -ENOMEM; 2278a3f8168bSJohan Hovold /* 2279a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2280a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2281a3f8168bSJohan Hovold */ 22821da177e4SLinus Torvalds switch (priv->chip_type) { 22831da177e4SLinus Torvalds case SIO: 2284a3f8168bSJohan Hovold len = 1; 22851da177e4SLinus Torvalds break; 22861da177e4SLinus Torvalds case FT8U232AM: 22871da177e4SLinus Torvalds case FT232BM: 22881da177e4SLinus Torvalds case FT2232C: 2289ed6e5282SAndrew M. Bishop case FT232RL: 2290094c2e6dSMark Adamson case FT2232H: 2291094c2e6dSMark Adamson case FT4232H: 2292309427b6SUwe Bonnes case FT232H: 2293dc0827c1SJim Paris case FTX: 2294a3f8168bSJohan Hovold len = 2; 22951da177e4SLinus Torvalds break; 22961da177e4SLinus Torvalds default: 229766e47e60SJohan Hovold ret = -EFAULT; 229866e47e60SJohan Hovold goto out; 22991da177e4SLinus Torvalds } 23001da177e4SLinus Torvalds 2301a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2302a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2303a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2304a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2305a3f8168bSJohan Hovold 0, priv->interface, 2306a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 23072c2ee545SJohan Hovold if (ret < 0) { 2308a4afff6bSJohan Hovold dev_err(&port->dev, "failed to get modem status: %d\n", ret); 23092c2ee545SJohan Hovold ret = usb_translate_errors(ret); 2310a3f8168bSJohan Hovold goto out; 23112c2ee545SJohan Hovold } 2312a3f8168bSJohan Hovold 2313a4afff6bSJohan Hovold status[0] = buf[0]; 2314a4afff6bSJohan Hovold if (ret > 1) 2315a4afff6bSJohan Hovold status[1] = buf[1]; 2316a4afff6bSJohan Hovold else 2317a4afff6bSJohan Hovold status[1] = 0; 2318a4afff6bSJohan Hovold 2319a4afff6bSJohan Hovold dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0], 2320a4afff6bSJohan Hovold status[1]); 2321a4afff6bSJohan Hovold out: 2322a4afff6bSJohan Hovold kfree(buf); 2323a4afff6bSJohan Hovold 2324a4afff6bSJohan Hovold return ret; 2325a4afff6bSJohan Hovold } 2326a4afff6bSJohan Hovold 2327a4afff6bSJohan Hovold static int ftdi_tiocmget(struct tty_struct *tty) 2328a4afff6bSJohan Hovold { 2329a4afff6bSJohan Hovold struct usb_serial_port *port = tty->driver_data; 2330a4afff6bSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 2331a4afff6bSJohan Hovold unsigned char buf[2]; 2332a4afff6bSJohan Hovold int ret; 2333a4afff6bSJohan Hovold 2334a4afff6bSJohan Hovold ret = ftdi_get_modem_status(tty, buf); 2335a4afff6bSJohan Hovold if (ret < 0) 2336a4afff6bSJohan Hovold return ret; 2337a4afff6bSJohan Hovold 233866e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 23391da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 23401da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 23411da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 23421da177e4SLinus Torvalds priv->last_dtr_rts; 2343a4afff6bSJohan Hovold 234466e47e60SJohan Hovold return ret; 23451da177e4SLinus Torvalds } 23461da177e4SLinus Torvalds 234720b9d177SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, 234895da310eSAlan Cox unsigned int set, unsigned int clear) 23491da177e4SLinus Torvalds { 235095da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2351a09aa7ddSGreg Kroah-Hartman 235274ede0ffSIan Abbott return update_mctrl(port, set, clear); 23531da177e4SLinus Torvalds } 23541da177e4SLinus Torvalds 2355c75ccd48SUwe Bonnes static int ftdi_get_icount(struct tty_struct *tty, 2356c75ccd48SUwe Bonnes struct serial_icounter_struct *icount) 2357c75ccd48SUwe Bonnes { 2358c75ccd48SUwe Bonnes struct usb_serial_port *port = tty->driver_data; 2359*cb1676a6SJohan Hovold struct async_icount *ic = &port->icount; 2360c75ccd48SUwe Bonnes 2361c75ccd48SUwe Bonnes icount->cts = ic->cts; 2362c75ccd48SUwe Bonnes icount->dsr = ic->dsr; 2363c75ccd48SUwe Bonnes icount->rng = ic->rng; 2364c75ccd48SUwe Bonnes icount->dcd = ic->dcd; 2365c75ccd48SUwe Bonnes icount->tx = ic->tx; 2366c75ccd48SUwe Bonnes icount->rx = ic->rx; 2367c75ccd48SUwe Bonnes icount->frame = ic->frame; 2368c75ccd48SUwe Bonnes icount->parity = ic->parity; 2369c75ccd48SUwe Bonnes icount->overrun = ic->overrun; 2370c75ccd48SUwe Bonnes icount->brk = ic->brk; 2371c75ccd48SUwe Bonnes icount->buf_overrun = ic->buf_overrun; 2372c75ccd48SUwe Bonnes return 0; 2373c75ccd48SUwe Bonnes } 2374c75ccd48SUwe Bonnes 237500a0d0d6SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, 2376464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 23771da177e4SLinus Torvalds { 237895da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 23791d749f9aSUwe Bonnes struct async_icount cnow; 23801d749f9aSUwe Bonnes struct async_icount cprev; 23811da177e4SLinus Torvalds 2382bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd); 23831da177e4SLinus Torvalds 23841da177e4SLinus Torvalds /* Based on code from acm.c and others */ 23851da177e4SLinus Torvalds switch (cmd) { 23861da177e4SLinus Torvalds 23871da177e4SLinus Torvalds case TIOCGSERIAL: /* gets serial port data */ 2388464cbb24SAlan Cox return get_serial_info(port, 2389464cbb24SAlan Cox (struct serial_struct __user *) arg); 23901da177e4SLinus Torvalds 23911da177e4SLinus Torvalds case TIOCSSERIAL: /* sets serial port data */ 2392464cbb24SAlan Cox return set_serial_info(tty, port, 2393464cbb24SAlan Cox (struct serial_struct __user *) arg); 23941da177e4SLinus Torvalds 23951da177e4SLinus Torvalds /* 23961da177e4SLinus Torvalds * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change 23971da177e4SLinus Torvalds * - mask passed in arg for lines of interest 23981da177e4SLinus Torvalds * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) 23991da177e4SLinus Torvalds * Caller should use TIOCGICOUNT to see which one it was. 24001da177e4SLinus Torvalds * 24011da177e4SLinus Torvalds * This code is borrowed from linux/drivers/char/serial.c 24021da177e4SLinus Torvalds */ 24031da177e4SLinus Torvalds case TIOCMIWAIT: 2404*cb1676a6SJohan Hovold cprev = port->icount; 240571ccb9b0SJohan Hovold for (;;) { 240671ccb9b0SJohan Hovold interruptible_sleep_on(&port->delta_msr_wait); 24071da177e4SLinus Torvalds /* see if a signal did it */ 24081da177e4SLinus Torvalds if (signal_pending(current)) 24091da177e4SLinus Torvalds return -ERESTARTSYS; 241071ccb9b0SJohan Hovold 241171ccb9b0SJohan Hovold if (port->serial->disconnected) 241271ccb9b0SJohan Hovold return -EIO; 241371ccb9b0SJohan Hovold 2414*cb1676a6SJohan Hovold cnow = port->icount; 24151d749f9aSUwe Bonnes if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || 24161d749f9aSUwe Bonnes ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || 24171d749f9aSUwe Bonnes ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || 24181d749f9aSUwe Bonnes ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) { 24191da177e4SLinus Torvalds return 0; 24201da177e4SLinus Torvalds } 24211d749f9aSUwe Bonnes cprev = cnow; 24221da177e4SLinus Torvalds } 2423c466cd2bSGreg Kroah-Hartman case TIOCSERGETLSR: 2424c466cd2bSGreg Kroah-Hartman return get_lsr_info(port, (struct serial_struct __user *)arg); 2425c466cd2bSGreg Kroah-Hartman break; 24261da177e4SLinus Torvalds default: 24271da177e4SLinus Torvalds break; 24281da177e4SLinus Torvalds } 2429464cbb24SAlan Cox /* This is not necessarily an error - turns out the higher layers 2430464cbb24SAlan Cox * will do some ioctls themselves (see comment above) 24311da177e4SLinus Torvalds */ 2432bfc51614SGreg Kroah-Hartman dev_dbg(&port->dev, "%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h\n", 2433bfc51614SGreg Kroah-Hartman __func__, cmd); 243495da310eSAlan Cox return -ENOIOCTLCMD; 243595da310eSAlan Cox } 24361da177e4SLinus Torvalds 24371da177e4SLinus Torvalds static int __init ftdi_init(void) 24381da177e4SLinus Torvalds { 2439fdcb0a0fSIan Abbott if (vendor > 0 && product > 0) { 2440fdcb0a0fSIan Abbott /* Add user specified VID/PID to reserved element of table. */ 2441fdcb0a0fSIan Abbott int i; 2442fdcb0a0fSIan Abbott for (i = 0; id_table_combined[i].idVendor; i++) 2443fdcb0a0fSIan Abbott ; 2444fdcb0a0fSIan Abbott id_table_combined[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE; 2445fdcb0a0fSIan Abbott id_table_combined[i].idVendor = vendor; 2446fdcb0a0fSIan Abbott id_table_combined[i].idProduct = product; 2447fdcb0a0fSIan Abbott } 24481a71bd2eSGreg Kroah-Hartman return usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, id_table_combined); 24491da177e4SLinus Torvalds } 24501da177e4SLinus Torvalds 24511da177e4SLinus Torvalds static void __exit ftdi_exit(void) 24521da177e4SLinus Torvalds { 245368e24113SGreg Kroah-Hartman usb_serial_deregister_drivers(serial_drivers); 24541da177e4SLinus Torvalds } 24551da177e4SLinus Torvalds 24561da177e4SLinus Torvalds 24571da177e4SLinus Torvalds module_init(ftdi_init); 24581da177e4SLinus Torvalds module_exit(ftdi_exit); 24591da177e4SLinus Torvalds 24601da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 24611da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 24621da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 24631da177e4SLinus Torvalds 2464fdcb0a0fSIan Abbott module_param(vendor, ushort, 0); 2465fdcb0a0fSIan Abbott MODULE_PARM_DESC(vendor, "User specified vendor ID (default=" 2466fdcb0a0fSIan Abbott __MODULE_STRING(FTDI_VID)")"); 2467fdcb0a0fSIan Abbott module_param(product, ushort, 0); 246868265043SPaulius Zaleckas MODULE_PARM_DESC(product, "User specified product ID"); 24691da177e4SLinus Torvalds 2470b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2471b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2472