1. 09 7月, 2020 5 次提交
  2. 15 11月, 2019 1 次提交
  3. 02 10月, 2019 1 次提交
  4. 28 8月, 2019 1 次提交
  5. 28 6月, 2019 1 次提交
  6. 20 6月, 2019 1 次提交
  7. 19 3月, 2019 1 次提交
  8. 15 2月, 2019 1 次提交
  9. 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
  10. 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
  11. 13 10月, 2018 1 次提交
  12. 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
  13. 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
  14. 21 5月, 2018 4 次提交
  15. 16 4月, 2018 1 次提交
  16. 30 3月, 2018 1 次提交
  17. 29 3月, 2018 1 次提交
  18. 23 3月, 2018 2 次提交
  19. 24 1月, 2018 1 次提交
  20. 27 12月, 2017 1 次提交
  21. 04 11月, 2017 2 次提交
  22. 18 9月, 2017 1 次提交
  23. 13 6月, 2017 2 次提交
  24. 17 5月, 2017 1 次提交
    • A
      USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs · 5f63424a
      Andrey Korolyov 提交于
      This patch adds support for recognition of ARM-USB-TINY(H) devices which
      are almost identical to ARM-USB-OCD(H) but lacking separate barrel jack
      and serial console.
      
      By suggestion from Johan Hovold it is possible to replace
      ftdi_jtag_quirk with a bit more generic construction. Since all
      Olimex-ARM debuggers has exactly two ports, we could safely always use
      only second port within the debugger family.
      Signed-off-by: NAndrey Korolyov <andrey@xdel.ru>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      5f63424a
  25. 15 5月, 2017 1 次提交
    • A
      USB: serial: ftdi_sio: fix setting latency for unprivileged users · bb246681
      Anthony Mallet 提交于
      Commit 557aaa7f ("ft232: support the ASYNC_LOW_LATENCY
      flag") enables unprivileged users to set the FTDI latency timer,
      but there was a logic flaw that skipped sending the corresponding
      USB control message to the device.
      
      Specifically, the device latency timer would not be updated until next
      open, something which was later also inadvertently broken by commit
      c19db4c9 ("USB: ftdi_sio: set device latency timeout at port
      probe").
      
      A recent commit c6dce262 ("USB: serial: ftdi_sio: fix extreme
      low-latency setting") disabled the low-latency mode by default so we now
      need this fix to allow unprivileged users to again enable it.
      Signed-off-by: NAnthony Mallet <anthony.mallet@laas.fr>
      [johan: amend commit message]
      Fixes: 557aaa7f ("ft232: support the ASYNC_LOW_LATENCY flag")
      Fixes: c19db4c9 ("USB: ftdi_sio: set device latency timeout at port probe").
      Cc: stable <stable@vger.kernel.org>     # 2.6.31
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      bb246681
  26. 19 4月, 2017 1 次提交
  27. 13 3月, 2017 3 次提交
    • I
      USB: serial: ftdi_sio: allow other bases for "event_char" · f1ce25f2
      Ian Abbott 提交于
      The 'store' function for the "event_char" device attribute currently
      expects a base 10 value.  The value is composed of an enable bit in bit
      8 and an 8-bit "event character" code in bits 7 to 0.  It seems
      reasonable to allow hexadecimal and octal numbers to be written to the
      device attribute in addition to decimal.  Make it so.
      
      Change the debug message to show the value in hexadecimal, rather than
      decimal.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f1ce25f2
    • I
      USB: serial: ftdi_sio: only allow valid event_char values · d0559a2f
      Ian Abbott 提交于
      The "event_char" device attribute value, when written, is interpreted as
      an enable bit in bit 8, and an "event character" in bits 7 to 0.
      
      Return an error -EINVAL for out-of-range values.  Use kstrtouint() to
      parse the integer instead of the obsolete simple_strtoul().
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      d0559a2f
    • I
      USB: serial: ftdi_sio: only allow valid latency timer values · db924066
      Ian Abbott 提交于
      Valid latency timer values are between 1 ms and 255 ms in 1 ms steps.
      The store function for the "latency_timer" device attribute currently
      allows any value, although only the lower 16 bits will be sent to the
      device, and the device only stores the lower 8 bits.  The hardware
      appears to accept the (invalid) value 0 and treats it the same as 1
      (resulting in a latency of 1 ms).
      
      Change the latency_timer_store() function to accept only the values 0 to
      255, returning an error -EINVAL for out-of-range values.  Call
      kstrtou8() to parse the integer instead of the obsolete
      simple_strtoul().
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      db924066