[PATCH AUTOSEL 4.9 15/27] serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling

From: Sasha Levin
Date: Thu Feb 14 2019 - 21:14:59 EST


From: Tomonori Sakita <tomonori.sakita@xxxxxxxxxx>

[ Upstream commit 815d835b7ba46685c316b000013367dacb2b461b ]

Using over-sampling ratio, lpuart can accept baud rate upto uartclk / 4.

Signed-off-by: Tomonori Sakita <tomonori.sakita@xxxxxxxxxx>
Signed-off-by: Atsushi Nemoto <atsushi.nemoto@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/tty/serial/fsl_lpuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index e2ec04904f54..0cf4fe6cb4d1 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1490,7 +1490,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
}

/* ask the core to calculate the divisor */
- baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
+ baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 4);

spin_lock_irqsave(&sport->port.lock, flags);

--
2.19.1