OSDN Git Service

USB: pl2303: use direct baud-rate encoding when possible
authorJohan Hovold <jhovold@gmail.com>
Sun, 29 Dec 2013 18:23:15 +0000 (19:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jan 2014 20:31:48 +0000 (12:31 -0800)
commit5d85045f4b082800beb384094fc67fa0d2096563
treebe5bc0158329ff7035506a1c4c2c3d1a4b1457e3
parent20b4c787199f4fcf0fae5ed78a4ff0104e2afaa3
USB: pl2303: use direct baud-rate encoding when possible

Use direct baud-rate encoding rather than divisors for supported baud
rates.

This restores the way baud rates were set prior to commit 8d48fdf689fe
("USB: PL2303: correctly handle baudrates above 115200") which added
divisor encoding, but also switched to the new encoding method for all
baudrates above 115200.

As noted by Frank Schäfer <fschaefer.oss@googlemail.com>, baud rate 500k
was later errounously added to the supported baud-rate table although
it can only be set using divisors.

Note that the current implementation could easily be extended to support
arbitrary non-standard baud rates using divisors (e.g. by falling back
to divisors when the table lookup fails).

Cc: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/pl2303.c