• Aidan Thornton's avatar
    USB: serial: ch341: reinitialize chip on reconfiguration · 4e46c410
    Aidan Thornton authored
    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: default avatarAidan Thornton <makosoft@gmail.com>
    Reviewed-by: default avatarGrigori Goronzy <greg@chown.ath.cx>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    4e46c410
ch341.c 15.3 KB