]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: ch341: fix baud rate and line-control handling
authorJohan Hovold <johan@kernel.org>
Fri, 6 Jan 2017 18:15:16 +0000 (19:15 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 9 Jan 2017 13:55:40 +0000 (14:55 +0100)
commitc73dfc7221e8f070adcb4d13bc95cad949ab1f7b
treeb547877c6572db2adf53e95a85e05a3a8eff3d23
parente350a441c9466b4e94af6aa623b92ff308e04d7c
USB: serial: ch341: fix baud rate and line-control handling

Revert to using direct register writes to set the divisor and
line-control registers.

A recent change switched to using the init vendor command to update
these registers, something which also enabled support for CH341A
devices. It turns out that simply setting bit 7 in the divisor register
is sufficient to support CH341A and specifically prevent data from being
buffered until a full endpoint-size packet (32 bytes) has been received.

Using the init command also had the side-effect of temporarily
deasserting the DTR/RTS signals on every termios change (including
initialisation on open) something which for example could cause problems
in setups where DTR is used to trigger a reset.

Fixes: ddd74a622bf0 ("USB: serial: ch341: reinitialize chip on
reconfiguration")
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c