summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
AgeCommit message (Collapse)AuthorFilesLines
2021-09-01Merge tag 'usb-serial-5.15-rc1-2' of ↵Greg Kroah-Hartman1-1/+1
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.15-rc1 Here are the USB serial updates for 5.15-rc1, including: - a couple of fixes for cp210x termios error handling - retrieval of fw revisions for more cp210x types - a switch to octal permissions for all module-parameter definitions Included are also various clean ups. All have been in linux-next with no reported issues. * tag 'usb-serial-5.15-rc1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: replace symbolic permissions by octal permissions USB: serial: cp210x: determine fw version for CP2105 and CP2108 USB: serial: cp210x: clean up type detection USB: serial: cp210x: clean up set-chars request USB: serial: cp210x: clean up control-request timeout USB: serial: cp210x: fix flow-control error handling USB: serial: cp210x: fix control-characters error handling USB: serial: io_edgeport: drop unused descriptor helper
2021-08-26USB: serial: replace symbolic permissions by octal permissionsUtkarsh Verma1-1/+1
Replace symbolic permission macros with octal permission numbers because octal permission numbers are easier to read and understand instead of their symbolic macro names. No functional change. Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Utkarsh Verma <utkarshverma294@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-08-05USB: serial: ftdi_sio: add device ID for Auto-M3 OP-COM v2David Bauer1-0/+1
The Auto-M3 OP-COM v2 is a OBD diagnostic device using a FTD232 for the USB connection. Signed-off-by: David Bauer <mail@david-bauer.net> Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
2021-06-05USB: serial: ftdi_sio: add NovaTech OrionMX product IDGeorge McCollister1-0/+1
Add PID for the NovaTech OrionMX so it can be automatically detected. Signed-off-by: George McCollister <george.mccollister@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
2021-05-10USB: serial: ftdi_sio: add IDs for IDS GmbH ProductsDominik Andreas Schorpp1-0/+3
Add the IDS GmbH Vendor ID and the Product IDs for SI31A (2xRS232) and CM31A (LoRaWAN Modem). Signed-off-by: Dominik Andreas Schorpp <dominik.a.schorpp@ids.de> Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-08USB: serial: ftdi_sio: clean up TIOCSSERIALJohan Hovold1-6/+7
The TIOCSSERIAL implementation needs to compare the old flag and divisor settings with the new to detect ASYNC_SPD changes, but there's no need to copy all driver state to the stack for that. While at it, unbreak the function parameter list. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-08USB: serial: ftdi_sio: simplify TIOCGSERIAL permission checkJohan Hovold1-12/+1
Changing the deprecated custom_divisor field is an unprivileged operation so after verifying that flag field does not contain any privileged changes both updates can be carried out by any user. Combine the two branches and drop the erroneous comment. Note that private flags field is only used for ASYNC flags so there's no need to try to retain any other bits when updating the flags. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-08USB: serial: ftdi_sio: ignore baud_base changesJohan Hovold1-4/+0
The TIOCSSERIAL error handling is inconsistent at best, but drivers tend to ignore requests to change parameters which cannot be changed rather than return an error. The FTDI driver ignores change requests for all immutable parameters but baud_base so return success also in this case for consistency. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-08USB: serial: add generic support for TIOCSSERIALJohan Hovold1-9/+2
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. The closing_wait parameter determines how long to wait for the transfer buffers to drain during close and the default timeout of 30 seconds may not be sufficient at low line speeds. In other cases, when for example flow is stopped, the default timeout may instead be too long. Add generic support for TIOCSSERIAL and TIOCGSERIAL with handling of the three common parameters close_delay, closing_wait and line for the benefit of all USB serial drivers while still allowing drivers to implement further functionality through the existing callbacks. This currently includes a few drivers that report their base baud clock rate even if that is really only of interest when setting custom divisors through the deprecated ASYNC_SPD_CUST interface; an interface which only the FTDI driver actually implements. Some drivers have also been reporting back a fake UART type, something which should no longer be needed and will be dropped by a follow-on patch. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-08USB: serial: ftdi_sio: fix TIOCGSERIAL implementationJohan Hovold1-0/+4
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. The FTDI driver is the only USB serial driver supporting the deprecated ASYNC_SPD flags, which are reported back as they should by TIOCGSERIAL, but the returned parameters did not include the line number. The close_delay and closing_wait parameters returned by TIOCGSERIAL are specified in centiseconds. The driver does not yet support changing these, but let's report back the default values actually used (0.5 and 30 seconds, respectively). Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2021-02-09USB: serial: make remove callback return voidUwe Kleine-König1-4/+2
All usb_serial drivers return 0 in their remove callbacks and driver core ignores the value returned by usb_serial_device_remove(). So change the remove callback to return void and return 0 unconditionally in usb_serial_device_remove(). Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Link: https://lore.kernel.org/r/20210208143149.963644-2-uwe@kleine-koenig.org Signed-off-by: Johan Hovold <johan@kernel.org>
2021-02-01USB: serial: ftdi_sio: restore divisor-encoding commentsJohan Hovold1-8/+8
Add back a few explanatory comments related to the divisor encoding which got lost in a coding-style clean up many years ago. Signed-off-by: Johan Hovold <johan@kernel.org>
2021-02-01USB: serial: ftdi_sio: fix FTX sub-integer prescalerJohan Hovold1-2/+3
The most-significant bit of the sub-integer-prescaler index is set in the high byte of the baudrate request wIndex also for FTX devices. This fixes rates like 1152000 which got mapped to 1.2 MBd. Reported-by: Vladimir <svv75@mail.ru> Link: https://bugzilla.kernel.org/show_bug.cgi?id=210351 Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
2020-12-09USB: serial: ftdi_sio: log the CBUS GPIO validityMarc Zyngier1-0/+6
The validity of the ftdi CBUS GPIO is pretty hidden so far, and finding out *why* some GPIOs don't work is sometimes hard to identify. So let's help the user by displaying the map of the CBUS pins that are valid for a GPIO. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201204164739.781812-4-maz@kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> [johan: demote to KERN_DEBUG, rephrase messages, drop ftx-prog warning] Signed-off-by: Johan Hovold <johan@kernel.org>
2020-12-09USB: serial: ftdi_sio: drop GPIO line checking dead codeMarc Zyngier1-3/+0
Now that gpiolib can track the validity of GPIO pins, there is no need to check whether the line is valid in request(). Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201204164739.781812-5-maz@kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> [johan: amend commit message] Signed-off-by: Johan Hovold <johan@kernel.org>
2020-12-09USB: serial: ftdi_sio: report the valid GPIO lines to gpiolibMarc Zyngier1-0/+14
Since it is pretty common for only some of the CBUS lines to be valid as GPIO lines, let's report such validity to the rest of the kernel. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201204164739.781812-3-maz@kernel.org Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-10-05USB: serial: ftdi_sio: use cur_altsetting for consistencyMychaela N. Falconia1-7/+7
ftdi_determine_type() function had this construct in it to get the number of the interface it is operating on: inter = serial->interface->altsetting->desc.bInterfaceNumber; Elsewhere in this driver cur_altsetting is used instead for this purpose. Change ftdi_determine_type() to use cur_altsetting for consistency. Signed-off-by: Mychaela N. Falconia <falcon@freecalypso.org> [ johan: fix old style issues; drop braces and random white space ] Signed-off-by: Johan Hovold <johan@kernel.org>
2020-10-01USB: serial: ftdi_sio: clean up jtag quirksJohan Hovold1-10/+8
Drivers should not assume that interface descriptors have been parsed in any particular order so match on interface number instead when rejecting JTAG interfaces. Also use the interface struct device for notifications so that the interface number is included. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-09-29USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adaptersMychaela N. Falconia1-0/+5
There exist many FT2232-based JTAG+UART adapter designs in which FT2232 Channel A is used for JTAG and Channel B is used for UART. The best way to handle them in Linux is to have the ftdi_sio driver create a ttyUSB device only for Channel B and not for Channel A: a ttyUSB device for Channel A would be bogus and will disappear as soon as the user runs OpenOCD or other applications that access Channel A for JTAG from userspace, causing undesirable noise for users. The ftdi_sio driver already has a dedicated quirk for such JTAG+UART FT2232 adapters, and it requires assigning custom USB IDs to such adapters and adding these IDs to the driver with the ftdi_jtag_quirk applied. Boutique hardware manufacturer Falconia Partners LLC has created a couple of JTAG+UART adapter designs (one buffered, one unbuffered) as part of FreeCalypso project, and this hardware is specifically made to be used with Linux hosts, with the intent that Channel A will be accessed only from userspace via appropriate applications, and that Channel B will be supported by the ftdi_sio kernel driver, presenting a standard ttyUSB device to userspace. Toward this end the hardware manufacturer will be programming FT2232 EEPROMs with custom USB IDs, specifically with the intent that these IDs will be recognized by the ftdi_sio driver with the ftdi_jtag_quirk applied. Signed-off-by: Mychaela N. Falconia <falcon@freecalypso.org> [johan: insert in PID order and drop unused define] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
2020-08-24USB: serial: ftdi_sio: add IDs for Xsens Mti USB converterPatrick Riphagen1-0/+1
The device added has an FTDI chip inside. The device is used to connect Xsens USB Motion Trackers. Cc: stable@vger.kernel.org Signed-off-by: Patrick Riphagen <patrick.riphagen@xsens.com> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-07-09USB: serial: drop redundant transfer-buffer castsJohan Hovold1-1/+1
Drop redundant URB transfer-buffer casts. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-07-09USB: serial: only set sysrq timestamp for consolesJohan Hovold1-1/+1
Only set the sysrq timestamp for console ports to avoid having every driver also check the console flag when processing incoming data. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-07-09USB: serial: ftdi_sio: fix break and sysrq handlingJohan Hovold1-7/+17
Only the last NUL in a packet should be flagged as a break character, for example, to avoid dropping unrelated characters when IGNBRK is set. Also make sysrq work by consuming the break character instead of having it immediately cancel the sysrq request, and by not processing it prematurely to avoid triggering a sysrq based on an unrelated character received in the same packet (which was received *before* the break). Note that the break flag can be left set also for a packet received immediately following a break and that and an ending NUL in such a packet will continue to be reported as a break as there's no good way to tell it apart from an actual break. Tested on FT232R and FT232H. Fixes: 72fda3ca6fc1 ("USB: serial: ftd_sio: implement sysrq handling on break") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-07-09USB: serial: ftdi_sio: clean up receive processingJohan Hovold1-10/+9
Clean up receive processing by dropping the character pointer and keeping the length argument unchanged throughout the function. Also make it more apparent that sysrq processing can consume a characters by adding an explicit continue. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2020-07-09USB: serial: ftdi_sio: make process-packet buffer unsignedJohan Hovold1-11/+11
Use an unsigned type for the process-packet buffer argument and give it a more apt name. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-11-14USB: serial: ftdi_sio: add device IDs for U-Blox C099-F9PFabio D'Urso1-0/+3
This device presents itself as a USB hub with three attached devices: - An ACM serial port connected to the GPS module (not affected by this commit) - An FTDI serial port connected to the GPS module (1546:0502) - Another FTDI serial port connected to the ODIN-W2 radio module (1546:0503) This commit registers U-Blox's VID and the PIDs of the second and third devices. Datasheet: https://www.u-blox.com/sites/default/files/C099-F9P-AppBoard-Mbed-OS3-FW_UserGuide_%28UBX-18063024%29.pdf Signed-off-by: Fabio D'Urso <fabiodurso@hotmail.it> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-10-02USB: serial: ftdi_sio: add device IDs for Sienna and Echelon PL-20Beni Mahler1-0/+3
Both devices added here have a FTDI chip inside. The device from Echelon is called 'Network Interface' it is actually a LON network gateway. ID 0403:8348 Future Technology Devices International, Ltd https://www.eltako.com/fileadmin/downloads/de/datenblatt/Datenblatt_PL-SW-PROF.pdf ID 0920:7500 Network Interface https://www.echelon.com/products/u20-usb-network-interface Signed-off-by: Beni Mahler <beni.mahler@gmx.net> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-08-28USB: serial: ftdi_sio: add support for FT232H CBUS gpiosMatthew Michilot1-0/+43
Enable support for cbus gpios on FT232H. The cbus configuration is stored in two words in the EEPROM at byte-offset 0x1a with the mux config for ACBUS5, ACBUS6, ACBUS8 and ACBUS9 (only pins that can be configured as I/O mode). Tested using FT232H by configuring one ACBUS pin at a time. Reviewed-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Matthew Michilot <matthew.michilot@gmail.com> [ johan: fix copy-paste error in commit message ] Signed-off-by: Johan Hovold <johan@kernel.org>
2019-07-03Merge tag 'usb-serial-5.3-rc1' of ↵Greg Kroah-Hartman1-0/+1
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.3-rc1 Here are the USB-serial updates for 5.3-rc1; just some new device ids this time. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold <johan@kernel.org> * tag 'usb-serial-5.3-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: ftdi_sio: add ID for isodebug v1 USB: serial: option: add support for GosunCn ME3630 RNDIS mode
2019-06-28USB: serial: ftdi_sio: add ID for isodebug v1Andreas Fritiofson1-0/+1
This adds the vid:pid of the isodebug v1 isolated JTAG/SWD+UART. Only the second channel is available for use as a serial port. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@unjo.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-06-20docs: usb: rename files to .rst and add them to drivers-apiMauro Carvalho Chehab1-1/+1
While there are a mix of things here, most of the stuff were written from Kernel developer's PoV. So, add them to the driver-api book. A follow up for this patch would be to move documents from there that are specific to sysadmins, adding them to the admin-guide. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19USB: serial: ftdi_sio: add additional NovaTech productsGeorge McCollister1-0/+2
Add PIDs for the NovaTech OrionLX+ and Orion I/O so they can be automatically detected. Signed-off-by: George McCollister <george.mccollister@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-02-15USB: serial: ftdi_sio: add ID for Hjelmslund Electronics USB485Mans Rullgard1-0/+2
This adds the USB ID of the Hjelmslund Electronics USB485 Iso stick. Signed-off-by: Mans Rullgard <mans@mansr.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2019-01-14USB: serial: ftdi_sio: fix GPIO not working in autosuspendKaroly Pados1-1/+14
There is a bug in the current GPIO code for ftdi_sio: it failed to take USB autosuspend into account. If the device is in autosuspend, calls to usb_control_msg() fail with -EHOSTUNREACH. Because the standard value for autosuspend timeout is usually 2-5 seconds, this made it almost impossible to use the GPIOs on machines that have USB autosuspend enabled. This patch fixes the issue by acquiring a PM lock on the device for the duration of the USB transfers. Tested on an FT231X device. Signed-off-by: Karoly Pados <pados@pados.hu> [ johan: simplify code somewhat ] Fixes: ba93cc7da896 ("USB: serial: ftdi_sio: implement GPIO support for FT-X devices") Cc: stable <stable@vger.kernel.org> # 4.20 Signed-off-by: Johan Hovold <johan@kernel.org>
2018-11-23USB: serial: ftdi_sio: use rounding when calculating baud rate divisorsNikolaj Fogh1-3/+3
Improve baud-rate generation by using rounding-to-closest instead of truncation in divisor calculation. Results have been verified by logic analyzer on an FT232RT (232BM) chip. The following table shows the wanted baud rate, the baud rate obtained with the old method (truncation), with the new method (rounding) and the baud rate generated by the windows 10 driver. The numbers in parentheses is the error. +- Wanted --+------ Old -------+------ New -------+------ Win -------+ |   9600  |   9600 (0.00%)  |   9604 (0.05%)  |   9605 (0.05%)  | |   19200   |   19200 (0.00%)  |   19199 (0.01%)  |   19198 (0.01%)  | |   38400   |   38395 (0.01%)  |   38431 (0.08%)  |   38394 (0.02%)  | |   57600   |   57725 (0.22%)  |   57540 (0.10%)  |   57673 (0.13%)  | |  115200   |  115307 (0.09%)  |  115330 (0.11%)  |  115320 (0.10%)  | |  921600   |  919963 (0.18%)  |  920386 (0.13%)  |  920810 (0.09%)  | |  961200   |  996512 (3.67%)  |  956480 (0.49%)  |  956937 (0.44%)  | +-----------+------------------+------------------+------------------+ The error due to noise in the measurements is in the order of a few tenths of a %. As can be seen, the baud rate is significantly improved for some rates (e.g. 961200), and corresponds to the output given by the windows driver. The theoretical baud rate has been calculated for all baud rates from 1 to 3M, and as expected, the error is centered around 0, with a triangle shape instead of a sawtooth, so the maximum error is decreased to half. Signed-off-by: Nikolaj Fogh <nikolajfogh@gmail.com> [ johan: edit commit message slightly ] Signed-off-by: Johan Hovold <johan@kernel.org>
2018-10-26Merge tag 'usb-4.20-rc1' of ↵Linus Torvalds1-1/+390
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big USB/PHY driver patches for 4.20-rc1 Lots of USB changes in here, primarily in these areas: - typec updates and new drivers - new PHY drivers - dwc2 driver updates and additions (this old core keeps getting added to new devices.) - usbtmc major update based on the industry group coming together and working to add new features and performance to the driver. - USB gadget additions for new features - USB gadget configfs updates - chipidea driver updates - other USB gadget updates - USB serial driver updates - renesas driver updates - xhci driver updates - other tiny USB driver updates All of these have been in linux-next for a while with no reported issues" * tag 'usb-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (229 commits) usb: phy: ab8500: silence some uninitialized variable warnings usb: xhci: tegra: Add genpd support usb: xhci: tegra: Power-off power-domains on removal usbip:vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten usbip: tools: fix atoi() on non-null terminated string USB: misc: appledisplay: fix backlight update_status return code phy: phy-pxa-usb: add a new driver usb: host: add DT bindings for faraday fotg2 usb: host: ohci-at91: fix request of irq for optional gpio usb/early: remove set but not used variable 'remain_length' usb: typec: Fix copy/paste on typec_set_vconn_role() kerneldoc usb: typec: tcpm: Report back negotiated PPS voltage and current USB: core: remove set but not used variable 'udev' usb: core: fix memory leak on port_dev_path allocation USB: net2280: Remove ->disconnect() callback from net2280_pullup() usb: dwc2: disable power_down on rockchip devices usb: gadget: udc: renesas_usb3: add support for r8a77990 dt-bindings: usb: renesas_usb3: add bindings for r8a77990 usb: gadget: udc: renesas_usb3: Add r8a774a1 support USB: serial: cypress_m8: remove set but not used variable 'iflag' ...
2018-10-13fdti_sio: switch to ->[sg]et_serial()Al Viro1-27/+21
Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2018-10-05USB: serial: ftdi_sio: add support for FT232R CBUS gpiosJohan Hovold1-2/+38
Enable support for cbus gpios on FT232R. The cbus configuration is stored in one word in the EEPROM at offset 0x0a (byte-offset 0x14) with the mux config for CBUS0, CBUS1, CBUS2 and CBUS3 in bits 0..3, 4..7, 8..11 and 12..15, respectively. Tested using FT232RL by configuring one cbus pin at a time. Signed-off-by: Johan Hovold <johan@kernel.org>
2018-10-05USB: serial: ftdi_sio: fix gpio name collisionsJohan Hovold1-5/+0
Drop the gpio line names, which cause gpiolib to complain loudly whenever a second ftdi gpiochip is registered: gpio gpiochip5: Detected name collision for GPIO name 'CBUS0' gpio gpiochip5: Detected name collision for GPIO name 'CBUS1' gpio gpiochip5: Detected name collision for GPIO name 'CBUS2' gpio gpiochip5: Detected name collision for GPIO name 'CBUS3' and also prevents the legacy sysfs interface from being used (as the line names are used as device names whenever they are set): sysfs: cannot create duplicate filename '/class/gpio/CBUS0' Until non-unique names are supported by gpiolib (without warnings and stack dumps), let's leave the gpio lines unnamed. Signed-off-by: Johan Hovold <johan@kernel.org>
2018-09-26USB: serial: ftdi_sio: implement GPIO support for FT-X devicesKaroly Pados1-1/+359
This patch allows using the CBUS pins of FT-X devices as GPIO in CBUS bitbanging mode. There is no conflict between the GPIO and VCP functionality in this mode. Tested on FT230X and FT231X. As there is no way to request the current CBUS register configuration from the device, all CBUS pins are set to a known state when the first GPIO is requested. This allows using libftdi to set the GPIO pins before loading this module for UART functionality, a behavior that existing applications might be relying upon (though no specific case is known to the authors of this patch). Signed-off-by: Karoly Pados <pados@pados.hu> [ johan: minor style changes ] Signed-off-by: Johan Hovold <johan@kernel.org>
2018-05-21USB: serial: ftdi_sio: clean up flow control managementJohan Hovold1-58/+23
Clean up the somewhat convoluted hardware-assisted flow control handling. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-05-21USB: serial: ftdi_sio: drop unnecessary urb_ variable prefixesJohan Hovold1-42/+41
Drop urb_ prefixes from value and index variables used in control requests. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-05-21USB: serial: ftdi_sio: use non-underscore fixed typesJohan Hovold1-25/+25
Replace all __u types with their u counterparts throughout the driver (whose structures are not exported to user space). Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-05-21USB: serial: ftdi_sio: fix IXON/IXOFF mixupJohan Hovold1-6/+2
Since forever this driver has had IXON and IXOFF mixed up, and has used the latter rather than the former to enable hardware-assisted software flow control on output. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-04-16USB: serial: ftdi_sio: use jtag quirk for Arrow USB BlasterVasyl Vavrychuk1-1/+2
Arrow USB Blaster integrated on MAX1000 board uses the same vendor ID (0x0403) and product ID (0x6010) as the "original" FTDI device. This patch avoids picking up by ftdi_sio of the first interface of this USB device. After that this device can be used by Arrow user-space JTAG driver. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-03-29Revert "USB: serial: ftdi_sio: add Id for Physik Instrumente E-870"Johan Hovold1-1/+0
This reverts commit 79a0b33165d8d8ec0840fcfc74fd0a8f219abeee. Turns out this is not an FTDI device after all. Fixes: 79a0b33165d8 ("USB: serial: ftdi_sio: add Id for Physik Instrumente E-870") Reported-by: Martin Teichmann <martin.teichmann@xfel.eu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29Merge tag 'usb-serial-4.17-rc1' of ↵Greg Kroah-Hartman1-0/+1
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for v4.17-rc1 Here are the USB-serial updates for 4.17-rc1, including a reimplementation of the option-driver interface masking which allows for a more compact notation when adding new device entries. Included are also a couple of clean ups and a new ftdi_sio device id. All but the device-id commit have been in linux-next (without any reported issues). Signed-off-by: Johan Hovold <johan@kernel.org>
2018-03-29USB: serial: ftdi_sio: add Id for Physik Instrumente E-870Teichmann, Martin1-0/+1
This adds support for the Physik Instrumente E-870 PIShift Drive Electronics, a Piezo motor driver. Signed-off-by: Martin Teichmann <martin.teichmann@xfel.eu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2018-03-23USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulatorClemens Werther1-0/+1
Add device id for Harman FirmwareHubEmulator to make the device auto-detectable by the driver. Signed-off-by: Clemens Werther <clemens.werther@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23USB: serial: ftdi_sio: add RT Systems VX-8 cableMajor Hayden1-0/+1
This patch adds a device ID for the RT Systems cable used to program Yaesu VX-8R/VX-8DR handheld radios. It uses the main FTDI VID instead of the common RT Systems VID. Signed-off-by: Major Hayden <major@mhtx.net> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>