From: Hubert Feurstein Date: Thu, 18 Jul 2013 16:52:49 +0000 (+0200) Subject: serial/imx: fix custom-baudrate handling X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=09bd00f6e9a434727e4bfe93b0498c5d893c1906;p=deliverable%2Flinux.git serial/imx: fix custom-baudrate handling It was not possible to set custom-baudrates like 62500. Signed-off-by: Hubert Feurstein Signed-off-by: Greg Kroah-Hartman --- 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;