USB: serial: cp210x: improve line-speed handling for CP2104 and CP2105
authorJohan Hovold <johan@kernel.org>
Wed, 18 Jul 2018 12:25:01 +0000 (14:25 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 18 Jul 2018 19:54:56 +0000 (21:54 +0200)
commit5edb65a33710bbf10f38b42e0d497b35ec1ed908
tree16374d701da3be28fd451c32a26755f3e7dc5a3d
parent7aecd7fc5d95f1447611ab5e14db5ab9549f979c
USB: serial: cp210x: improve line-speed handling for CP2104 and CP2105

CP2104 and the ECI interface of CP2105 support further baud rates than
the ones specified in AN205 table 1, and we can use the same equations
as for CP2102N to determine and report back the actual baud rates used.

Note that this could eventually be generalised also to CP2108, which
uses a different base clock. There appears to be an error in the CP2108
equations which needs to be confirmed on actual hardware first however
(specifically, the subtraction of one from the divisor appears to be
incorrect as it introduces larger errors).

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c