serial: sprd: Modify the baud rate calculation formula
authorLanqing Liu <lanqing.liu@unisoc.com>
Tue, 19 Feb 2019 07:31:11 +0000 (15:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2019 11:35:02 +0000 (12:35 +0100)
commit5b9cea15a3de5d65000d49f626b71b00d42a0577
treea5431021d1836f3bc3d8cb39fc40c232702903fb
parent0e585aabc500693461a0663013319264ba5927f3
serial: sprd: Modify the baud rate calculation formula

When the source clock is not divisible by the expected baud rate and
the remainder is not less than half of the expected baud rate, the old
formular will round up the frequency division coefficient. This will
make the actual baud rate less than the expected value and can not meet
the external transmission requirements.

Thus this patch modifies the baud rate calculation formula to support
the serial controller output the maximum baud rate.

Signed-off-by: Lanqing Liu <lanqing.liu@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sprd_serial.c