serial: mvebu-uart: add function to change baudrate
authorAllen Yan <yanwei@marvell.com>
Fri, 13 Oct 2017 09:01:51 +0000 (11:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Oct 2017 12:20:06 +0000 (14:20 +0200)
commit68a0db1d7da20fc99b64debddf71e7c6d1b9e334
tree6281a50f9c59ea7490d6aa6278f2124a21367ff2
parent9c3d3ee1239bab92d509f334530796d0ced4ca98
serial: mvebu-uart: add function to change baudrate

Until now, the first UART port baudrate was set by the bootloader.

Add a function allowing to change the baudrate. Changes may be done
from userspace but also at probe time by the kernel. Use the simplest
method: baudrate divisor.

Works for all UART ports until 230400 baud. To achieve higher baudrates,
software should implement the fractional divisor feature that allows
more accuracy for higher rates.

Signed-off-by: Allen Yan <yanwei@marvell.com>
[<miquel.raynal@free-electrons.com>: changed termios handling]
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mvebu-uart.c