summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHubert Feurstein <h.feurstein@gmail.com>2013-07-18 18:52:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-27 00:43:37 +0200
commit09bd00f6e9a434727e4bfe93b0498c5d893c1906 (patch)
tree96593743130245673f9bde13e77e892660ad7717
parentserial: imx: distinguish the imx6q uart from the others (diff)
downloadlinux-09bd00f6e9a434727e4bfe93b0498c5d893c1906.tar.xz
linux-09bd00f6e9a434727e4bfe93b0498c5d893c1906.zip
serial/imx: fix custom-baudrate handling
It was not possible to set custom-baudrates like 62500. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5bce53655c00..79d1943c2e79 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1028,6 +1028,11 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
*/
div = 1;
} else {
+ /* custom-baudrate handling */
+ div = sport->port.uartclk / (baud * 16);
+ if (baud == 38400 && quot != div)
+ baud = sport->port.uartclk / (quot * 16);
+
div = sport->port.uartclk / (baud * 16);
if (div > 7)
div = 7;