diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-11-19 14:35:09 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-12-17 11:18:41 +0100 |
commit | ff8b275f1f0927621cf543c2a6f02761052c360d (patch) | |
tree | 995361d1676ac5a26f36deb1d9acba89d57d914f /drivers/tty | |
parent | b4a5c459088b724734573a550c9da42a9a19c9d0 (diff) | |
download | op-kernel-dev-ff8b275f1f0927621cf543c2a6f02761052c360d.zip op-kernel-dev-ff8b275f1f0927621cf543c2a6f02761052c360d.tar.gz |
serial: sh-sci: Take into account sampling rate for max baud rate
The maximum baud rate depends on the sampling rate.
HSCIF has a variable sampling rate and sets s->sampling_rate to zero,
hence use the minimum sampling rate of 8.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index d89d4b7..5b12075 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1975,7 +1975,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, * that the previous boot loader has enabled required clocks and * setup the baud rate generator hardware for us already. */ - max_baud = port->uartclk ? port->uartclk / 16 : 115200; + if (port->uartclk) + max_baud = port->uartclk / max(s->sampling_rate, 8U); + else + max_baud = 115200; baud = uart_get_baud_rate(port, termios, old, 0, max_baud); if (likely(baud && port->uartclk)) |