patch "serial: mxs-auart: Fix baudrate calculation" added to tty-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
serial: mxs-auart: Fix baudrate calculation
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
a6040bc610554c66088fda3608ae5d6307c548e4Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>
Date: Mon, 20 Mar 2017 10:05:38 +0100
Subject: serial: mxs-auart: Fix baudrate calculation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The reference manual for the i.MX28 recommends to calculate the divisor as
divisor = (UARTCLK * 32) / baud rate, rounded to the nearest integer
, so let's do this. For a typical setup of UARTCLK = 24 MHz and baud rate = 115200 this changes the divisor from 6666 to 6667 and so the actual baud rate improves from 115211.521 Bd (error ≅ 0.01 %) to 115194.240 Bd (error ≅ 0.005 %).
--- drivers/tty/serial/mxs-auart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/mxs-auart.c +1 -1
@@ -1088,7 +1088,7 @@ static void mxs_auart_settermios(struct uart_port *u, AUART_LINECTRL_BAUD_DIV_MAX); baud_max = u->uartclk *32 /AUART_LINECTRL_BAUD_DIV_MIN ; baud =uart_get_baud_rate (u, termios, old, baud_min, baud_max); - div = u->uartclk *32 / baud; + div =DIV_ROUND_CLOSEST (u->uartclk *32 , baud); } ctrl |=AUART_LINECTRL_BAUD_DIVFRAC (div &0x3F );
Signature · 1 line
2.12.1