[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1593078545-11272-1-git-send-email-vabhav.sharma@oss.nxp.com>
Date: Thu, 25 Jun 2020 15:19:05 +0530
From: Vabhav Sharma <vabhav.sharma@....nxp.com>
To: gregkh@...uxfoundation.org, jslaby@...e.com,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: v.sethi@....com, Vabhav Sharma <vabhav.sharma@....com>
Subject: [PATCH] tty: serial: fsl_lpuart: minimum baud rate support
From: Vabhav Sharma <vabhav.sharma@....com>
The formula for the baud rate is
baud rate = "baud clock / ((OSR+1) × SBR)
Algorithm used in function lpuart32_serial_setbrg() only changes
the SBR. Even with maxmum value put in, OSR stays at 0x7 and the
lowest baud rate would be ~ 2600 bps
Update the algorithm to allow driver operation at 1200,2400 or
600 bps
Signed-off-by: Vabhav Sharma <vabhav.sharma@....com>
---
drivers/tty/serial/fsl_lpuart.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 90298c4..0fd0fa5f 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1925,6 +1925,10 @@ static void __lpuart32_serial_setbrg(struct uart_port *port,
tmp_sbr++;
}
+ if (tmp_sbr > UARTBAUD_SBR_MASK) {
+ continue;
+ }
+
if (tmp_diff <= baud_diff) {
baud_diff = tmp_diff;
osr = tmp_osr;
--
2.7.4
Powered by blists - more mailing lists