1. 01 2月, 2022 1 次提交
  2. 21 9月, 2021 1 次提交
  3. 26 8月, 2021 1 次提交
  4. 05 8月, 2021 1 次提交
  5. 05 6月, 2021 1 次提交
  6. 10 5月, 2021 1 次提交
  7. 08 4月, 2021 5 次提交
    • J
      USB: serial: ftdi_sio: clean up TIOCSSERIAL · 0428bf68
      Johan Hovold 提交于
      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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      0428bf68
    • J
      USB: serial: ftdi_sio: simplify TIOCGSERIAL permission check · c12860c0
      Johan Hovold 提交于
      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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      c12860c0
    • J
      USB: serial: ftdi_sio: ignore baud_base changes · 9378379b
      Johan Hovold 提交于
      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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      9378379b
    • J
      USB: serial: add generic support for TIOCSSERIAL · 01fd45f6
      Johan Hovold 提交于
      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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      01fd45f6
    • J
      USB: serial: ftdi_sio: fix TIOCGSERIAL implementation · 2ab58361
      Johan Hovold 提交于
      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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      2ab58361
  8. 09 2月, 2021 1 次提交
  9. 01 2月, 2021 2 次提交
  10. 10 12月, 2020 3 次提交
  11. 05 10月, 2020 1 次提交
  12. 01 10月, 2020 1 次提交
  13. 29 9月, 2020 1 次提交
    • M
      USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters · 6cf87e5e
      Mychaela N. Falconia 提交于
      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: NMychaela N. Falconia <falcon@freecalypso.org>
      [johan: insert in PID order and drop unused define]
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      6cf87e5e
  14. 24 8月, 2020 1 次提交
  15. 09 7月, 2020 5 次提交
  16. 15 11月, 2019 1 次提交
  17. 02 10月, 2019 1 次提交
  18. 28 8月, 2019 1 次提交
  19. 28 6月, 2019 1 次提交
  20. 20 6月, 2019 1 次提交
  21. 19 3月, 2019 1 次提交
  22. 15 2月, 2019 1 次提交
  23. 14 1月, 2019 1 次提交
    • K
      USB: serial: ftdi_sio: fix GPIO not working in autosuspend · a8eda9fa
      Karoly Pados 提交于
      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: NKaroly Pados <pados@pados.hu>
      [ johan: simplify code somewhat ]
      Fixes: ba93cc7d ("USB: serial: ftdi_sio: implement GPIO support for FT-X devices")
      Cc: stable <stable@vger.kernel.org>	# 4.20
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      a8eda9fa
  24. 23 11月, 2018 1 次提交
    • N
      USB: serial: ftdi_sio: use rounding when calculating baud rate divisors · 6abd8371
      Nikolaj Fogh 提交于
      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: NNikolaj Fogh <nikolajfogh@gmail.com>
      [ johan: edit commit message slightly ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      6abd8371
  25. 13 10月, 2018 1 次提交
  26. 05 10月, 2018 2 次提交
    • J
      USB: serial: ftdi_sio: add support for FT232R CBUS gpios · ff32d97e
      Johan Hovold 提交于
      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: NJohan Hovold <johan@kernel.org>
      ff32d97e
    • J
      USB: serial: ftdi_sio: fix gpio name collisions · e0658e30
      Johan Hovold 提交于
      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: NJohan Hovold <johan@kernel.org>
      e0658e30
  27. 26 9月, 2018 1 次提交
    • K
      USB: serial: ftdi_sio: implement GPIO support for FT-X devices · ba93cc7d
      Karoly Pados 提交于
      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: NKaroly Pados <pados@pados.hu>
      [ johan: minor style changes ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ba93cc7d
  28. 21 5月, 2018 1 次提交