serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling

This change “serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling” in Linux kernel is authored by Tomonori Sakita <tomonori.sakita [at] sord.co.jp> on Mon Jan 21 17:34:16 2019 +0900.

serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling

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

Signed-off-by: Tomonori Sakita <tomonori.sakita@sord.co.jp>
Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 815d835.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 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 241a48e..debdd1b 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1697,7 +1697,7 @@ static void lpuart32_shutdown(struct uart_port *port)
 	}
 
 	/* 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);
 

The commit for this change in Linux stable tree is 815d835 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *