serial/imx: fix custom-baudrate handling
authorHubert Feurstein <h.feurstein@gmail.com>
Thu, 18 Jul 2013 16:52:49 +0000 (18:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:43:37 +0000 (15:43 -0700)
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>
drivers/tty/serial/imx.c

index 5bce53655c00dc62927dcb6cc7a270950d7dafb3..79d1943c2e7912bfff06d6f8062d60f94be5f4cf 100644 (file)
@@ -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;