]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial/imx: fix custom-baudrate handling
authorHubert Feurstein <h.feurstein@gmail.com>
Thu, 18 Jul 2013 16:52:49 +0000 (18:52 +0200)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:04 +0000 (09:54 +0800)
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>
Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/tty/serial/imx.c

index 46c513a20c65305dac4e205ba51ff0d38ef3843a..dfb6a3a5eb0b54817efbd9bea10eca75c9bab32b 100644 (file)
@@ -1029,6 +1029,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;