]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: ch341: reinitialize chip on reconfiguration
authorAidan Thornton <makosoft@gmail.com>
Sat, 22 Oct 2016 21:02:24 +0000 (22:02 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 24 Oct 2016 15:41:19 +0000 (17:41 +0200)
commit874258f9739feecf9e99a701cbd6d88f8dcd1d3e
treeffc3cf3d454113b9a6447c351788299b044b781a
parent791a383073c66eefa8a7898ab439259bef7d1ae4
USB: serial: ch341: reinitialize chip on reconfiguration

Changing the LCR register after initialization does not seem to be reliable
on all chips (particularly not on CH341A). Restructure initialization and
configuration to always reinit the chip on configuration changes instead and
pass the LCR register value directly to the initialization command.

(Note that baud rates above 500kbaud are incorrect, but they're incorrect in
the same way both before and after this patch at least on the CH340G. Fixing
this isn't a priority as higher baud rates don't seem that reliable anyway.)

Cleaned-up version of a patch by Grigori Goronzy

Signed-off-by: Aidan Thornton <makosoft@gmail.com>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c