diff options
author | Johan Hovold <johan@kernel.org> | 2021-01-18 12:13:27 +0100 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2021-01-18 14:24:46 +0100 |
commit | f61309d9c96a308465bec9d2e5206da265b075a0 (patch) | |
tree | f997028b4e4f21f9017621e281161d14b4aad89f /drivers/usb | |
parent | USB: serial: cp210x: add support for software flow control (diff) | |
download | linux-f61309d9c96a308465bec9d2e5206da265b075a0.tar.xz linux-f61309d9c96a308465bec9d2e5206da265b075a0.zip |
USB: serial: cp210x: set IXOFF thresholds
At least CP2102 requires the XON/XOFF limits to be initialised in order
for software input flow control (IXOFF) to work. Specifically, XOFF is
never sent if the XOFF limit is left at its default value of zero.
Set the limits so that input is throttled when the FIFO free level drops
below 128 bytes and restarted when the FIFO fill level drops below 128
bytes.
Note that the threshold values have been chosen so that they can be used
also with CP2105 which has the smallest FIFO of the currently supported
device types (288 byte for the SCI port). If needed the limits can be
made device specific later.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/cp210x.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 5bd14770065b..ee0139eb6636 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1181,6 +1181,9 @@ static void cp210x_set_flow_control(struct tty_struct *tty, else flow_repl &= ~CP210X_SERIAL_AUTO_TRANSMIT; + flow_ctl.ulXonLimit = cpu_to_le32(128); + flow_ctl.ulXoffLimit = cpu_to_le32(128); + dev_dbg(&port->dev, "%s - ulControlHandshake=0x%08x, ulFlowReplace=0x%08x\n", __func__, ctl_hs, flow_repl); |