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 upto 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 511da177e4SLinus Torvalds /* 521da177e4SLinus Torvalds * Version Information 531da177e4SLinus Torvalds */ 54d3901a06SJohan Hovold #define DRIVER_VERSION "v1.6.0" 55d3901a06SJohan 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>" 561da177e4SLinus Torvalds #define DRIVER_DESC "USB FTDI Serial Converters Driver" 571da177e4SLinus Torvalds 581da177e4SLinus Torvalds static int debug; 59fdcb0a0fSIan Abbott static __u16 vendor = FTDI_VID; 60fdcb0a0fSIan Abbott static __u16 product; 611da177e4SLinus Torvalds 620ffbbe25SOliver Neukum struct ftdi_private { 63c45d6320SAlan Stern struct kref kref; 643bb36aa2SGreg Kroah-Hartman enum ftdi_chip_type chip_type; 65464cbb24SAlan Cox /* type of device, either SIO or FT8U232AM */ 660ffbbe25SOliver Neukum int baud_base; /* baud base clock for divisor setting */ 67464cbb24SAlan Cox int custom_divisor; /* custom_divisor kludge, this is for 68464cbb24SAlan Cox baud_base (different from what goes to the 69464cbb24SAlan Cox chip!) */ 700ffbbe25SOliver Neukum __u16 last_set_data_urb_value ; 71464cbb24SAlan Cox /* the last data state set - needed for doing 72464cbb24SAlan Cox * a break 73464cbb24SAlan Cox */ 740ffbbe25SOliver Neukum int flags; /* some ASYNC_xxxx flags are supported */ 750ffbbe25SOliver Neukum unsigned long last_dtr_rts; /* saved modem control outputs */ 760ffbbe25SOliver Neukum wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */ 770ffbbe25SOliver Neukum char prev_status, diff_status; /* Used for TIOCMIWAIT */ 780ffbbe25SOliver Neukum struct usb_serial_port *port; 79094c2e6dSMark Adamson __u16 interface; /* FT2232C, FT2232H or FT4232H port interface 80094c2e6dSMark Adamson (0 for FT232/245) */ 810ffbbe25SOliver Neukum 82464cbb24SAlan Cox speed_t force_baud; /* if non-zero, force the baud rate to 83464cbb24SAlan Cox this value */ 84464cbb24SAlan Cox int force_rtscts; /* if non-zero, force RTS-CTS to always 85464cbb24SAlan Cox be enabled */ 860ffbbe25SOliver Neukum 87557aaa7fSAlan Cox unsigned int latency; /* latency setting in use */ 88895f28baSMark Adamson unsigned short max_packet_size; 899c67d28eSAlessio Igor Bogani struct mutex cfg_lock; /* Avoid mess by parallel calls of config ioctl() and change_speed() */ 900ffbbe25SOliver Neukum }; 910ffbbe25SOliver Neukum 928f977e42SIan Abbott /* struct ftdi_sio_quirk is used by devices requiring special attention. */ 938f977e42SIan Abbott struct ftdi_sio_quirk { 94fa91d43bSTony Lindgren int (*probe)(struct usb_serial *); 95464cbb24SAlan Cox /* Special settings for probed ports. */ 96464cbb24SAlan Cox void (*port_probe)(struct ftdi_private *); 978f977e42SIan Abbott }; 988f977e42SIan Abbott 9920734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial); 100546d7eecSKevin Vance static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); 101b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial); 1020ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 1030ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 1048f977e42SIan Abbott 10520734345SHarald Welte static struct ftdi_sio_quirk ftdi_jtag_quirk = { 10620734345SHarald Welte .probe = ftdi_jtag_probe, 107fa91d43bSTony Lindgren }; 108fa91d43bSTony Lindgren 109546d7eecSKevin Vance static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = { 110546d7eecSKevin Vance .probe = ftdi_mtxorb_hack_setup, 111546d7eecSKevin Vance }; 112546d7eecSKevin Vance 113b760dac2SMartin Geleynse static struct ftdi_sio_quirk ftdi_NDI_device_quirk = { 114b760dac2SMartin Geleynse .probe = ftdi_NDI_device_setup, 115b760dac2SMartin Geleynse }; 116b760dac2SMartin Geleynse 1178f977e42SIan Abbott static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 1180ffbbe25SOliver Neukum .port_probe = ftdi_USB_UIRT_setup, 1198f977e42SIan Abbott }; 1208f977e42SIan Abbott 1218f977e42SIan Abbott static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { 1220ffbbe25SOliver Neukum .port_probe = ftdi_HE_TIRA1_setup, 1231da177e4SLinus Torvalds }; 1241da177e4SLinus Torvalds 1251da177e4SLinus Torvalds /* 1261da177e4SLinus Torvalds * The 8U232AM has the same API as the sio except for: 1271da177e4SLinus Torvalds * - it can support MUCH higher baudrates; up to: 1281da177e4SLinus Torvalds * o 921600 for RS232 and 2000000 for RS422/485 at 48MHz 1291da177e4SLinus Torvalds * o 230400 at 12MHz 1301da177e4SLinus Torvalds * so .. 8U232AM's baudrate setting codes are different 1311da177e4SLinus Torvalds * - it has a two byte status code. 1321da177e4SLinus Torvalds * - it returns characters every 16ms (the FTDI does it every 40ms) 1331da177e4SLinus Torvalds * 1341da177e4SLinus Torvalds * the bcdDevice value is used to differentiate FT232BM and FT245BM from 1351da177e4SLinus Torvalds * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 1361da177e4SLinus Torvalds * combinations in both tables. 1378f977e42SIan Abbott * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices, 1388f977e42SIan Abbott * but I don't know if those ever went into mass production. [Ian Abbott] 1391da177e4SLinus Torvalds */ 1401da177e4SLinus Torvalds 1411da177e4SLinus Torvalds 1421da177e4SLinus Torvalds 14365e1ec67SAndreas Mohr /* 14465e1ec67SAndreas Mohr * Device ID not listed? Test via module params product/vendor or 14565e1ec67SAndreas Mohr * /sys/bus/usb/ftdi_sio/new_id, then send patch/report! 14665e1ec67SAndreas Mohr */ 1471da177e4SLinus Torvalds static struct usb_device_id id_table_combined [] = { 1482011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 1492011e924SJonathan Davies { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 15001ba0856SAndrew Ewert { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 15165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 1526e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, 1536e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, 1546e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, 1556e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) }, 1566e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) }, 1576e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) }, 1586e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) }, 1596e1ab3edSPeter Mack { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) }, 160*b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) }, 161*b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) }, 162*b6180ef7Sdranch@trinnet.net { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) }, 16372a9f958SRazvan Gavril { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, 1641da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 16569737dfaSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, 166d099321bSLuiz Fernando N. Capitulino { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, 167fad14a0dSFrank Sievertsen { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, 1681da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 1691da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 1701da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 171d8b21606SGard Spreemann { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, 1721da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, 173094c2e6dSMark Adamson { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) }, 174c0f8d561SChristophe Mariac { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, 1751da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, 1762adb80e9SGuido Scholz { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, 177ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) }, 178ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 179ec3815c3Smail@rainerkeller.de { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 1801da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 1811da177e4SLinus Torvalds { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 182f2ee6955SAlan Cox { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 1831da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 1841da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, 1851da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, 1861da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_633_PID) }, 1871da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_631_PID) }, 1881da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_635_PID) }, 1891da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_640_PID) }, 1901da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_XF_642_PID) }, 1911da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) }, 1921da177e4SLinus Torvalds { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) }, 1931da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) }, 1948f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_0_PID) }, 1958f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_1_PID) }, 1968f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_2_PID) }, 1978f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_3_PID) }, 1988f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 1998f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 2008f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 201b34efeeaSFolkert van Heusden { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, 202ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 203ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 204ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 205ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0103_PID) }, 206ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0104_PID) }, 207ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0105_PID) }, 208ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0106_PID) }, 209ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0107_PID) }, 210ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0108_PID) }, 211ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0109_PID) }, 212ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010A_PID) }, 213ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010B_PID) }, 214ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010C_PID) }, 215ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010D_PID) }, 216ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010E_PID) }, 217ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_010F_PID) }, 218ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0110_PID) }, 219ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0111_PID) }, 220ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0112_PID) }, 221ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0113_PID) }, 222ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0114_PID) }, 223ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0115_PID) }, 224ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0116_PID) }, 225ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0117_PID) }, 226ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0118_PID) }, 227ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0119_PID) }, 228ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011A_PID) }, 229ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011B_PID) }, 230ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011C_PID) }, 231ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011D_PID) }, 232ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011E_PID) }, 233ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_011F_PID) }, 234ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0120_PID) }, 235ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0121_PID) }, 236ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0122_PID) }, 237ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0123_PID) }, 238ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0124_PID) }, 239ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0125_PID) }, 240ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0126_PID) }, 241ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0127_PID), 242546d7eecSKevin Vance .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 243ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0128_PID) }, 244ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0129_PID) }, 245ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012A_PID) }, 246ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012B_PID) }, 247ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012C_PID), 248ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 249ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012D_PID) }, 250ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012E_PID) }, 251ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_012F_PID) }, 252ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0130_PID) }, 253ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0131_PID) }, 254ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0132_PID) }, 255ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0133_PID) }, 256ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0134_PID) }, 257ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0135_PID) }, 258ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0136_PID) }, 259ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0137_PID) }, 260ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0138_PID) }, 261ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0139_PID) }, 262ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013A_PID) }, 263ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013B_PID) }, 264ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013C_PID) }, 265ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013D_PID) }, 266ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013E_PID) }, 267ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_013F_PID) }, 268ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0140_PID) }, 269ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0141_PID) }, 270ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0142_PID) }, 271ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0143_PID) }, 272ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0144_PID) }, 273ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0145_PID) }, 274ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0146_PID) }, 275ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0147_PID) }, 276ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0148_PID) }, 277ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0149_PID) }, 278ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014A_PID) }, 279ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014B_PID) }, 280ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014C_PID) }, 281ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014D_PID) }, 282ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014E_PID) }, 283ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_014F_PID) }, 284ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0150_PID) }, 285ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0151_PID) }, 286ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0152_PID) }, 287ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0153_PID), 288ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 289ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0154_PID), 290ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 291ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0155_PID), 292ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 293ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0156_PID), 294ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 295ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0157_PID), 296ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 297ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0158_PID), 298ebb3770cSRay Molenkamp .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk }, 299ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0159_PID) }, 300ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015A_PID) }, 301ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015B_PID) }, 302ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015C_PID) }, 303ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015D_PID) }, 304ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015E_PID) }, 305ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_015F_PID) }, 306ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0160_PID) }, 307ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0161_PID) }, 308ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0162_PID) }, 309ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0163_PID) }, 310ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0164_PID) }, 311ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0165_PID) }, 312ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0166_PID) }, 313ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0167_PID) }, 314ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0168_PID) }, 315ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0169_PID) }, 316ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016A_PID) }, 317ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016B_PID) }, 318ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016C_PID) }, 319ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016D_PID) }, 320ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016E_PID) }, 321ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_016F_PID) }, 322ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0170_PID) }, 323ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0171_PID) }, 324ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0172_PID) }, 325ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0173_PID) }, 326ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0174_PID) }, 327ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0175_PID) }, 328ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0176_PID) }, 329ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0177_PID) }, 330ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0178_PID) }, 331ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0179_PID) }, 332ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017A_PID) }, 333ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017B_PID) }, 334ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017C_PID) }, 335ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017D_PID) }, 336ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017E_PID) }, 337ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_017F_PID) }, 338ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0180_PID) }, 339ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0181_PID) }, 340ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0182_PID) }, 341ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0183_PID) }, 342ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0184_PID) }, 343ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0185_PID) }, 344ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0186_PID) }, 345ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0187_PID) }, 346ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0188_PID) }, 347ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0189_PID) }, 348ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018A_PID) }, 349ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018B_PID) }, 350ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018C_PID) }, 351ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018D_PID) }, 352ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018E_PID) }, 353ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_018F_PID) }, 354ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0190_PID) }, 355ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0191_PID) }, 356ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0192_PID) }, 357ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0193_PID) }, 358ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0194_PID) }, 359ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0195_PID) }, 360ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0196_PID) }, 361ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0197_PID) }, 362ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0198_PID) }, 363ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0199_PID) }, 364ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019A_PID) }, 365ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019B_PID) }, 366ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019C_PID) }, 367ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019D_PID) }, 368ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019E_PID) }, 369ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_019F_PID) }, 370ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A0_PID) }, 371ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A1_PID) }, 372ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A2_PID) }, 373ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A3_PID) }, 374ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A4_PID) }, 375ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A5_PID) }, 376ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A6_PID) }, 377ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A7_PID) }, 378ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A8_PID) }, 379ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01A9_PID) }, 380ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AA_PID) }, 381ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AB_PID) }, 382ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AC_PID) }, 383ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AD_PID) }, 384ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AE_PID) }, 385ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01AF_PID) }, 386ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B0_PID) }, 387ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B1_PID) }, 388ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B2_PID) }, 389ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B3_PID) }, 390ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B4_PID) }, 391ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B5_PID) }, 392ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B6_PID) }, 393ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B7_PID) }, 394ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B8_PID) }, 395ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01B9_PID) }, 396ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BA_PID) }, 397ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BB_PID) }, 398ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BC_PID) }, 399ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BD_PID) }, 400ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BE_PID) }, 401ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01BF_PID) }, 402ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C0_PID) }, 403ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C1_PID) }, 404ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C2_PID) }, 405ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C3_PID) }, 406ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C4_PID) }, 407ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C5_PID) }, 408ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C6_PID) }, 409ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C7_PID) }, 410ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C8_PID) }, 411ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01C9_PID) }, 412ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CA_PID) }, 413ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CB_PID) }, 414ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CC_PID) }, 415ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CD_PID) }, 416ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CE_PID) }, 417ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01CF_PID) }, 418ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D0_PID) }, 419ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D1_PID) }, 420ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D2_PID) }, 421ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D3_PID) }, 422ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D4_PID) }, 423ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D5_PID) }, 424ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D6_PID) }, 425ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D7_PID) }, 426ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D8_PID) }, 427ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01D9_PID) }, 428ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DA_PID) }, 429ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DB_PID) }, 430ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DC_PID) }, 431ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DD_PID) }, 432ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DE_PID) }, 433ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01DF_PID) }, 434ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E0_PID) }, 435ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E1_PID) }, 436ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E2_PID) }, 437ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E3_PID) }, 438ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E4_PID) }, 439ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E5_PID) }, 440ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E6_PID) }, 441ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E7_PID) }, 442ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E8_PID) }, 443ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01E9_PID) }, 444ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EA_PID) }, 445ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EB_PID) }, 446ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EC_PID) }, 447ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01ED_PID) }, 448ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EE_PID) }, 449ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01EF_PID) }, 450ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F0_PID) }, 451ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F1_PID) }, 452ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F2_PID) }, 453ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F3_PID) }, 454ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F4_PID) }, 455ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F5_PID) }, 456ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F6_PID) }, 457ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F7_PID) }, 458ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F8_PID) }, 459ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01F9_PID) }, 460ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FA_PID) }, 461ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FB_PID) }, 462ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FC_PID) }, 463ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 464ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 465ebb3770cSRay Molenkamp { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 4668f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 4671da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 468274a4bbcSDave Platt { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, 469868e440dSJelle Foks { USB_DEVICE(FTDI_VID, FTDI_USBX_707_PID) }, 4701da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 4711da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 4721da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, 4731da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2104_PID) }, 474a1484827SJustin Carlson { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2106_PID) }, 4751da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_1_PID) }, 4761da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2201_2_PID) }, 4771da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_1_PID) }, 4781da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2202_2_PID) }, 4791da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_1_PID) }, 4801da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2203_2_PID) }, 4811da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_1_PID) }, 4821da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_2_PID) }, 4831da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_3_PID) }, 4841da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2401_4_PID) }, 4851da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_1_PID) }, 4861da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_2_PID) }, 4871da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_3_PID) }, 4881da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2402_4_PID) }, 4891da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_1_PID) }, 4901da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_2_PID) }, 4911da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_3_PID) }, 4921da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2403_4_PID) }, 4931da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_1_PID) }, 4941da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_2_PID) }, 4951da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_3_PID) }, 4961da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_4_PID) }, 4971da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_5_PID) }, 4981da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_6_PID) }, 4991da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_7_PID) }, 5001da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2801_8_PID) }, 5011da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_1_PID) }, 5021da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_2_PID) }, 5031da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_3_PID) }, 5041da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_4_PID) }, 5051da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_5_PID) }, 5061da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_6_PID) }, 5071da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_7_PID) }, 5081da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2802_8_PID) }, 5091da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_1_PID) }, 5101da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_2_PID) }, 5111da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_3_PID) }, 5121da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_4_PID) }, 5131da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_5_PID) }, 5141da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) }, 5151da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) }, 5161da177e4SLinus Torvalds { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 5171da177e4SLinus Torvalds { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 5181da177e4SLinus Torvalds { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 5198f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID), 5208f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk }, 5218f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID), 5228f977e42SIan Abbott .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk }, 5231da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 5241da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 5251da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 5261da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 5278f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) }, 5288f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) }, 5298f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) }, 5308f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) }, 5318f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) }, 5328f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) }, 5338f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) }, 5348f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) }, 5358f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) }, 5368f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) }, 5378f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) }, 5388f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) }, 5398f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) }, 5408f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) }, 5418f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) }, 5428f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) }, 5431da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 54447900743SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 545e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_UR100_PID) }, 546e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, 547207c47e1SThomas Riewe { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, 548bde62185SMartin Hagelin { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, 5494eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, 5504eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, 5514eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, 5524eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, 5534eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, 5544eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, 5554eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, 5564eaf60e0SThomas Schleusener { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, 557e6ac4a40SIan Abbott /* 55865e1ec67SAndreas Mohr * ELV devices: 559e6ac4a40SIan Abbott */ 56065e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, 56165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, 56265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, 56365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) }, 56465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) }, 56565e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) }, 56665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) }, 56765e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) }, 56842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) }, 56942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) }, 57042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) }, 57142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDF77_PID) }, 57242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UIO88_PID) }, 57342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UAD8_PID) }, 57442f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_UDA7_PID) }, 57542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_USI2_PID) }, 57642f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_T1100_PID) }, 57742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCD200_PID) }, 57842f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_ULA200_PID) }, 57942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_CSI8_PID) }, 58042f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1000DL_PID) }, 58142f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) }, 58242f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) }, 58342f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) }, 58465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) }, 58542f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) }, 58665e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) }, 58742f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) }, 5884ae897dfSSven Andersen { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) }, 58942f8aa94SPeter Stark { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) }, 590b5894a50SAndré Schenk { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) }, 59165e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) }, 59265e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) }, 59365e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) }, 59465e1ec67SAndreas Mohr { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) }, 5958f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) }, 5968f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) }, 5978f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) }, 5988f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) }, 5998f977e42SIan Abbott { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) }, 6001da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 6011da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 602ec434e9bSJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 6039d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) }, 6049d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) }, 6059d37ff64SJan Capek { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) }, 6061da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 6071da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 6081da177e4SLinus Torvalds { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 6091da177e4SLinus Torvalds { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, 610e6ac4a40SIan Abbott { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, 6111da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, 612c3d36c45SVladimir Vukicevic { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, 613ef31fec0SMichael Olberg { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, 6146f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, 61546b72d78SDaniel Sangorrin { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, 6161da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, 6171da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, 6181da177e4SLinus Torvalds { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) }, 619a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) }, 620a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) }, 621a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) }, 622a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) }, 623a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) }, 624a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) }, 625a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) }, 626a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) }, 627a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) }, 628a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) }, 629a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) }, 630a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) }, 631a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) }, 632a8cbd90aSCliff Brake { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) }, 6331da177e4SLinus Torvalds { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) }, 6346f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 6356f92872cSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 636e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) }, 637e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) }, 638e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) }, 639e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_3_PID) }, 640e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_4_PID) }, 641e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, 642e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, 643e6ac4a40SIan Abbott { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, 6446f92872cSIan Abbott { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 6458f977e42SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, 64634d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, 64734d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, 6489b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, 6499b1513d9SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, 65034d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, 65134d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, 65234d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, 65334d1a8aaSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, 654740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 655740a4282SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 6569b1513d9SIan Abbott { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 657c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 658c1f8ea7dSSøren Hauberg { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 659c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 660c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 66109c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, 662c9c7746dSRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, 66309c280a2SRui Santos { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HRC_PID) }, 66434910434SFranco Lanza { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16IC_PID) }, 665b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, 666b4723ae3SIan Abbott { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 667effac8beSPavel Fedin { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 668641adaaeSLouis Nyffenegger { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 6697e1c0b86SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) }, 670a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 671a94b52acSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 672ce40d290SWouter Paesen { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 673cdd3b156SNathan Bronson { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, 6747e0258fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, 675bf58fbd5SA. Maitland Bottoms { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, 67662a13db3SFolkert van Heusden { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, 67720a0f47eSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, 678eb79b4fdSIan Abbott { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, 67948437486SD. Peter Siddons { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, 680e1979fefSColin Leroy { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, 681eaede2cbSRalf Schlatterbeck { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, 6829978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, 6839978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 6849978f9e1SIan Abbott { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 68540c36092SKjell Myksvoll { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 686b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID), 687b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 688b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID), 689b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 690b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID), 691b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 692b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID), 693b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 694b760dac2SMartin Geleynse { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), 695b760dac2SMartin Geleynse .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, 696822c7ef4SMicke Prag { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 697fcc6cb78SCorey Minyard { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, 698762e92faSNeil \"Superna\" ARMSTRONG { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 699a5f62399SLex Ross { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 700d7fde2d6SPierre Castella { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, 7014bb0ef19SEd Beroset { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 70211171d1bSMirko Bordignon { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 703fa91d43bSTony Lindgren { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 70420734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 70520734345SHarald Welte { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), 70620734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 70720734345SHarald Welte { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), 70820734345SHarald Welte .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 709a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID), 710a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 711a00c3cadSFrederik Kriewitz { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 712a00c3cadSFrederik Kriewitz .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 71314511412SKrzysztof Halasa { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), 71414511412SKrzysztof Halasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 71526ab7053SAtsushi Nemoto { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 7162542335cSJon K Hellan { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 717a18f80b4SJaroslav Kysela { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 718a7787e50SRadek Liboska { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) }, 71996285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) }, 72096285cb8SGaetan Carlier { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 72145eeff84SRobie Basak { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 722ca80801bSMhayk Whandson { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 7237f82b6ddSAxel Wachtler { USB_DEVICE(ATMEL_VID, STK541_PID) }, 7247f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, STB_PID) }, 7257f82b6ddSAxel Wachtler { USB_DEVICE(DE_VID, WHT_PID) }, 726b0d65900SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICE_PID), 727b0d65900SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 72811eaf170SMichael Hennerich { USB_DEVICE(ADI_VID, ADI_GNICEPLUS_PID), 72911eaf170SMichael Hennerich .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 730ae27d843SPeter Korsgaard { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, 7311002bb77SNicolas Pitre { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 7321002bb77SNicolas Pitre .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 733d46130abSDaniel Suchy { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 734fca4404cSVille Sundberg { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, 735c47aacc6SMarko Hänninen { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, 73650d0678eSDhaval Vasa { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), 73750d0678eSDhaval Vasa .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 738e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, 739e7d7fcc0SPawel Ludwikow { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, 7409714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, 7419714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, 7429714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, 7439714080dSMitchell Solomon { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, 74477dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), 74577dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 74677dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), 74777dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 74877dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), 74977dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 75077dbd74eSColin Leitner { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 75177dbd74eSColin Leitner .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 752afad1964SJohn G. Rogers { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 753fdcb0a0fSIan Abbott { }, /* Optional parameter entry */ 7541da177e4SLinus Torvalds { } /* Terminating entry */ 7551da177e4SLinus Torvalds }; 7561da177e4SLinus Torvalds 7571da177e4SLinus Torvalds MODULE_DEVICE_TABLE(usb, id_table_combined); 7581da177e4SLinus Torvalds 7591da177e4SLinus Torvalds static struct usb_driver ftdi_driver = { 7601da177e4SLinus Torvalds .name = "ftdi_sio", 7611da177e4SLinus Torvalds .probe = usb_serial_probe, 7621da177e4SLinus Torvalds .disconnect = usb_serial_disconnect, 7631da177e4SLinus Torvalds .id_table = id_table_combined, 764ba9dc657SGreg Kroah-Hartman .no_dynamic_id = 1, 7651da177e4SLinus Torvalds }; 7661da177e4SLinus Torvalds 7674c4c9432SArjan van de Ven static const char *ftdi_chip_name[] = { 7681da177e4SLinus Torvalds [SIO] = "SIO", /* the serial part of FT8U100AX */ 7691da177e4SLinus Torvalds [FT8U232AM] = "FT8U232AM", 7701da177e4SLinus Torvalds [FT232BM] = "FT232BM", 7711da177e4SLinus Torvalds [FT2232C] = "FT2232C", 772d8b21606SGard Spreemann [FT232RL] = "FT232RL", 773094c2e6dSMark Adamson [FT2232H] = "FT2232H", 774094c2e6dSMark Adamson [FT4232H] = "FT4232H" 7751da177e4SLinus Torvalds }; 7761da177e4SLinus Torvalds 7771da177e4SLinus Torvalds 7781da177e4SLinus Torvalds /* Used for TIOCMIWAIT */ 7791da177e4SLinus Torvalds #define FTDI_STATUS_B0_MASK (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD) 7801da177e4SLinus Torvalds #define FTDI_STATUS_B1_MASK (FTDI_RS_BI) 7811da177e4SLinus Torvalds /* End TIOCMIWAIT */ 7821da177e4SLinus Torvalds 7831da177e4SLinus Torvalds #define FTDI_IMPL_ASYNC_FLAGS = (ASYNC_SPD_HI | ASYNC_SPD_VHI \ 784bbc5d276SRoel Kluin | ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP) 7851da177e4SLinus Torvalds 7861da177e4SLinus Torvalds /* function prototypes for a FTDI serial converter */ 787464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 788464cbb24SAlan Cox const struct usb_device_id *id); 78912bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port); 79012bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port); 791a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port); 792335f8514SAlan Cox static void ftdi_close(struct usb_serial_port *port); 793335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on); 7941b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb); 795d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 796c23e5fc1SJohan Hovold void *dest, size_t size); 797464cbb24SAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 798464cbb24SAlan Cox struct usb_serial_port *port, struct ktermios *old); 79995da310eSAlan Cox static int ftdi_tiocmget(struct tty_struct *tty, struct file *file); 800464cbb24SAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 801464cbb24SAlan Cox unsigned int set, unsigned int clear); 802464cbb24SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 803464cbb24SAlan Cox unsigned int cmd, unsigned long arg); 80495da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 8051da177e4SLinus Torvalds 8061da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 8071da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud); 8081da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); 8091da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud); 810094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); 811094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud); 8121da177e4SLinus Torvalds 813ea65370dSGreg Kroah-Hartman static struct usb_serial_driver ftdi_sio_device = { 81418fcac35SGreg Kroah-Hartman .driver = { 8151da177e4SLinus Torvalds .owner = THIS_MODULE, 816269bda1cSGreg Kroah-Hartman .name = "ftdi_sio", 81718fcac35SGreg Kroah-Hartman }, 818269bda1cSGreg Kroah-Hartman .description = "FTDI USB Serial Device", 819d9b1b787SJohannes Hölzl .usb_driver = &ftdi_driver, 8208f977e42SIan Abbott .id_table = id_table_combined, 8211da177e4SLinus Torvalds .num_ports = 1, 822bbcb2b90SJohan Hovold .bulk_in_size = 512, 823c23e5fc1SJohan Hovold .bulk_out_size = 256, 8248f977e42SIan Abbott .probe = ftdi_sio_probe, 82512bdbe03SJim Radford .port_probe = ftdi_sio_port_probe, 82612bdbe03SJim Radford .port_remove = ftdi_sio_port_remove, 8271da177e4SLinus Torvalds .open = ftdi_open, 8281da177e4SLinus Torvalds .close = ftdi_close, 829335f8514SAlan Cox .dtr_rts = ftdi_dtr_rts, 8301b551015SJohan Hovold .throttle = usb_serial_generic_throttle, 8311b551015SJohan Hovold .unthrottle = usb_serial_generic_unthrottle, 8321b551015SJohan Hovold .process_read_urb = ftdi_process_read_urb, 833d3901a06SJohan Hovold .prepare_write_buffer = ftdi_prepare_write_buffer, 8341da177e4SLinus Torvalds .tiocmget = ftdi_tiocmget, 8351da177e4SLinus Torvalds .tiocmset = ftdi_tiocmset, 8361da177e4SLinus Torvalds .ioctl = ftdi_ioctl, 8371da177e4SLinus Torvalds .set_termios = ftdi_set_termios, 8381da177e4SLinus Torvalds .break_ctl = ftdi_break_ctl, 8391da177e4SLinus Torvalds }; 8401da177e4SLinus Torvalds 8411da177e4SLinus Torvalds 8421da177e4SLinus Torvalds #define WDR_TIMEOUT 5000 /* default urb timeout */ 843279e1545SIan Abbott #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ 8441da177e4SLinus Torvalds 8451da177e4SLinus Torvalds /* High and low are for DTR, RTS etc etc */ 8461da177e4SLinus Torvalds #define HIGH 1 8471da177e4SLinus Torvalds #define LOW 0 8481da177e4SLinus Torvalds 8491da177e4SLinus Torvalds /* 8501da177e4SLinus Torvalds * *************************************************************************** 851fa91d43bSTony Lindgren * Utility functions 8521da177e4SLinus Torvalds * *************************************************************************** 8531da177e4SLinus Torvalds */ 8541da177e4SLinus Torvalds 8551da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base) 8561da177e4SLinus Torvalds { 8571da177e4SLinus Torvalds unsigned short int divisor; 858464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 859464cbb24SAlan Cox int divisor3 = base / 2 / baud; 860464cbb24SAlan Cox if ((divisor3 & 0x7) == 7) 861464cbb24SAlan Cox divisor3++; /* round x.7/8 up to x+1 */ 8621da177e4SLinus Torvalds divisor = divisor3 >> 3; 8631da177e4SLinus Torvalds divisor3 &= 0x7; 864464cbb24SAlan Cox if (divisor3 == 1) 865464cbb24SAlan Cox divisor |= 0xc000; 866464cbb24SAlan Cox else if (divisor3 >= 4) 867464cbb24SAlan Cox divisor |= 0x4000; 868464cbb24SAlan Cox else if (divisor3 != 0) 869464cbb24SAlan Cox divisor |= 0x8000; 870464cbb24SAlan Cox else if (divisor == 1) 871464cbb24SAlan Cox divisor = 0; /* special case for maximum baud rate */ 8721da177e4SLinus Torvalds return divisor; 8731da177e4SLinus Torvalds } 8741da177e4SLinus Torvalds 8751da177e4SLinus Torvalds static unsigned short int ftdi_232am_baud_to_divisor(int baud) 8761da177e4SLinus Torvalds { 877464cbb24SAlan Cox return ftdi_232am_baud_base_to_divisor(baud, 48000000); 8781da177e4SLinus Torvalds } 8791da177e4SLinus Torvalds 8801da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) 8811da177e4SLinus Torvalds { 8821da177e4SLinus Torvalds static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 8831da177e4SLinus Torvalds __u32 divisor; 884464cbb24SAlan Cox /* divisor shifted 3 bits to the left */ 885464cbb24SAlan Cox int divisor3 = base / 2 / baud; 8861da177e4SLinus Torvalds divisor = divisor3 >> 3; 8871da177e4SLinus Torvalds divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 8881da177e4SLinus Torvalds /* Deal with special cases for highest baud rates. */ 889464cbb24SAlan Cox if (divisor == 1) 890464cbb24SAlan Cox divisor = 0; 891464cbb24SAlan Cox else if (divisor == 0x4001) 892464cbb24SAlan Cox divisor = 1; 8931da177e4SLinus Torvalds return divisor; 8941da177e4SLinus Torvalds } 8951da177e4SLinus Torvalds 8961da177e4SLinus Torvalds static __u32 ftdi_232bm_baud_to_divisor(int baud) 8971da177e4SLinus Torvalds { 898464cbb24SAlan Cox return ftdi_232bm_baud_base_to_divisor(baud, 48000000); 8991da177e4SLinus Torvalds } 9001da177e4SLinus Torvalds 901094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) 902094c2e6dSMark Adamson { 903094c2e6dSMark Adamson static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; 904094c2e6dSMark Adamson __u32 divisor; 905094c2e6dSMark Adamson int divisor3; 906094c2e6dSMark Adamson 907094c2e6dSMark Adamson /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 908094c2e6dSMark Adamson divisor3 = (base / 10 / baud) * 8; 909094c2e6dSMark Adamson 910094c2e6dSMark Adamson divisor = divisor3 >> 3; 911094c2e6dSMark Adamson divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 912094c2e6dSMark Adamson /* Deal with special cases for highest baud rates. */ 913094c2e6dSMark Adamson if (divisor == 1) 914094c2e6dSMark Adamson divisor = 0; 915094c2e6dSMark Adamson else if (divisor == 0x4001) 916094c2e6dSMark Adamson divisor = 1; 917094c2e6dSMark Adamson /* 918094c2e6dSMark Adamson * Set this bit to turn off a divide by 2.5 on baud rate generator 919094c2e6dSMark Adamson * This enables baud rates up to 12Mbaud but cannot reach below 1200 920094c2e6dSMark Adamson * baud with this bit set 921094c2e6dSMark Adamson */ 922094c2e6dSMark Adamson divisor |= 0x00020000; 923094c2e6dSMark Adamson return divisor; 924094c2e6dSMark Adamson } 925094c2e6dSMark Adamson 926094c2e6dSMark Adamson static __u32 ftdi_2232h_baud_to_divisor(int baud) 927094c2e6dSMark Adamson { 928094c2e6dSMark Adamson return ftdi_2232h_baud_base_to_divisor(baud, 120000000); 929094c2e6dSMark Adamson } 930094c2e6dSMark Adamson 93174ede0ffSIan Abbott #define set_mctrl(port, set) update_mctrl((port), (set), 0) 93274ede0ffSIan Abbott #define clear_mctrl(port, clear) update_mctrl((port), 0, (clear)) 93374ede0ffSIan Abbott 934464cbb24SAlan Cox static int update_mctrl(struct usb_serial_port *port, unsigned int set, 935464cbb24SAlan Cox unsigned int clear) 9361da177e4SLinus Torvalds { 9371da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 93874ede0ffSIan Abbott unsigned urb_value; 9391da177e4SLinus Torvalds int rv; 9401da177e4SLinus Torvalds 94174ede0ffSIan Abbott if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { 942441b62c1SHarvey Harrison dbg("%s - DTR|RTS not being set|cleared", __func__); 94374ede0ffSIan Abbott return 0; /* no change */ 9441da177e4SLinus Torvalds } 94574ede0ffSIan Abbott 94674ede0ffSIan Abbott clear &= ~set; /* 'set' takes precedence over 'clear' */ 94774ede0ffSIan Abbott urb_value = 0; 94874ede0ffSIan Abbott if (clear & TIOCM_DTR) 94974ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_LOW; 95074ede0ffSIan Abbott if (clear & TIOCM_RTS) 95174ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_LOW; 95274ede0ffSIan Abbott if (set & TIOCM_DTR) 95374ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_DTR_HIGH; 95474ede0ffSIan Abbott if (set & TIOCM_RTS) 95574ede0ffSIan Abbott urb_value |= FTDI_SIO_SET_RTS_HIGH; 9561da177e4SLinus Torvalds rv = usb_control_msg(port->serial->dev, 9571da177e4SLinus Torvalds usb_sndctrlpipe(port->serial->dev, 0), 9581da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST, 9591da177e4SLinus Torvalds FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, 96074ede0ffSIan Abbott urb_value, priv->interface, 96166e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 96274ede0ffSIan Abbott if (rv < 0) { 96343b11d33SAlan Cox dbg("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", 964441b62c1SHarvey Harrison __func__, 96574ede0ffSIan Abbott (set & TIOCM_DTR) ? "HIGH" : 96674ede0ffSIan Abbott (clear & TIOCM_DTR) ? "LOW" : "unchanged", 96774ede0ffSIan Abbott (set & TIOCM_RTS) ? "HIGH" : 96874ede0ffSIan Abbott (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 9691da177e4SLinus Torvalds } else { 970441b62c1SHarvey Harrison dbg("%s - DTR %s, RTS %s", __func__, 97174ede0ffSIan Abbott (set & TIOCM_DTR) ? "HIGH" : 97274ede0ffSIan Abbott (clear & TIOCM_DTR) ? "LOW" : "unchanged", 97374ede0ffSIan Abbott (set & TIOCM_RTS) ? "HIGH" : 97474ede0ffSIan Abbott (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 9759b0f2582SAlan Cox /* FIXME: locking on last_dtr_rts */ 97674ede0ffSIan Abbott priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; 9771da177e4SLinus Torvalds } 9781da177e4SLinus Torvalds return rv; 9791da177e4SLinus Torvalds } 9801da177e4SLinus Torvalds 9811da177e4SLinus Torvalds 982464cbb24SAlan Cox static __u32 get_ftdi_divisor(struct tty_struct *tty, 983464cbb24SAlan Cox struct usb_serial_port *port) 984e49bbce1SJohan Hovold { 9851da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 9861da177e4SLinus Torvalds __u32 div_value = 0; 9871da177e4SLinus Torvalds int div_okay = 1; 9881da177e4SLinus Torvalds int baud; 9891da177e4SLinus Torvalds 9901da177e4SLinus Torvalds /* 991464cbb24SAlan Cox * The logic involved in setting the baudrate can be cleanly split into 992464cbb24SAlan Cox * 3 steps. 9931da177e4SLinus Torvalds * 1. Standard baud rates are set in tty->termios->c_cflag 994464cbb24SAlan Cox * 2. If these are not enough, you can set any speed using alt_speed as 995464cbb24SAlan Cox * follows: 9961da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 9971da177e4SLinus Torvalds * - set your real speed in tty->alt_speed; it gets ignored when 9981da177e4SLinus Torvalds * alt_speed==0, (or) 999464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1000464cbb24SAlan Cox * follows: 1001464cbb24SAlan Cox * flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], 1002464cbb24SAlan Cox * this just sets alt_speed to (HI: 57600, VHI: 115200, 1003464cbb24SAlan Cox * SHI: 230400, WARP: 460800) 10041da177e4SLinus Torvalds * ** Steps 1, 2 are done courtesy of tty_get_baud_rate 10051da177e4SLinus Torvalds * 3. You can also set baud rate by setting custom divisor as follows 10061da177e4SLinus Torvalds * - set tty->termios->c_cflag speed to B38400 1007464cbb24SAlan Cox * - call TIOCSSERIAL ioctl with (struct serial_struct) set as 1008464cbb24SAlan Cox * follows: 10091da177e4SLinus Torvalds * o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST 10101da177e4SLinus Torvalds * o custom_divisor set to baud_base / your_new_baudrate 1011464cbb24SAlan Cox * ** Step 3 is done courtesy of code borrowed from serial.c 1012464cbb24SAlan Cox * I should really spend some time and separate + move this common 1013464cbb24SAlan Cox * code to serial.c, it is replicated in nearly every serial driver 1014464cbb24SAlan Cox * you see. 10151da177e4SLinus Torvalds */ 10161da177e4SLinus Torvalds 1017464cbb24SAlan Cox /* 1. Get the baud rate from the tty settings, this observes 1018464cbb24SAlan Cox alt_speed hack */ 10191da177e4SLinus Torvalds 102095da310eSAlan Cox baud = tty_get_baud_rate(tty); 1021441b62c1SHarvey Harrison dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud); 10221da177e4SLinus Torvalds 1023464cbb24SAlan Cox /* 2. Observe async-compatible custom_divisor hack, update baudrate 1024464cbb24SAlan Cox if needed */ 10251da177e4SLinus Torvalds 10261da177e4SLinus Torvalds if (baud == 38400 && 10271da177e4SLinus Torvalds ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 10281da177e4SLinus Torvalds (priv->custom_divisor)) { 10291da177e4SLinus Torvalds baud = priv->baud_base / priv->custom_divisor; 1030464cbb24SAlan Cox dbg("%s - custom divisor %d sets baud rate to %d", 1031464cbb24SAlan Cox __func__, priv->custom_divisor, baud); 10321da177e4SLinus Torvalds } 10331da177e4SLinus Torvalds 10341da177e4SLinus Torvalds /* 3. Convert baudrate to device-specific divisor */ 10351da177e4SLinus Torvalds 1036464cbb24SAlan Cox if (!baud) 1037464cbb24SAlan Cox baud = 9600; 10381da177e4SLinus Torvalds switch (priv->chip_type) { 10391da177e4SLinus Torvalds case SIO: /* SIO chip */ 10401da177e4SLinus Torvalds switch (baud) { 10411da177e4SLinus Torvalds case 300: div_value = ftdi_sio_b300; break; 10421da177e4SLinus Torvalds case 600: div_value = ftdi_sio_b600; break; 10431da177e4SLinus Torvalds case 1200: div_value = ftdi_sio_b1200; break; 10441da177e4SLinus Torvalds case 2400: div_value = ftdi_sio_b2400; break; 10451da177e4SLinus Torvalds case 4800: div_value = ftdi_sio_b4800; break; 10461da177e4SLinus Torvalds case 9600: div_value = ftdi_sio_b9600; break; 10471da177e4SLinus Torvalds case 19200: div_value = ftdi_sio_b19200; break; 10481da177e4SLinus Torvalds case 38400: div_value = ftdi_sio_b38400; break; 10491da177e4SLinus Torvalds case 57600: div_value = ftdi_sio_b57600; break; 10501da177e4SLinus Torvalds case 115200: div_value = ftdi_sio_b115200; break; 10511da177e4SLinus Torvalds } /* baud */ 10521da177e4SLinus Torvalds if (div_value == 0) { 1053464cbb24SAlan Cox dbg("%s - Baudrate (%d) requested is not supported", 1054464cbb24SAlan Cox __func__, baud); 10551da177e4SLinus Torvalds div_value = ftdi_sio_b9600; 1056669a6db1SAlan Cox baud = 9600; 10571da177e4SLinus Torvalds div_okay = 0; 10581da177e4SLinus Torvalds } 10591da177e4SLinus Torvalds break; 10601da177e4SLinus Torvalds case FT8U232AM: /* 8U232AM chip */ 10611da177e4SLinus Torvalds if (baud <= 3000000) { 10621da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(baud); 10631da177e4SLinus Torvalds } else { 1064441b62c1SHarvey Harrison dbg("%s - Baud rate too high!", __func__); 1065669a6db1SAlan Cox baud = 9600; 10661da177e4SLinus Torvalds div_value = ftdi_232am_baud_to_divisor(9600); 10671da177e4SLinus Torvalds div_okay = 0; 10681da177e4SLinus Torvalds } 10691da177e4SLinus Torvalds break; 10701da177e4SLinus Torvalds case FT232BM: /* FT232BM chip */ 10711da177e4SLinus Torvalds case FT2232C: /* FT2232C chip */ 10723b009c63SDavid Brownell case FT232RL: 10731da177e4SLinus Torvalds if (baud <= 3000000) { 1074b760dac2SMartin Geleynse __u16 product_id = le16_to_cpu( 1075b760dac2SMartin Geleynse port->serial->dev->descriptor.idProduct); 1076b760dac2SMartin Geleynse if (((FTDI_NDI_HUC_PID == product_id) || 1077b760dac2SMartin Geleynse (FTDI_NDI_SPECTRA_SCU_PID == product_id) || 1078b760dac2SMartin Geleynse (FTDI_NDI_FUTURE_2_PID == product_id) || 1079b760dac2SMartin Geleynse (FTDI_NDI_FUTURE_3_PID == product_id) || 1080b760dac2SMartin Geleynse (FTDI_NDI_AURORA_SCU_PID == product_id)) && 1081b760dac2SMartin Geleynse (baud == 19200)) { 1082b760dac2SMartin Geleynse baud = 1200000; 1083b760dac2SMartin Geleynse } 10841da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(baud); 10851da177e4SLinus Torvalds } else { 1086441b62c1SHarvey Harrison dbg("%s - Baud rate too high!", __func__); 10871da177e4SLinus Torvalds div_value = ftdi_232bm_baud_to_divisor(9600); 10881da177e4SLinus Torvalds div_okay = 0; 1089669a6db1SAlan Cox baud = 9600; 10901da177e4SLinus Torvalds } 10911da177e4SLinus Torvalds break; 1092094c2e6dSMark Adamson case FT2232H: /* FT2232H chip */ 1093094c2e6dSMark Adamson case FT4232H: /* FT4232H chip */ 1094094c2e6dSMark Adamson if ((baud <= 12000000) & (baud >= 1200)) { 1095094c2e6dSMark Adamson div_value = ftdi_2232h_baud_to_divisor(baud); 1096094c2e6dSMark Adamson } else if (baud < 1200) { 1097094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(baud); 1098094c2e6dSMark Adamson } else { 1099094c2e6dSMark Adamson dbg("%s - Baud rate too high!", __func__); 1100094c2e6dSMark Adamson div_value = ftdi_232bm_baud_to_divisor(9600); 1101094c2e6dSMark Adamson div_okay = 0; 1102094c2e6dSMark Adamson baud = 9600; 1103094c2e6dSMark Adamson } 1104094c2e6dSMark Adamson break; 11051da177e4SLinus Torvalds } /* priv->chip_type */ 11061da177e4SLinus Torvalds 11071da177e4SLinus Torvalds if (div_okay) { 11081da177e4SLinus Torvalds dbg("%s - Baud rate set to %d (divisor 0x%lX) on chip %s", 1109441b62c1SHarvey Harrison __func__, baud, (unsigned long)div_value, 11101da177e4SLinus Torvalds ftdi_chip_name[priv->chip_type]); 11111da177e4SLinus Torvalds } 11121da177e4SLinus Torvalds 111395da310eSAlan Cox tty_encode_baud_rate(tty, baud, baud); 1114464cbb24SAlan Cox return div_value; 11151da177e4SLinus Torvalds } 11161da177e4SLinus Torvalds 111795da310eSAlan Cox static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) 111895da310eSAlan Cox { 111995da310eSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 112095da310eSAlan Cox __u16 urb_value; 112195da310eSAlan Cox __u16 urb_index; 112295da310eSAlan Cox __u32 urb_index_value; 112395da310eSAlan Cox int rv; 112495da310eSAlan Cox 112595da310eSAlan Cox urb_index_value = get_ftdi_divisor(tty, port); 112695da310eSAlan Cox urb_value = (__u16)urb_index_value; 112795da310eSAlan Cox urb_index = (__u16)(urb_index_value >> 16); 112895da310eSAlan Cox if (priv->interface) { /* FT2232C */ 112995da310eSAlan Cox urb_index = (__u16)((urb_index << 8) | priv->interface); 113095da310eSAlan Cox } 113195da310eSAlan Cox 113295da310eSAlan Cox rv = usb_control_msg(port->serial->dev, 113395da310eSAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 113495da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST, 113595da310eSAlan Cox FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, 113695da310eSAlan Cox urb_value, urb_index, 113766e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT); 113895da310eSAlan Cox return rv; 113995da310eSAlan Cox } 114095da310eSAlan Cox 1141557aaa7fSAlan Cox static int write_latency_timer(struct usb_serial_port *port) 1142557aaa7fSAlan Cox { 1143557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1144557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 1145c1284d77SJohan Hovold int rv; 1146557aaa7fSAlan Cox int l = priv->latency; 114795da310eSAlan Cox 1148557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1149557aaa7fSAlan Cox l = 1; 1150557aaa7fSAlan Cox 1151557aaa7fSAlan Cox dbg("%s: setting latency timer = %i", __func__, l); 1152557aaa7fSAlan Cox 1153557aaa7fSAlan Cox rv = usb_control_msg(udev, 1154557aaa7fSAlan Cox usb_sndctrlpipe(udev, 0), 1155557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1156557aaa7fSAlan Cox FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1157557aaa7fSAlan Cox l, priv->interface, 115866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 1159557aaa7fSAlan Cox if (rv < 0) 1160557aaa7fSAlan Cox dev_err(&port->dev, "Unable to write latency timer: %i\n", rv); 1161557aaa7fSAlan Cox return rv; 1162557aaa7fSAlan Cox } 1163557aaa7fSAlan Cox 1164557aaa7fSAlan Cox static int read_latency_timer(struct usb_serial_port *port) 1165557aaa7fSAlan Cox { 1166557aaa7fSAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1167557aaa7fSAlan Cox struct usb_device *udev = port->serial->dev; 116854f328d0SJohan Hovold unsigned char *buf; 1169c1284d77SJohan Hovold int rv; 1170557aaa7fSAlan Cox 1171557aaa7fSAlan Cox dbg("%s", __func__); 1172557aaa7fSAlan Cox 117354f328d0SJohan Hovold buf = kmalloc(1, GFP_KERNEL); 117454f328d0SJohan Hovold if (!buf) 117554f328d0SJohan Hovold return -ENOMEM; 117654f328d0SJohan Hovold 1177557aaa7fSAlan Cox rv = usb_control_msg(udev, 1178557aaa7fSAlan Cox usb_rcvctrlpipe(udev, 0), 1179557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST, 1180557aaa7fSAlan Cox FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE, 1181557aaa7fSAlan Cox 0, priv->interface, 118254f328d0SJohan Hovold buf, 1, WDR_TIMEOUT); 11834357369dSJohan Hovold if (rv < 0) 1184557aaa7fSAlan Cox dev_err(&port->dev, "Unable to read latency timer: %i\n", rv); 11854357369dSJohan Hovold else 118654f328d0SJohan Hovold priv->latency = buf[0]; 118754f328d0SJohan Hovold 118854f328d0SJohan Hovold kfree(buf); 118954f328d0SJohan Hovold 11908c4f99cdSJohan Hovold return rv; 1191557aaa7fSAlan Cox } 11921da177e4SLinus Torvalds 1193464cbb24SAlan Cox static int get_serial_info(struct usb_serial_port *port, 1194464cbb24SAlan Cox struct serial_struct __user *retinfo) 11951da177e4SLinus Torvalds { 11961da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 11971da177e4SLinus Torvalds struct serial_struct tmp; 11981da177e4SLinus Torvalds 11991da177e4SLinus Torvalds if (!retinfo) 12001da177e4SLinus Torvalds return -EFAULT; 12011da177e4SLinus Torvalds memset(&tmp, 0, sizeof(tmp)); 12021da177e4SLinus Torvalds tmp.flags = priv->flags; 12031da177e4SLinus Torvalds tmp.baud_base = priv->baud_base; 12041da177e4SLinus Torvalds tmp.custom_divisor = priv->custom_divisor; 12051da177e4SLinus Torvalds if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 12061da177e4SLinus Torvalds return -EFAULT; 12071da177e4SLinus Torvalds return 0; 1208e49bbce1SJohan Hovold } 12091da177e4SLinus Torvalds 121095da310eSAlan Cox static int set_serial_info(struct tty_struct *tty, 121195da310eSAlan Cox struct usb_serial_port *port, struct serial_struct __user *newinfo) 1212e49bbce1SJohan Hovold { 12131da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 12141da177e4SLinus Torvalds struct serial_struct new_serial; 12151da177e4SLinus Torvalds struct ftdi_private old_priv; 12161da177e4SLinus Torvalds 12171da177e4SLinus Torvalds if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) 12181da177e4SLinus Torvalds return -EFAULT; 12196b447f04SAlan Cox 1220bd09a9f5SAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 12211da177e4SLinus Torvalds old_priv = *priv; 12221da177e4SLinus Torvalds 12231da177e4SLinus Torvalds /* Do error checking and permission checking */ 12241da177e4SLinus Torvalds 12251da177e4SLinus Torvalds if (!capable(CAP_SYS_ADMIN)) { 12261da177e4SLinus Torvalds if (((new_serial.flags & ~ASYNC_USR_MASK) != 122764905b48SDan Carpenter (priv->flags & ~ASYNC_USR_MASK))) { 1228bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 12291da177e4SLinus Torvalds return -EPERM; 123064905b48SDan Carpenter } 12311da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_USR_MASK) | 12321da177e4SLinus Torvalds (new_serial.flags & ASYNC_USR_MASK)); 12331da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 12341da177e4SLinus Torvalds goto check_and_exit; 12351da177e4SLinus Torvalds } 12361da177e4SLinus Torvalds 12371da177e4SLinus Torvalds if ((new_serial.baud_base != priv->baud_base) && 12386b447f04SAlan Cox (new_serial.baud_base < 9600)) { 1239bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 12401da177e4SLinus Torvalds return -EINVAL; 12416b447f04SAlan Cox } 12421da177e4SLinus Torvalds 12431da177e4SLinus Torvalds /* Make the changes - these are privileged changes! */ 12441da177e4SLinus Torvalds 12451da177e4SLinus Torvalds priv->flags = ((priv->flags & ~ASYNC_FLAGS) | 12461da177e4SLinus Torvalds (new_serial.flags & ASYNC_FLAGS)); 12471da177e4SLinus Torvalds priv->custom_divisor = new_serial.custom_divisor; 12481da177e4SLinus Torvalds 1249557aaa7fSAlan Cox write_latency_timer(port); 12501da177e4SLinus Torvalds 12511da177e4SLinus Torvalds check_and_exit: 12521da177e4SLinus Torvalds if ((old_priv.flags & ASYNC_SPD_MASK) != 12531da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) { 12541da177e4SLinus Torvalds if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 125595da310eSAlan Cox tty->alt_speed = 57600; 12561da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 125795da310eSAlan Cox tty->alt_speed = 115200; 12581da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 125995da310eSAlan Cox tty->alt_speed = 230400; 12601da177e4SLinus Torvalds else if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 126195da310eSAlan Cox tty->alt_speed = 460800; 12621da177e4SLinus Torvalds else 126395da310eSAlan Cox tty->alt_speed = 0; 12641da177e4SLinus Torvalds } 12651da177e4SLinus Torvalds if (((old_priv.flags & ASYNC_SPD_MASK) != 12661da177e4SLinus Torvalds (priv->flags & ASYNC_SPD_MASK)) || 12671da177e4SLinus Torvalds (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && 12681da177e4SLinus Torvalds (old_priv.custom_divisor != priv->custom_divisor))) { 126995da310eSAlan Cox change_speed(tty, port); 12709c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 12711da177e4SLinus Torvalds } 12726b447f04SAlan Cox else 1273bd09a9f5SAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 127495da310eSAlan Cox return 0; 1275e49bbce1SJohan Hovold } 12761da177e4SLinus Torvalds 12771da177e4SLinus Torvalds 12788f977e42SIan Abbott /* Determine type of FTDI chip based on USB config and descriptor. */ 12798f977e42SIan Abbott static void ftdi_determine_type(struct usb_serial_port *port) 12808f977e42SIan Abbott { 12818f977e42SIan Abbott struct ftdi_private *priv = usb_get_serial_port_data(port); 12828f977e42SIan Abbott struct usb_serial *serial = port->serial; 12838f977e42SIan Abbott struct usb_device *udev = serial->dev; 12848f977e42SIan Abbott unsigned version; 12858f977e42SIan Abbott unsigned interfaces; 12868f977e42SIan Abbott 12878f977e42SIan Abbott /* Assume it is not the original SIO device for now. */ 1288f5e09b7cSIan Abbott priv->baud_base = 48000000 / 2; 12898f977e42SIan Abbott 12908f977e42SIan Abbott version = le16_to_cpu(udev->descriptor.bcdDevice); 12918f977e42SIan Abbott interfaces = udev->actconfig->desc.bNumInterfaces; 1292441b62c1SHarvey Harrison dbg("%s: bcdDevice = 0x%x, bNumInterfaces = %u", __func__, 12938f977e42SIan Abbott version, interfaces); 12948f977e42SIan Abbott if (interfaces > 1) { 12958f977e42SIan Abbott int inter; 12968f977e42SIan Abbott 1297094c2e6dSMark Adamson /* Multiple interfaces.*/ 1298094c2e6dSMark Adamson if (version == 0x0800) { 1299094c2e6dSMark Adamson priv->chip_type = FT4232H; 1300094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1301094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1302094c2e6dSMark Adamson } else if (version == 0x0700) { 1303094c2e6dSMark Adamson priv->chip_type = FT2232H; 1304094c2e6dSMark Adamson /* Hi-speed - baud clock runs at 120MHz */ 1305094c2e6dSMark Adamson priv->baud_base = 120000000 / 2; 1306094c2e6dSMark Adamson } else 13078f977e42SIan Abbott priv->chip_type = FT2232C; 1308094c2e6dSMark Adamson 13098f977e42SIan Abbott /* Determine interface code. */ 13108f977e42SIan Abbott inter = serial->interface->altsetting->desc.bInterfaceNumber; 1311094c2e6dSMark Adamson if (inter == 0) { 1312094c2e6dSMark Adamson priv->interface = INTERFACE_A; 1313094c2e6dSMark Adamson } else if (inter == 1) { 1314094c2e6dSMark Adamson priv->interface = INTERFACE_B; 1315094c2e6dSMark Adamson } else if (inter == 2) { 1316094c2e6dSMark Adamson priv->interface = INTERFACE_C; 1317094c2e6dSMark Adamson } else if (inter == 3) { 1318094c2e6dSMark Adamson priv->interface = INTERFACE_D; 1319094c2e6dSMark Adamson } 13208f977e42SIan Abbott /* BM-type devices have a bug where bcdDevice gets set 13218f977e42SIan Abbott * to 0x200 when iSerialNumber is 0. */ 13228f977e42SIan Abbott if (version < 0x500) { 13238f977e42SIan Abbott dbg("%s: something fishy - bcdDevice too low for multi-interface device", 1324441b62c1SHarvey Harrison __func__); 13258f977e42SIan Abbott } 13268f977e42SIan Abbott } else if (version < 0x200) { 1327330e3c4cSAndreas Mohr /* Old device. Assume it's the original SIO. */ 13288f977e42SIan Abbott priv->chip_type = SIO; 13298f977e42SIan Abbott priv->baud_base = 12000000 / 16; 13308f977e42SIan Abbott } else if (version < 0x400) { 1331330e3c4cSAndreas Mohr /* Assume it's an FT8U232AM (or FT8U245AM) */ 13328f977e42SIan Abbott /* (It might be a BM because of the iSerialNumber bug, 13338f977e42SIan Abbott * but it will still work as an AM device.) */ 13348f977e42SIan Abbott priv->chip_type = FT8U232AM; 13353b009c63SDavid Brownell } else if (version < 0x600) { 1336330e3c4cSAndreas Mohr /* Assume it's an FT232BM (or FT245BM) */ 13378f977e42SIan Abbott priv->chip_type = FT232BM; 13383b009c63SDavid Brownell } else { 1339330e3c4cSAndreas Mohr /* Assume it's an FT232R */ 13403b009c63SDavid Brownell priv->chip_type = FT232RL; 13418f977e42SIan Abbott } 1342c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]); 13438f977e42SIan Abbott } 13448f977e42SIan Abbott 13458f977e42SIan Abbott 1346895f28baSMark Adamson /* Determine the maximum packet size for the device. This depends on the chip 1347895f28baSMark Adamson * type and the USB host capabilities. The value should be obtained from the 1348895f28baSMark Adamson * device descriptor as the chip will use the appropriate values for the host.*/ 1349895f28baSMark Adamson static void ftdi_set_max_packet_size(struct usb_serial_port *port) 1350895f28baSMark Adamson { 1351895f28baSMark Adamson struct ftdi_private *priv = usb_get_serial_port_data(port); 1352895f28baSMark Adamson struct usb_serial *serial = port->serial; 1353895f28baSMark Adamson struct usb_device *udev = serial->dev; 1354895f28baSMark Adamson 1355895f28baSMark Adamson struct usb_interface *interface = serial->interface; 1356895f28baSMark Adamson struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; 1357895f28baSMark Adamson 1358895f28baSMark Adamson unsigned num_endpoints; 1359c1284d77SJohan Hovold int i; 1360895f28baSMark Adamson 1361895f28baSMark Adamson num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1362895f28baSMark Adamson dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 1363895f28baSMark Adamson 1364895f28baSMark Adamson /* NOTE: some customers have programmed FT232R/FT245R devices 1365895f28baSMark Adamson * with an endpoint size of 0 - not good. In this case, we 1366895f28baSMark Adamson * want to override the endpoint descriptor setting and use a 1367895f28baSMark Adamson * value of 64 for wMaxPacketSize */ 1368895f28baSMark Adamson for (i = 0; i < num_endpoints; i++) { 1369895f28baSMark Adamson dev_info(&udev->dev, "Endpoint %d MaxPacketSize %d\n", i+1, 1370895f28baSMark Adamson interface->cur_altsetting->endpoint[i].desc.wMaxPacketSize); 1371895f28baSMark Adamson ep_desc = &interface->cur_altsetting->endpoint[i].desc; 1372895f28baSMark Adamson if (ep_desc->wMaxPacketSize == 0) { 1373895f28baSMark Adamson ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1374895f28baSMark Adamson dev_info(&udev->dev, "Overriding wMaxPacketSize on endpoint %d\n", i); 1375895f28baSMark Adamson } 1376895f28baSMark Adamson } 1377895f28baSMark Adamson 1378895f28baSMark Adamson /* set max packet size based on descriptor */ 1379895f28baSMark Adamson priv->max_packet_size = ep_desc->wMaxPacketSize; 1380895f28baSMark Adamson 1381895f28baSMark Adamson dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size); 1382895f28baSMark Adamson } 1383895f28baSMark Adamson 1384895f28baSMark Adamson 13851da177e4SLinus Torvalds /* 13861da177e4SLinus Torvalds * *************************************************************************** 13871da177e4SLinus Torvalds * Sysfs Attribute 13881da177e4SLinus Torvalds * *************************************************************************** 13891da177e4SLinus Torvalds */ 13901da177e4SLinus Torvalds 1391464cbb24SAlan Cox static ssize_t show_latency_timer(struct device *dev, 1392464cbb24SAlan Cox struct device_attribute *attr, char *buf) 13931da177e4SLinus Torvalds { 13941da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 13951da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1396557aaa7fSAlan Cox if (priv->flags & ASYNC_LOW_LATENCY) 1397557aaa7fSAlan Cox return sprintf(buf, "1\n"); 1398557aaa7fSAlan Cox else 1399557aaa7fSAlan Cox return sprintf(buf, "%i\n", priv->latency); 14001da177e4SLinus Torvalds } 1401557aaa7fSAlan Cox 14021da177e4SLinus Torvalds 14031da177e4SLinus Torvalds /* Write a new value of the latency timer, in units of milliseconds. */ 1404464cbb24SAlan Cox static ssize_t store_latency_timer(struct device *dev, 1405464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, 14061da177e4SLinus Torvalds size_t count) 14071da177e4SLinus Torvalds { 14081da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 14091da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 14101da177e4SLinus Torvalds int v = simple_strtoul(valbuf, NULL, 10); 1411c1284d77SJohan Hovold int rv; 14121da177e4SLinus Torvalds 1413557aaa7fSAlan Cox priv->latency = v; 1414557aaa7fSAlan Cox rv = write_latency_timer(port); 1415557aaa7fSAlan Cox if (rv < 0) 14161da177e4SLinus Torvalds return -EIO; 14171da177e4SLinus Torvalds return count; 14181da177e4SLinus Torvalds } 14191da177e4SLinus Torvalds 14201da177e4SLinus Torvalds /* Write an event character directly to the FTDI register. The ASCII 14211da177e4SLinus Torvalds value is in the low 8 bits, with the enable bit in the 9th bit. */ 1422464cbb24SAlan Cox static ssize_t store_event_char(struct device *dev, 1423464cbb24SAlan Cox struct device_attribute *attr, const char *valbuf, size_t count) 14241da177e4SLinus Torvalds { 14251da177e4SLinus Torvalds struct usb_serial_port *port = to_usb_serial_port(dev); 14261da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 142712bdbe03SJim Radford struct usb_device *udev = port->serial->dev; 14281da177e4SLinus Torvalds int v = simple_strtoul(valbuf, NULL, 10); 1429c1284d77SJohan Hovold int rv; 14301da177e4SLinus Torvalds 1431441b62c1SHarvey Harrison dbg("%s: setting event char = %i", __func__, v); 14321da177e4SLinus Torvalds 14331da177e4SLinus Torvalds rv = usb_control_msg(udev, 14341da177e4SLinus Torvalds usb_sndctrlpipe(udev, 0), 14351da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST, 14361da177e4SLinus Torvalds FTDI_SIO_SET_EVENT_CHAR_REQUEST_TYPE, 14371da177e4SLinus Torvalds v, priv->interface, 143866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT); 14391da177e4SLinus Torvalds if (rv < 0) { 14401da177e4SLinus Torvalds dbg("Unable to write event character: %i", rv); 14411da177e4SLinus Torvalds return -EIO; 14421da177e4SLinus Torvalds } 14431da177e4SLinus Torvalds 14441da177e4SLinus Torvalds return count; 14451da177e4SLinus Torvalds } 14461da177e4SLinus Torvalds 1447464cbb24SAlan Cox static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, 1448464cbb24SAlan Cox store_latency_timer); 14491da177e4SLinus Torvalds static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); 14501da177e4SLinus Torvalds 145112bdbe03SJim Radford static int create_sysfs_attrs(struct usb_serial_port *port) 14521da177e4SLinus Torvalds { 145312bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 145413f4db9eSGreg Kroah-Hartman int retval = 0; 14551da177e4SLinus Torvalds 1456441b62c1SHarvey Harrison dbg("%s", __func__); 14571da177e4SLinus Torvalds 14581da177e4SLinus Torvalds /* XXX I've no idea if the original SIO supports the event_char 14591da177e4SLinus Torvalds * sysfs parameter, so I'm playing it safe. */ 14601da177e4SLinus Torvalds if (priv->chip_type != SIO) { 14611da177e4SLinus Torvalds dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); 146212bdbe03SJim Radford retval = device_create_file(&port->dev, &dev_attr_event_char); 146313f4db9eSGreg Kroah-Hartman if ((!retval) && 146497cd49ebSStepan Moskovchenko (priv->chip_type == FT232BM || 146597cd49ebSStepan Moskovchenko priv->chip_type == FT2232C || 1466094c2e6dSMark Adamson priv->chip_type == FT232RL || 1467094c2e6dSMark Adamson priv->chip_type == FT2232H || 1468094c2e6dSMark Adamson priv->chip_type == FT4232H)) { 146912bdbe03SJim Radford retval = device_create_file(&port->dev, 147013f4db9eSGreg Kroah-Hartman &dev_attr_latency_timer); 14711da177e4SLinus Torvalds } 14721da177e4SLinus Torvalds } 147313f4db9eSGreg Kroah-Hartman return retval; 14741da177e4SLinus Torvalds } 14751da177e4SLinus Torvalds 147612bdbe03SJim Radford static void remove_sysfs_attrs(struct usb_serial_port *port) 14771da177e4SLinus Torvalds { 147812bdbe03SJim Radford struct ftdi_private *priv = usb_get_serial_port_data(port); 14791da177e4SLinus Torvalds 1480441b62c1SHarvey Harrison dbg("%s", __func__); 14811da177e4SLinus Torvalds 14821da177e4SLinus Torvalds /* XXX see create_sysfs_attrs */ 14831da177e4SLinus Torvalds if (priv->chip_type != SIO) { 148412bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_event_char); 1485ed6e5282SAndrew M. Bishop if (priv->chip_type == FT232BM || 1486ed6e5282SAndrew M. Bishop priv->chip_type == FT2232C || 1487094c2e6dSMark Adamson priv->chip_type == FT232RL || 1488094c2e6dSMark Adamson priv->chip_type == FT2232H || 1489094c2e6dSMark Adamson priv->chip_type == FT4232H) { 149012bdbe03SJim Radford device_remove_file(&port->dev, &dev_attr_latency_timer); 14911da177e4SLinus Torvalds } 14921da177e4SLinus Torvalds } 14931da177e4SLinus Torvalds 14941da177e4SLinus Torvalds } 14951da177e4SLinus Torvalds 14961da177e4SLinus Torvalds /* 14971da177e4SLinus Torvalds * *************************************************************************** 14981da177e4SLinus Torvalds * FTDI driver specific functions 14991da177e4SLinus Torvalds * *************************************************************************** 15001da177e4SLinus Torvalds */ 15011da177e4SLinus Torvalds 15028f977e42SIan Abbott /* Probe function to check for special devices */ 1503464cbb24SAlan Cox static int ftdi_sio_probe(struct usb_serial *serial, 1504464cbb24SAlan Cox const struct usb_device_id *id) 15058f977e42SIan Abbott { 1506464cbb24SAlan Cox struct ftdi_sio_quirk *quirk = 1507464cbb24SAlan Cox (struct ftdi_sio_quirk *)id->driver_info; 1508fa91d43bSTony Lindgren 1509fa91d43bSTony Lindgren if (quirk && quirk->probe) { 1510fa91d43bSTony Lindgren int ret = quirk->probe(serial); 1511fa91d43bSTony Lindgren if (ret != 0) 1512fa91d43bSTony Lindgren return ret; 1513fa91d43bSTony Lindgren } 1514fa91d43bSTony Lindgren 15158f977e42SIan Abbott usb_set_serial_data(serial, (void *)id->driver_info); 15168f977e42SIan Abbott 1517fa91d43bSTony Lindgren return 0; 15188f977e42SIan Abbott } 15198f977e42SIan Abbott 152012bdbe03SJim Radford static int ftdi_sio_port_probe(struct usb_serial_port *port) 15211da177e4SLinus Torvalds { 15221da177e4SLinus Torvalds struct ftdi_private *priv; 15230ffbbe25SOliver Neukum struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial); 15240ffbbe25SOliver Neukum 15251da177e4SLinus Torvalds 1526441b62c1SHarvey Harrison dbg("%s", __func__); 15271da177e4SLinus Torvalds 152880b6ca48SEric Sesterhenn priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); 15291da177e4SLinus Torvalds if (!priv) { 1530194343d9SGreg Kroah-Hartman dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__, 1531464cbb24SAlan Cox sizeof(struct ftdi_private)); 15321da177e4SLinus Torvalds return -ENOMEM; 15331da177e4SLinus Torvalds } 15341da177e4SLinus Torvalds 1535c45d6320SAlan Stern kref_init(&priv->kref); 1536bd09a9f5SAlessio Igor Bogani mutex_init(&priv->cfg_lock); 15371da177e4SLinus Torvalds init_waitqueue_head(&priv->delta_msr_wait); 15380076b4beSJohan Hovold 15391da177e4SLinus Torvalds priv->flags = ASYNC_LOW_LATENCY; 15401da177e4SLinus Torvalds 15410ffbbe25SOliver Neukum if (quirk && quirk->port_probe) 15420ffbbe25SOliver Neukum quirk->port_probe(priv); 15430ffbbe25SOliver Neukum 1544c4028958SDavid Howells priv->port = port; 154512bdbe03SJim Radford usb_set_serial_port_data(port, priv); 15461da177e4SLinus Torvalds 154712bdbe03SJim Radford ftdi_determine_type(port); 1548895f28baSMark Adamson ftdi_set_max_packet_size(port); 15498c4f99cdSJohan Hovold if (read_latency_timer(port) < 0) 15508c4f99cdSJohan Hovold priv->latency = 16; 155112bdbe03SJim Radford create_sysfs_attrs(port); 155212bdbe03SJim Radford return 0; 15531da177e4SLinus Torvalds } 15541da177e4SLinus Torvalds 15558f977e42SIan Abbott /* Setup for the USB-UIRT device, which requires hardwired 15568f977e42SIan Abbott * baudrate (38400 gets mapped to 312500) */ 15571da177e4SLinus Torvalds /* Called from usbserial:serial_probe */ 15580ffbbe25SOliver Neukum static void ftdi_USB_UIRT_setup(struct ftdi_private *priv) 15591da177e4SLinus Torvalds { 1560441b62c1SHarvey Harrison dbg("%s", __func__); 15611da177e4SLinus Torvalds 15621da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 15631da177e4SLinus Torvalds priv->custom_divisor = 77; 1564669a6db1SAlan Cox priv->force_baud = 38400; 1565e49bbce1SJohan Hovold } 15661da177e4SLinus Torvalds 15678f977e42SIan Abbott /* Setup for the HE-TIRA1 device, which requires hardwired 15688f977e42SIan Abbott * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */ 1569464cbb24SAlan Cox 15700ffbbe25SOliver Neukum static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv) 15718f977e42SIan Abbott { 1572441b62c1SHarvey Harrison dbg("%s", __func__); 15731da177e4SLinus Torvalds 15741da177e4SLinus Torvalds priv->flags |= ASYNC_SPD_CUST; 15751da177e4SLinus Torvalds priv->custom_divisor = 240; 1576669a6db1SAlan Cox priv->force_baud = 38400; 15771da177e4SLinus Torvalds priv->force_rtscts = 1; 1578e49bbce1SJohan Hovold } 15791da177e4SLinus Torvalds 1580fa91d43bSTony Lindgren /* 1581b760dac2SMartin Geleynse * Module parameter to control latency timer for NDI FTDI-based USB devices. 1582b760dac2SMartin Geleynse * If this value is not set in modprobe.conf.local its value will be set to 1ms. 1583b760dac2SMartin Geleynse */ 1584b760dac2SMartin Geleynse static int ndi_latency_timer = 1; 1585b760dac2SMartin Geleynse 1586b760dac2SMartin Geleynse /* Setup for the NDI FTDI-based USB devices, which requires hardwired 1587b760dac2SMartin Geleynse * baudrate (19200 gets mapped to 1200000). 1588b760dac2SMartin Geleynse * 1589b760dac2SMartin Geleynse * Called from usbserial:serial_probe. 1590b760dac2SMartin Geleynse */ 1591b760dac2SMartin Geleynse static int ftdi_NDI_device_setup(struct usb_serial *serial) 1592b760dac2SMartin Geleynse { 1593b760dac2SMartin Geleynse struct usb_device *udev = serial->dev; 1594b760dac2SMartin Geleynse int latency = ndi_latency_timer; 1595b760dac2SMartin Geleynse 1596b760dac2SMartin Geleynse if (latency == 0) 1597b760dac2SMartin Geleynse latency = 1; 1598b760dac2SMartin Geleynse if (latency > 99) 1599b760dac2SMartin Geleynse latency = 99; 1600b760dac2SMartin Geleynse 1601b760dac2SMartin Geleynse dbg("%s setting NDI device latency to %d", __func__, latency); 1602b760dac2SMartin Geleynse dev_info(&udev->dev, "NDI device with a latency value of %d", latency); 1603b760dac2SMartin Geleynse 1604c1284d77SJohan Hovold /* FIXME: errors are not returned */ 1605c1284d77SJohan Hovold usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 1606b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1607b760dac2SMartin Geleynse FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 160866e47e60SJohan Hovold latency, 0, NULL, 0, WDR_TIMEOUT); 1609b760dac2SMartin Geleynse return 0; 1610b760dac2SMartin Geleynse } 1611b760dac2SMartin Geleynse 1612b760dac2SMartin Geleynse /* 161320734345SHarald Welte * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 161420734345SHarald Welte * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 161520734345SHarald Welte * userspace using openocd. 1616fa91d43bSTony Lindgren */ 161720734345SHarald Welte static int ftdi_jtag_probe(struct usb_serial *serial) 1618fa91d43bSTony Lindgren { 1619fa91d43bSTony Lindgren struct usb_device *udev = serial->dev; 1620fa91d43bSTony Lindgren struct usb_interface *interface = serial->interface; 1621fa91d43bSTony Lindgren 1622441b62c1SHarvey Harrison dbg("%s", __func__); 1623fa91d43bSTony Lindgren 1624fa91d43bSTony Lindgren if (interface == udev->actconfig->interface[0]) { 1625c197a8dbSGreg Kroah-Hartman dev_info(&udev->dev, 1626c197a8dbSGreg Kroah-Hartman "Ignoring serial port reserved for JTAG\n"); 1627fa91d43bSTony Lindgren return -ENODEV; 1628fa91d43bSTony Lindgren } 1629fa91d43bSTony Lindgren 1630fa91d43bSTony Lindgren return 0; 1631fa91d43bSTony Lindgren } 16321da177e4SLinus Torvalds 1633546d7eecSKevin Vance /* 1634546d7eecSKevin Vance * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. 1635546d7eecSKevin Vance * We have to correct it if we want to read from it. 1636546d7eecSKevin Vance */ 1637546d7eecSKevin Vance static int ftdi_mtxorb_hack_setup(struct usb_serial *serial) 1638546d7eecSKevin Vance { 1639546d7eecSKevin Vance struct usb_host_endpoint *ep = serial->dev->ep_in[1]; 1640546d7eecSKevin Vance struct usb_endpoint_descriptor *ep_desc = &ep->desc; 1641546d7eecSKevin Vance 1642546d7eecSKevin Vance if (ep->enabled && ep_desc->wMaxPacketSize == 0) { 1643fd05e720SAl Viro ep_desc->wMaxPacketSize = cpu_to_le16(0x40); 1644c197a8dbSGreg Kroah-Hartman dev_info(&serial->dev->dev, 1645c197a8dbSGreg Kroah-Hartman "Fixing invalid wMaxPacketSize on read pipe\n"); 1646546d7eecSKevin Vance } 1647546d7eecSKevin Vance 1648546d7eecSKevin Vance return 0; 1649546d7eecSKevin Vance } 1650546d7eecSKevin Vance 1651c45d6320SAlan Stern static void ftdi_sio_priv_release(struct kref *k) 1652c45d6320SAlan Stern { 1653c45d6320SAlan Stern struct ftdi_private *priv = container_of(k, struct ftdi_private, kref); 1654c45d6320SAlan Stern 1655c45d6320SAlan Stern kfree(priv); 1656c45d6320SAlan Stern } 1657c45d6320SAlan Stern 165812bdbe03SJim Radford static int ftdi_sio_port_remove(struct usb_serial_port *port) 165912bdbe03SJim Radford { 16601da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 16611da177e4SLinus Torvalds 1662441b62c1SHarvey Harrison dbg("%s", __func__); 16631da177e4SLinus Torvalds 166412bdbe03SJim Radford remove_sysfs_attrs(port); 16651da177e4SLinus Torvalds 1666c45d6320SAlan Stern kref_put(&priv->kref, ftdi_sio_priv_release); 16671da177e4SLinus Torvalds 166812bdbe03SJim Radford return 0; 166912bdbe03SJim Radford } 16701da177e4SLinus Torvalds 1671a509a7e4SAlan Cox static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) 1672e49bbce1SJohan Hovold { 16731da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 16741da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1675c1284d77SJohan Hovold int result; 16761da177e4SLinus Torvalds 1677441b62c1SHarvey Harrison dbg("%s", __func__); 16781da177e4SLinus Torvalds 1679557aaa7fSAlan Cox write_latency_timer(port); 1680557aaa7fSAlan Cox 16811da177e4SLinus Torvalds /* No error checking for this (will get errors later anyway) */ 16821da177e4SLinus Torvalds /* See ftdi_sio.h for description of what is reset */ 16831da177e4SLinus Torvalds usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 16841da177e4SLinus Torvalds FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 16851da177e4SLinus Torvalds FTDI_SIO_RESET_SIO, 168666e47e60SJohan Hovold priv->interface, NULL, 0, WDR_TIMEOUT); 16871da177e4SLinus Torvalds 16881da177e4SLinus Torvalds /* Termios defaults are set by usb_serial_init. We don't change 1689c4f01240SNick Andrew port->tty->termios - this would lose speed settings, etc. 16901da177e4SLinus Torvalds This is same behaviour as serial.c/rs_open() - Kuba */ 16911da177e4SLinus Torvalds 16921da177e4SLinus Torvalds /* ftdi_set_termios will send usb control messages */ 169395da310eSAlan Cox if (tty) 169495da310eSAlan Cox ftdi_set_termios(tty, port, tty->termios); 16951da177e4SLinus Torvalds 16961da177e4SLinus Torvalds /* Start reading from the device */ 16971b551015SJohan Hovold result = usb_serial_generic_open(tty, port); 1698cc01f17dSJohan Hovold if (!result) 1699c45d6320SAlan Stern kref_get(&priv->kref); 17001da177e4SLinus Torvalds 17011da177e4SLinus Torvalds return result; 1702e49bbce1SJohan Hovold } 17031da177e4SLinus Torvalds 1704335f8514SAlan Cox static void ftdi_dtr_rts(struct usb_serial_port *port, int on) 1705335f8514SAlan Cox { 1706335f8514SAlan Cox struct ftdi_private *priv = usb_get_serial_port_data(port); 1707335f8514SAlan Cox 1708335f8514SAlan Cox mutex_lock(&port->serial->disc_mutex); 1709335f8514SAlan Cox if (!port->serial->disconnected) { 1710335f8514SAlan Cox /* Disable flow control */ 1711335f8514SAlan Cox if (!on && usb_control_msg(port->serial->dev, 1712335f8514SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 1713335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST, 1714335f8514SAlan Cox FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 171566e47e60SJohan Hovold 0, priv->interface, NULL, 0, 1716335f8514SAlan Cox WDR_TIMEOUT) < 0) { 1717335f8514SAlan Cox dev_err(&port->dev, "error from flowcontrol urb\n"); 1718335f8514SAlan Cox } 1719335f8514SAlan Cox /* drop RTS and DTR */ 1720335f8514SAlan Cox if (on) 1721335f8514SAlan Cox set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1722335f8514SAlan Cox else 1723335f8514SAlan Cox clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1724335f8514SAlan Cox } 1725335f8514SAlan Cox mutex_unlock(&port->serial->disc_mutex); 1726335f8514SAlan Cox } 17271da177e4SLinus Torvalds 17281da177e4SLinus Torvalds /* 17291da177e4SLinus Torvalds * usbserial:__serial_close only calls ftdi_close if the point is open 17301da177e4SLinus Torvalds * 17311da177e4SLinus Torvalds * This only gets called when it is the last close 17321da177e4SLinus Torvalds */ 1733335f8514SAlan Cox static void ftdi_close(struct usb_serial_port *port) 1734e49bbce1SJohan Hovold { 17351da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 17361da177e4SLinus Torvalds 1737441b62c1SHarvey Harrison dbg("%s", __func__); 17381da177e4SLinus Torvalds 1739c23e5fc1SJohan Hovold usb_serial_generic_close(port); 1740c45d6320SAlan Stern kref_put(&priv->kref, ftdi_sio_priv_release); 1741e49bbce1SJohan Hovold } 17421da177e4SLinus Torvalds 17431da177e4SLinus Torvalds /* The SIO requires the first byte to have: 17441da177e4SLinus Torvalds * B0 1 17451da177e4SLinus Torvalds * B1 0 17461da177e4SLinus Torvalds * B2..7 length of message excluding byte 0 17471da177e4SLinus Torvalds * 17481da177e4SLinus Torvalds * The new devices do not require this byte 17491da177e4SLinus Torvalds */ 1750d3901a06SJohan Hovold static int ftdi_prepare_write_buffer(struct usb_serial_port *port, 1751c23e5fc1SJohan Hovold void *dest, size_t size) 1752e49bbce1SJohan Hovold { 1753d3901a06SJohan Hovold struct ftdi_private *priv; 1754c23e5fc1SJohan Hovold int count; 1755c23e5fc1SJohan Hovold unsigned long flags; 17561da177e4SLinus Torvalds 1757d3901a06SJohan Hovold priv = usb_get_serial_port_data(port); 17581da177e4SLinus Torvalds 1759e8770484SJohan Hovold if (priv->chip_type == SIO) { 1760c23e5fc1SJohan Hovold unsigned char *buffer = dest; 1761c23e5fc1SJohan Hovold int i, len, c; 17621da177e4SLinus Torvalds 1763c23e5fc1SJohan Hovold count = 0; 1764c23e5fc1SJohan Hovold spin_lock_irqsave(&port->lock, flags); 1765c23e5fc1SJohan Hovold for (i = 0; i < size - 1; i += priv->max_packet_size) { 1766c23e5fc1SJohan Hovold len = min_t(int, size - i, priv->max_packet_size) - 1; 1767c23e5fc1SJohan Hovold c = kfifo_out(&port->write_fifo, &buffer[i + 1], len); 1768c23e5fc1SJohan Hovold if (!c) 1769c23e5fc1SJohan Hovold break; 1770c1aa075aSJohan Hovold buffer[i] = (c << 2) + 1; 1771c23e5fc1SJohan Hovold count += c + 1; 17721da177e4SLinus Torvalds } 1773c23e5fc1SJohan Hovold spin_unlock_irqrestore(&port->lock, flags); 17741da177e4SLinus Torvalds } else { 1775c23e5fc1SJohan Hovold count = kfifo_out_locked(&port->write_fifo, dest, size, 1776c23e5fc1SJohan Hovold &port->lock); 17771da177e4SLinus Torvalds } 17781da177e4SLinus Torvalds 17791da177e4SLinus Torvalds return count; 178095da310eSAlan Cox } 17811da177e4SLinus Torvalds 1782166ceb69SJohan Hovold #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) 1783166ceb69SJohan Hovold 1784cc01f17dSJohan Hovold static int ftdi_process_packet(struct tty_struct *tty, 1785cc01f17dSJohan Hovold struct usb_serial_port *port, struct ftdi_private *priv, 1786cc01f17dSJohan Hovold char *packet, int len) 178795da310eSAlan Cox { 17881da177e4SLinus Torvalds int i; 1789cc01f17dSJohan Hovold char status; 1790cc01f17dSJohan Hovold char flag; 1791cc01f17dSJohan Hovold char *ch; 17921da177e4SLinus Torvalds 1793441b62c1SHarvey Harrison dbg("%s - port %d", __func__, port->number); 17941da177e4SLinus Torvalds 1795cc01f17dSJohan Hovold if (len < 2) { 1796cc01f17dSJohan Hovold dbg("malformed packet"); 1797cc01f17dSJohan Hovold return 0; 17981da177e4SLinus Torvalds } 17991da177e4SLinus Torvalds 1800464cbb24SAlan Cox /* Compare new line status to the old one, signal if different/ 1801464cbb24SAlan Cox N.B. packet may be processed more than once, but differences 1802464cbb24SAlan Cox are only processed once. */ 1803cc01f17dSJohan Hovold status = packet[0] & FTDI_STATUS_B0_MASK; 1804cc01f17dSJohan Hovold if (status != priv->prev_status) { 1805cc01f17dSJohan Hovold priv->diff_status |= status ^ priv->prev_status; 18061da177e4SLinus Torvalds wake_up_interruptible(&priv->delta_msr_wait); 1807cc01f17dSJohan Hovold priv->prev_status = status; 18081da177e4SLinus Torvalds } 18091da177e4SLinus Torvalds 1810cc01f17dSJohan Hovold flag = TTY_NORMAL; 1811166ceb69SJohan Hovold if (packet[1] & FTDI_RS_ERR_MASK) { 1812166ceb69SJohan Hovold /* Break takes precedence over parity, which takes precedence 1813166ceb69SJohan Hovold * over framing errors */ 1814cc01f17dSJohan Hovold if (packet[1] & FTDI_RS_BI) { 1815cc01f17dSJohan Hovold flag = TTY_BREAK; 181672fda3caSJason Wessel usb_serial_handle_break(port); 1817166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_PE) { 1818cc01f17dSJohan Hovold flag = TTY_PARITY; 1819166ceb69SJohan Hovold } else if (packet[1] & FTDI_RS_FE) { 1820cc01f17dSJohan Hovold flag = TTY_FRAME; 1821166ceb69SJohan Hovold } 1822166ceb69SJohan Hovold /* Overrun is special, not associated with a char */ 1823166ceb69SJohan Hovold if (packet[1] & FTDI_RS_OE) 1824166ceb69SJohan Hovold tty_insert_flip_char(tty, 0, TTY_OVERRUN); 18251da177e4SLinus Torvalds } 18261da177e4SLinus Torvalds 1827cc01f17dSJohan Hovold len -= 2; 1828cc01f17dSJohan Hovold if (!len) 1829cc01f17dSJohan Hovold return 0; /* status only */ 1830cc01f17dSJohan Hovold ch = packet + 2; 1831cc01f17dSJohan Hovold 183249b2597aSJohan Hovold if (port->port.console && port->sysrq) { 1833cc01f17dSJohan Hovold for (i = 0; i < len; i++, ch++) { 1834cc01f17dSJohan Hovold if (!usb_serial_handle_sysrq_char(tty, port, *ch)) 1835cc01f17dSJohan Hovold tty_insert_flip_char(tty, *ch, flag); 1836cc01f17dSJohan Hovold } 183749b2597aSJohan Hovold } else { 183849b2597aSJohan Hovold tty_insert_flip_string_fixed_flag(tty, ch, flag, len); 1839cc01f17dSJohan Hovold } 184049b2597aSJohan Hovold 1841cc01f17dSJohan Hovold return len; 1842cc01f17dSJohan Hovold } 1843cc01f17dSJohan Hovold 18441b551015SJohan Hovold static void ftdi_process_read_urb(struct urb *urb) 1845cc01f17dSJohan Hovold { 18461b551015SJohan Hovold struct usb_serial_port *port = urb->context; 1847cc01f17dSJohan Hovold struct tty_struct *tty; 1848cc01f17dSJohan Hovold struct ftdi_private *priv = usb_get_serial_port_data(port); 1849cc01f17dSJohan Hovold char *data = (char *)urb->transfer_buffer; 1850cc01f17dSJohan Hovold int i; 1851cc01f17dSJohan Hovold int len; 1852cc01f17dSJohan Hovold int count = 0; 1853cc01f17dSJohan Hovold 1854cc01f17dSJohan Hovold tty = tty_port_tty_get(&port->port); 1855cc01f17dSJohan Hovold if (!tty) 1856cc01f17dSJohan Hovold return; 1857cc01f17dSJohan Hovold 1858cc01f17dSJohan Hovold for (i = 0; i < urb->actual_length; i += priv->max_packet_size) { 1859cc01f17dSJohan Hovold len = min_t(int, urb->actual_length - i, priv->max_packet_size); 1860cc01f17dSJohan Hovold count += ftdi_process_packet(tty, port, priv, &data[i], len); 1861cc01f17dSJohan Hovold } 1862cc01f17dSJohan Hovold 1863cc01f17dSJohan Hovold if (count) 18641da177e4SLinus Torvalds tty_flip_buffer_push(tty); 18654a90f09bSAlan Cox tty_kref_put(tty); 1866cc01f17dSJohan Hovold } 18671da177e4SLinus Torvalds 186895da310eSAlan Cox static void ftdi_break_ctl(struct tty_struct *tty, int break_state) 18691da177e4SLinus Torvalds { 187095da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 18711da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 1872c1284d77SJohan Hovold __u16 urb_value; 18731da177e4SLinus Torvalds 18741da177e4SLinus Torvalds /* break_state = -1 to turn on break, and 0 to turn off break */ 18751da177e4SLinus Torvalds /* see drivers/char/tty_io.c to see it used */ 18761da177e4SLinus Torvalds /* last_set_data_urb_value NEVER has the break bit set in it */ 18771da177e4SLinus Torvalds 1878464cbb24SAlan Cox if (break_state) 18791da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK; 1880464cbb24SAlan Cox else 18811da177e4SLinus Torvalds urb_value = priv->last_set_data_urb_value; 18821da177e4SLinus Torvalds 1883464cbb24SAlan Cox if (usb_control_msg(port->serial->dev, 1884464cbb24SAlan Cox usb_sndctrlpipe(port->serial->dev, 0), 18851da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 18861da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 18871da177e4SLinus Torvalds urb_value , priv->interface, 188866e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 1889194343d9SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to enable/disable break state " 1890194343d9SGreg Kroah-Hartman "(state was %d)\n", __func__, break_state); 18911da177e4SLinus Torvalds } 18921da177e4SLinus Torvalds 1893464cbb24SAlan Cox dbg("%s break state is %d - urb is %d", __func__, 1894464cbb24SAlan Cox break_state, urb_value); 18951da177e4SLinus Torvalds 18961da177e4SLinus Torvalds } 18971da177e4SLinus Torvalds 18981da177e4SLinus Torvalds /* old_termios contains the original termios settings and tty->termios contains 18991da177e4SLinus Torvalds * the new setting to be used 19001da177e4SLinus Torvalds * WARNING: set_termios calls this with old_termios in kernel space 19011da177e4SLinus Torvalds */ 190295da310eSAlan Cox static void ftdi_set_termios(struct tty_struct *tty, 190395da310eSAlan Cox struct usb_serial_port *port, struct ktermios *old_termios) 1904e49bbce1SJohan Hovold { 19051da177e4SLinus Torvalds struct usb_device *dev = port->serial->dev; 19061da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 190795da310eSAlan Cox struct ktermios *termios = tty->termios; 1908669a6db1SAlan Cox unsigned int cflag = termios->c_cflag; 19091da177e4SLinus Torvalds __u16 urb_value; /* will hold the new flags */ 19101da177e4SLinus Torvalds 1911464cbb24SAlan Cox /* Added for xon/xoff support */ 1912669a6db1SAlan Cox unsigned int iflag = termios->c_iflag; 19131da177e4SLinus Torvalds unsigned char vstop; 19141da177e4SLinus Torvalds unsigned char vstart; 19151da177e4SLinus Torvalds 1916441b62c1SHarvey Harrison dbg("%s", __func__); 19171da177e4SLinus Torvalds 1918464cbb24SAlan Cox /* Force baud rate if this device requires it, unless it is set to 1919464cbb24SAlan Cox B0. */ 1920669a6db1SAlan Cox if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { 1921441b62c1SHarvey Harrison dbg("%s: forcing baud rate for this device", __func__); 192295da310eSAlan Cox tty_encode_baud_rate(tty, priv->force_baud, 1923bd5e47ccSAndrew Morton priv->force_baud); 19241da177e4SLinus Torvalds } 19251da177e4SLinus Torvalds 19261da177e4SLinus Torvalds /* Force RTS-CTS if this device requires it. */ 19271da177e4SLinus Torvalds if (priv->force_rtscts) { 1928441b62c1SHarvey Harrison dbg("%s: forcing rtscts for this device", __func__); 1929669a6db1SAlan Cox termios->c_cflag |= CRTSCTS; 19301da177e4SLinus Torvalds } 19311da177e4SLinus Torvalds 1932669a6db1SAlan Cox cflag = termios->c_cflag; 19331da177e4SLinus Torvalds 19341da177e4SLinus Torvalds /* FIXME -For this cut I don't care if the line is really changing or 19351da177e4SLinus Torvalds not - so just do the change regardless - should be able to 19361da177e4SLinus Torvalds compare old_termios and tty->termios */ 19371da177e4SLinus Torvalds /* NOTE These routines can get interrupted by 1938464cbb24SAlan Cox ftdi_sio_read_bulk_callback - need to examine what this means - 1939464cbb24SAlan Cox don't see any problems yet */ 19401da177e4SLinus Torvalds 19411da177e4SLinus Torvalds /* Set number of data bits, parity, stop bits */ 19421da177e4SLinus Torvalds 19431da177e4SLinus Torvalds urb_value = 0; 19441da177e4SLinus Torvalds urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : 19451da177e4SLinus Torvalds FTDI_SIO_SET_DATA_STOP_BITS_1); 194638fcb830SRoland Koebler if (cflag & PARENB) { 194738fcb830SRoland Koebler if (cflag & CMSPAR) 194838fcb830SRoland Koebler urb_value |= cflag & PARODD ? 194938fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_MARK : 195038fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_SPACE; 195138fcb830SRoland Koebler else 195238fcb830SRoland Koebler urb_value |= cflag & PARODD ? 195338fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_ODD : 195438fcb830SRoland Koebler FTDI_SIO_SET_DATA_PARITY_EVEN; 195538fcb830SRoland Koebler } else { 195638fcb830SRoland Koebler urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; 195738fcb830SRoland Koebler } 19581da177e4SLinus Torvalds if (cflag & CSIZE) { 19591da177e4SLinus Torvalds switch (cflag & CSIZE) { 19601da177e4SLinus Torvalds case CS7: urb_value |= 7; dbg("Setting CS7"); break; 19611da177e4SLinus Torvalds case CS8: urb_value |= 8; dbg("Setting CS8"); break; 19621da177e4SLinus Torvalds default: 1963cabe6cc2SMark Adamson dev_err(&port->dev, "CSIZE was set but not CS7-CS8\n"); 19641da177e4SLinus Torvalds } 19651da177e4SLinus Torvalds } 19661da177e4SLinus Torvalds 1967464cbb24SAlan Cox /* This is needed by the break command since it uses the same command 1968464cbb24SAlan Cox - but is or'ed with this value */ 19691da177e4SLinus Torvalds priv->last_set_data_urb_value = urb_value; 19701da177e4SLinus Torvalds 19711da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 19721da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST, 19731da177e4SLinus Torvalds FTDI_SIO_SET_DATA_REQUEST_TYPE, 19741da177e4SLinus Torvalds urb_value , priv->interface, 197566e47e60SJohan Hovold NULL, 0, WDR_SHORT_TIMEOUT) < 0) { 1976194343d9SGreg Kroah-Hartman dev_err(&port->dev, "%s FAILED to set " 1977194343d9SGreg Kroah-Hartman "databits/stopbits/parity\n", __func__); 19781da177e4SLinus Torvalds } 19791da177e4SLinus Torvalds 19801da177e4SLinus Torvalds /* Now do the baudrate */ 19811da177e4SLinus Torvalds if ((cflag & CBAUD) == B0) { 19821da177e4SLinus Torvalds /* Disable flow control */ 19831da177e4SLinus Torvalds if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 19841da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 19851da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 19861da177e4SLinus Torvalds 0, priv->interface, 198766e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 1988194343d9SGreg Kroah-Hartman dev_err(&port->dev, 1989194343d9SGreg Kroah-Hartman "%s error from disable flowcontrol urb\n", 1990194343d9SGreg Kroah-Hartman __func__); 19911da177e4SLinus Torvalds } 19921da177e4SLinus Torvalds /* Drop RTS and DTR */ 199374ede0ffSIan Abbott clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 19941da177e4SLinus Torvalds } else { 19951da177e4SLinus Torvalds /* set the baudrate determined before */ 19969c67d28eSAlessio Igor Bogani mutex_lock(&priv->cfg_lock); 1997464cbb24SAlan Cox if (change_speed(tty, port)) 1998194343d9SGreg Kroah-Hartman dev_err(&port->dev, "%s urb failed to set baudrate\n", 1999194343d9SGreg Kroah-Hartman __func__); 20009c67d28eSAlessio Igor Bogani mutex_unlock(&priv->cfg_lock); 200172a755fcSPeter Favrholdt /* Ensure RTS and DTR are raised when baudrate changed from 0 */ 2002464cbb24SAlan Cox if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) 200374ede0ffSIan Abbott set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 20041da177e4SLinus Torvalds } 20051da177e4SLinus Torvalds 20061da177e4SLinus Torvalds /* Set flow control */ 20071da177e4SLinus Torvalds /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ 20081da177e4SLinus Torvalds if (cflag & CRTSCTS) { 2009441b62c1SHarvey Harrison dbg("%s Setting to CRTSCTS flow control", __func__); 20101da177e4SLinus Torvalds if (usb_control_msg(dev, 20111da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 20121da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 20131da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 20141da177e4SLinus Torvalds 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), 201566e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2016194343d9SGreg Kroah-Hartman dev_err(&port->dev, 2017194343d9SGreg Kroah-Hartman "urb failed to set to rts/cts flow control\n"); 20181da177e4SLinus Torvalds } 20191da177e4SLinus Torvalds 20206a1a82dfSDaniel Mack /* raise DTR/RTS */ 20216a1a82dfSDaniel Mack set_mctrl(port, TIOCM_DTR | TIOCM_RTS); 20221da177e4SLinus Torvalds } else { 20231da177e4SLinus Torvalds /* 20241da177e4SLinus Torvalds * Xon/Xoff code 20251da177e4SLinus Torvalds * 2026464cbb24SAlan Cox * Check the IXOFF status in the iflag component of the 2027464cbb24SAlan Cox * termios structure. If IXOFF is not set, the pre-xon/xoff 2028464cbb24SAlan Cox * code is executed. 20291da177e4SLinus Torvalds */ 20301da177e4SLinus Torvalds if (iflag & IXOFF) { 2031464cbb24SAlan Cox dbg("%s request to enable xonxoff iflag=%04x", 2032464cbb24SAlan Cox __func__, iflag); 2033464cbb24SAlan Cox /* Try to enable the XON/XOFF on the ftdi_sio 2034464cbb24SAlan Cox * Set the vstart and vstop -- could have been done up 2035464cbb24SAlan Cox * above where a lot of other dereferencing is done but 2036464cbb24SAlan Cox * that would be very inefficient as vstart and vstop 2037464cbb24SAlan Cox * are not always needed. 2038464cbb24SAlan Cox */ 2039669a6db1SAlan Cox vstart = termios->c_cc[VSTART]; 2040669a6db1SAlan Cox vstop = termios->c_cc[VSTOP]; 20411da177e4SLinus Torvalds urb_value = (vstop << 8) | (vstart); 20421da177e4SLinus Torvalds 20431da177e4SLinus Torvalds if (usb_control_msg(dev, 20441da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 20451da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 20461da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 20471da177e4SLinus Torvalds urb_value , (FTDI_SIO_XON_XOFF_HS 20481da177e4SLinus Torvalds | priv->interface), 204966e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2050194343d9SGreg Kroah-Hartman dev_err(&port->dev, "urb failed to set to " 2051194343d9SGreg Kroah-Hartman "xon/xoff flow control\n"); 20521da177e4SLinus Torvalds } 20531da177e4SLinus Torvalds } else { 2054464cbb24SAlan Cox /* else clause to only run if cflag ! CRTSCTS and iflag 2055464cbb24SAlan Cox * ! XOFF. CHECKME Assuming XON/XOFF handled by tty 2056464cbb24SAlan Cox * stack - not by device */ 2057441b62c1SHarvey Harrison dbg("%s Turning off hardware flow control", __func__); 20581da177e4SLinus Torvalds if (usb_control_msg(dev, 20591da177e4SLinus Torvalds usb_sndctrlpipe(dev, 0), 20601da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST, 20611da177e4SLinus Torvalds FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 20621da177e4SLinus Torvalds 0, priv->interface, 206366e47e60SJohan Hovold NULL, 0, WDR_TIMEOUT) < 0) { 2064194343d9SGreg Kroah-Hartman dev_err(&port->dev, 2065194343d9SGreg Kroah-Hartman "urb failed to clear flow control\n"); 20661da177e4SLinus Torvalds } 20671da177e4SLinus Torvalds } 20681da177e4SLinus Torvalds 20696a1a82dfSDaniel Mack /* lower DTR/RTS */ 20706a1a82dfSDaniel Mack clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 20711da177e4SLinus Torvalds } 20721da177e4SLinus Torvalds return; 207395da310eSAlan Cox } 20741da177e4SLinus Torvalds 207595da310eSAlan Cox static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) 20761da177e4SLinus Torvalds { 207795da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 20781da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 207966e47e60SJohan Hovold unsigned char *buf; 2080a3f8168bSJohan Hovold int len; 20811da177e4SLinus Torvalds int ret; 20821da177e4SLinus Torvalds 2083441b62c1SHarvey Harrison dbg("%s TIOCMGET", __func__); 208466e47e60SJohan Hovold 208566e47e60SJohan Hovold buf = kmalloc(2, GFP_KERNEL); 208666e47e60SJohan Hovold if (!buf) 208766e47e60SJohan Hovold return -ENOMEM; 2088a3f8168bSJohan Hovold /* 2089a3f8168bSJohan Hovold * The 8U232AM returns a two byte value (the SIO a 1 byte value) in 2090a3f8168bSJohan Hovold * the same format as the data returned from the in point. 2091a3f8168bSJohan Hovold */ 20921da177e4SLinus Torvalds switch (priv->chip_type) { 20931da177e4SLinus Torvalds case SIO: 2094a3f8168bSJohan Hovold len = 1; 20951da177e4SLinus Torvalds break; 20961da177e4SLinus Torvalds case FT8U232AM: 20971da177e4SLinus Torvalds case FT232BM: 20981da177e4SLinus Torvalds case FT2232C: 2099ed6e5282SAndrew M. Bishop case FT232RL: 2100094c2e6dSMark Adamson case FT2232H: 2101094c2e6dSMark Adamson case FT4232H: 2102a3f8168bSJohan Hovold len = 2; 21031da177e4SLinus Torvalds break; 21041da177e4SLinus Torvalds default: 210566e47e60SJohan Hovold ret = -EFAULT; 210666e47e60SJohan Hovold goto out; 21071da177e4SLinus Torvalds } 21081da177e4SLinus Torvalds 2109a3f8168bSJohan Hovold ret = usb_control_msg(port->serial->dev, 2110a3f8168bSJohan Hovold usb_rcvctrlpipe(port->serial->dev, 0), 2111a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST, 2112a3f8168bSJohan Hovold FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2113a3f8168bSJohan Hovold 0, priv->interface, 2114a3f8168bSJohan Hovold buf, len, WDR_TIMEOUT); 2115a3f8168bSJohan Hovold if (ret < 0) 2116a3f8168bSJohan Hovold goto out; 2117a3f8168bSJohan Hovold 211866e47e60SJohan Hovold ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 21191da177e4SLinus Torvalds (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 21201da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 21211da177e4SLinus Torvalds (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 21221da177e4SLinus Torvalds priv->last_dtr_rts; 212366e47e60SJohan Hovold out: 212466e47e60SJohan Hovold kfree(buf); 212566e47e60SJohan Hovold return ret; 21261da177e4SLinus Torvalds } 21271da177e4SLinus Torvalds 212895da310eSAlan Cox static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 212995da310eSAlan Cox unsigned int set, unsigned int clear) 21301da177e4SLinus Torvalds { 213195da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 2132441b62c1SHarvey Harrison dbg("%s TIOCMSET", __func__); 213374ede0ffSIan Abbott return update_mctrl(port, set, clear); 21341da177e4SLinus Torvalds } 21351da177e4SLinus Torvalds 2136464cbb24SAlan Cox static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 2137464cbb24SAlan Cox unsigned int cmd, unsigned long arg) 21381da177e4SLinus Torvalds { 213995da310eSAlan Cox struct usb_serial_port *port = tty->driver_data; 21401da177e4SLinus Torvalds struct ftdi_private *priv = usb_get_serial_port_data(port); 21411da177e4SLinus Torvalds 2142441b62c1SHarvey Harrison dbg("%s cmd 0x%04x", __func__, cmd); 21431da177e4SLinus Torvalds 21441da177e4SLinus Torvalds /* Based on code from acm.c and others */ 21451da177e4SLinus Torvalds switch (cmd) { 21461da177e4SLinus Torvalds 21471da177e4SLinus Torvalds case TIOCGSERIAL: /* gets serial port data */ 2148464cbb24SAlan Cox return get_serial_info(port, 2149464cbb24SAlan Cox (struct serial_struct __user *) arg); 21501da177e4SLinus Torvalds 21511da177e4SLinus Torvalds case TIOCSSERIAL: /* sets serial port data */ 2152464cbb24SAlan Cox return set_serial_info(tty, port, 2153464cbb24SAlan Cox (struct serial_struct __user *) arg); 21541da177e4SLinus Torvalds 21551da177e4SLinus Torvalds /* 21561da177e4SLinus Torvalds * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change 21571da177e4SLinus Torvalds * - mask passed in arg for lines of interest 21581da177e4SLinus Torvalds * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) 21591da177e4SLinus Torvalds * Caller should use TIOCGICOUNT to see which one it was. 21601da177e4SLinus Torvalds * 21611da177e4SLinus Torvalds * This code is borrowed from linux/drivers/char/serial.c 21621da177e4SLinus Torvalds */ 21631da177e4SLinus Torvalds case TIOCMIWAIT: 21641da177e4SLinus Torvalds while (priv != NULL) { 21651da177e4SLinus Torvalds interruptible_sleep_on(&priv->delta_msr_wait); 21661da177e4SLinus Torvalds /* see if a signal did it */ 21671da177e4SLinus Torvalds if (signal_pending(current)) 21681da177e4SLinus Torvalds return -ERESTARTSYS; 21691da177e4SLinus Torvalds else { 21701da177e4SLinus Torvalds char diff = priv->diff_status; 21711da177e4SLinus Torvalds 2172464cbb24SAlan Cox if (diff == 0) 21731da177e4SLinus Torvalds return -EIO; /* no change => error */ 21741da177e4SLinus Torvalds 21751da177e4SLinus Torvalds /* Consume all events */ 21761da177e4SLinus Torvalds priv->diff_status = 0; 21771da177e4SLinus Torvalds 2178464cbb24SAlan Cox /* Return 0 if caller wanted to know about 2179464cbb24SAlan Cox these bits */ 21801da177e4SLinus Torvalds if (((arg & TIOCM_RNG) && (diff & FTDI_RS0_RI)) || 21811da177e4SLinus Torvalds ((arg & TIOCM_DSR) && (diff & FTDI_RS0_DSR)) || 21821da177e4SLinus Torvalds ((arg & TIOCM_CD) && (diff & FTDI_RS0_RLSD)) || 21831da177e4SLinus Torvalds ((arg & TIOCM_CTS) && (diff & FTDI_RS0_CTS))) { 21841da177e4SLinus Torvalds return 0; 21851da177e4SLinus Torvalds } 21861da177e4SLinus Torvalds /* 2187464cbb24SAlan Cox * Otherwise caller can't care less about what 2188464cbb24SAlan Cox * happened,and so we continue to wait for more 2189464cbb24SAlan Cox * events. 21901da177e4SLinus Torvalds */ 21911da177e4SLinus Torvalds } 21921da177e4SLinus Torvalds } 219395da310eSAlan Cox return 0; 21941da177e4SLinus Torvalds default: 21951da177e4SLinus Torvalds break; 21961da177e4SLinus Torvalds } 2197464cbb24SAlan Cox /* This is not necessarily an error - turns out the higher layers 2198464cbb24SAlan Cox * will do some ioctls themselves (see comment above) 21991da177e4SLinus Torvalds */ 2200441b62c1SHarvey Harrison dbg("%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h", __func__, cmd); 220195da310eSAlan Cox return -ENOIOCTLCMD; 220295da310eSAlan Cox } 22031da177e4SLinus Torvalds 22041da177e4SLinus Torvalds static int __init ftdi_init(void) 22051da177e4SLinus Torvalds { 22061da177e4SLinus Torvalds int retval; 22071da177e4SLinus Torvalds 2208441b62c1SHarvey Harrison dbg("%s", __func__); 2209fdcb0a0fSIan Abbott if (vendor > 0 && product > 0) { 2210fdcb0a0fSIan Abbott /* Add user specified VID/PID to reserved element of table. */ 2211fdcb0a0fSIan Abbott int i; 2212fdcb0a0fSIan Abbott for (i = 0; id_table_combined[i].idVendor; i++) 2213fdcb0a0fSIan Abbott ; 2214fdcb0a0fSIan Abbott id_table_combined[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE; 2215fdcb0a0fSIan Abbott id_table_combined[i].idVendor = vendor; 2216fdcb0a0fSIan Abbott id_table_combined[i].idProduct = product; 2217fdcb0a0fSIan Abbott } 22188f977e42SIan Abbott retval = usb_serial_register(&ftdi_sio_device); 22191da177e4SLinus Torvalds if (retval) 22208f977e42SIan Abbott goto failed_sio_register; 22211da177e4SLinus Torvalds retval = usb_register(&ftdi_driver); 22221da177e4SLinus Torvalds if (retval) 22231da177e4SLinus Torvalds goto failed_usb_register; 22241da177e4SLinus Torvalds 2225c197a8dbSGreg Kroah-Hartman printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 2226c197a8dbSGreg Kroah-Hartman DRIVER_DESC "\n"); 22271da177e4SLinus Torvalds return 0; 22281da177e4SLinus Torvalds failed_usb_register: 22298f977e42SIan Abbott usb_serial_deregister(&ftdi_sio_device); 22308f977e42SIan Abbott failed_sio_register: 22311da177e4SLinus Torvalds return retval; 22321da177e4SLinus Torvalds } 22331da177e4SLinus Torvalds 22341da177e4SLinus Torvalds static void __exit ftdi_exit(void) 22351da177e4SLinus Torvalds { 2236441b62c1SHarvey Harrison dbg("%s", __func__); 22371da177e4SLinus Torvalds 22381da177e4SLinus Torvalds usb_deregister(&ftdi_driver); 22398f977e42SIan Abbott usb_serial_deregister(&ftdi_sio_device); 22401da177e4SLinus Torvalds } 22411da177e4SLinus Torvalds 22421da177e4SLinus Torvalds 22431da177e4SLinus Torvalds module_init(ftdi_init); 22441da177e4SLinus Torvalds module_exit(ftdi_exit); 22451da177e4SLinus Torvalds 22461da177e4SLinus Torvalds MODULE_AUTHOR(DRIVER_AUTHOR); 22471da177e4SLinus Torvalds MODULE_DESCRIPTION(DRIVER_DESC); 22481da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 22491da177e4SLinus Torvalds 22501da177e4SLinus Torvalds module_param(debug, bool, S_IRUGO | S_IWUSR); 22511da177e4SLinus Torvalds MODULE_PARM_DESC(debug, "Debug enabled or not"); 2252fdcb0a0fSIan Abbott module_param(vendor, ushort, 0); 2253fdcb0a0fSIan Abbott MODULE_PARM_DESC(vendor, "User specified vendor ID (default=" 2254fdcb0a0fSIan Abbott __MODULE_STRING(FTDI_VID)")"); 2255fdcb0a0fSIan Abbott module_param(product, ushort, 0); 225668265043SPaulius Zaleckas MODULE_PARM_DESC(product, "User specified product ID"); 22571da177e4SLinus Torvalds 2258b760dac2SMartin Geleynse module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR); 2259b760dac2SMartin Geleynse MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override"); 2260