]> asedeno.scripts.mit.edu Git - linux.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)
commit4e46c410e050bcac36deadbd8e20449d078204e8
treeffc3cf3d454113b9a6447c351788299b044b781a
parent6fde8d29b0424f292a4ec5dbce01458ad759a41f
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