diff options
author | Frank Schäfer <fschaefer.oss@googlemail.com> | 2013-07-30 19:49:04 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-01 01:12:38 (GMT) |
commit | b8bdad608213caffa081a97d2e937e5fe08c4046 (patch) | |
tree | 6c58e7f0f1c1a30bdf780829590299641a504160 /drivers | |
parent | d4f09e28d7bc5c1adde8229b1e89401f23fb44f9 (diff) | |
download | linux-b8bdad608213caffa081a97d2e937e5fe08c4046.tar.xz |
USB: pl2303: restrict the divisor based baud rate encoding method to the "HX" chip type
It's not clear if the type_0 and type_1 chips support the divisor based baud
rate encoding method, so don't use it until anyone with such chip has tested it
to avoid regressions with the following patches.
Even if it has been working fine with these chips since the code has been added
2 years ago, this change will not cause any regressions, because the baud rates
currently supported/allowed with the divisor based method are supported with
the direct method, too.
The code for the divisor based method also isn't entirely correct (yet), so that the
direct encoding method actually works better (sets the baud rate more precisely).
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/pl2303.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 1e6de4c..2448201 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -305,10 +305,14 @@ static void pl2303_encode_baudrate(struct tty_struct *tty, if (spriv->type != HX) baud = min_t(int, baud, 1228800); - if (baud <= 115200) { + if (spriv->type != HX || baud <= 115200) { + /* Direct (standard) baud rate encoding method */ put_unaligned_le32(baud, buf); } else { /* + * NOTE: it's not clear if the type_0/1 chips + * support this method + * * Apparently the formula for higher speeds is: * baudrate = 12M * 32 / (2^buf[1]) / buf[0] */ |