USB: serial: ftdi_sio: implement GPIO support for FT-X devices
authorKaroly Pados <pados@pados.hu>
Tue, 25 Sep 2018 13:59:11 +0000 (15:59 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 26 Sep 2018 09:59:56 +0000 (11:59 +0200)
commitba93cc7da8965bd513a7393db0f030e51bff4b60
treea165379bb83716c62951f8dcea43484e85b9c84d
parentbbc1f57aa87066a188ef34330bc1f091b95b1a6b
USB: serial: ftdi_sio: implement GPIO support for FT-X devices

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>
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h