mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
b4a5c45908
commit
ff8b275f1f
1 changed files with 4 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue