aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-01-16 00:36:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-03 09:22:27 -0800
commit3ae5a60fe9ff53c14caee09090954b8551a6707c (patch)
tree109b491c26928ec2f4cacaf71e1c37cf909f6ea6
parent5e005e788f5e28a20355be9d50c05c76b48e6d7e (diff)
USB: cp210x: allow more baud rates above 1Mbaud
commit d1620ca9e7bb0030068c3b45b653defde8839dac upstream. Allow more baud rates to be set in [1M,2M] baud. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: Preston Fick <preston.fick@silabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/serial/cp210x.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 07d297f5fe42..a5152379cb4c 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -388,10 +388,10 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
else if (baud <= 491520) baud = 460800;
else if (baud <= 567138) baud = 500000;
else if (baud <= 670254) baud = 576000;
- else if (baud <= 1053257) baud = 921600;
- else if (baud <= 1474560) baud = 1228800;
- else if (baud <= 2457600) baud = 1843200;
- else baud = 3686400;
+ else if (baud < 1000000)
+ baud = 921600;
+ else if (baud > 2000000)
+ baud = 2000000;
return baud;
}
@@ -611,7 +611,8 @@ static void cp210x_change_speed(struct tty_struct *tty,
baud = tty->termios->c_ospeed;
- /* This maps the requested rate to a rate valid on cp2102 or cp2103.
+ /* This maps the requested rate to a rate valid on cp2102 or cp2103,
+ * or to an arbitrary rate in [1M,2M].
*
* NOTE: B0 is not implemented.
*/