serial: stm32x7: simplify baud rate register calculation
Simplify baud rate register formula and use the oversampling
uart feature.
This code is aligned with what is implemented in kernel driver
drivers/tty/serial/stm32-usart.c since kernel v4.9.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Acked-by: Vikas MANOCHA <vikas.manocha@st.com>
diff --git a/drivers/serial/serial_stm32x7.h b/drivers/serial/serial_stm32x7.h
index 8c02548..facfdba 100644
--- a/drivers/serial/serial_stm32x7.h
+++ b/drivers/serial/serial_stm32x7.h
@@ -23,8 +23,9 @@
};
-#define USART_CR1_RE (1 << 2)
+#define USART_CR1_OVER8 (1 << 15)
#define USART_CR1_TE (1 << 3)
+#define USART_CR1_RE (1 << 2)
#define USART_CR1_UE (1 << 0)
#define USART_CR3_OVRDIS (1 << 12)