From 243dd2c3eea0077c7fa276cad0b4d111a4366171 Mon Sep 17 00:00:00 2001 From: Hubert Feurstein Date: Thu, 18 Jul 2013 18:52:49 +0200 Subject: [PATCH] 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 Signed-off-by: Huang Shijie --- drivers/tty/serial/imx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 46c513a20c65..dfb6a3a5eb0b 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -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; -- 2.39.5