Skip to content

Commit

Permalink
serial/imx: fix custom-baudrate handling
Browse files Browse the repository at this point in the history
It was not possible to set custom-baudrates like 62500.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Hubert Feurstein authored and Greg Kroah-Hartman committed Jul 26, 2013
1 parent a496e62 commit 09bd00f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
@@ -1028,6 +1028,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;

0 comments on commit 09bd00f

Please sign in to comment.