serial: stm32: implement prescaler tuning to compute low baudrate
authorValentin Caron <valentin.caron@foss.st.com>
Fri, 12 Jan 2024 09:52:57 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 03:04:11 +0000 (19:04 -0800)
commitec240f88934f6ecda5cd21514cc6f30e0ec5d955
treefc6719cd907a799b581d89794ad9da565d34e1f5
parent5c49b6a4a4bcf368f85cfe7a0e5ac3a7016f30fd
serial: stm32: implement prescaler tuning to compute low baudrate

In the case of high USART input clock and low baud rate, BRR value
is not enough to get correct baud rate. So here we use USART prescaler to
divide USART input clock to get the correct baud rate.

PRESC register is only available since stm32h7.

Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20240112095300.2004878-2-valentin.caron@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.c
drivers/tty/serial/stm32-usart.h