OSDN Git Service

serial: stm32: fix word length configuration
authorErwan Le Ray <erwan.leray@st.com>
Tue, 21 May 2019 15:45:41 +0000 (17:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:50 +0000 (14:50 +0100)
commit144fdb20e5c8fb4f14a75225ff8de885c78271f5
treeb6b537aca73f8a2273f70d7d30216b8b7554a9e4
parentbf53cf6a38dcd8d503d3abc82f8cc2eca7be03ed
serial: stm32: fix word length configuration

[ Upstream commit c8a9d043947b4acb19a65f7fac2bd0893e581cd5 ]

STM32 supports either:
- 8 and 9 bits word length (including parity bit) for stm32f4 compatible
  devices
- 7, 8 and 9 bits word length (including parity bit) for stm32f7 and
  stm32h7 compatible devices.

As a consequence STM32 supports the following termios configurations:
- CS7 with parity bit, and CS8 (with or without parity bit) for stm32f4
  compatible devices.
- CS6 with parity bit, CS7 and CS8 (with or without parity bit) for
  stm32f7 and stm32h7 compatible devices.

This patch is fixing word length by configuring correctly the SoC with
supported configurations.

Fixes: ada8618ff3bf ("serial: stm32: adding support for stm32f7")
Signed-off-by: Erwan Le Ray <erwan.leray@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/stm32-usart.c
drivers/tty/serial/stm32-usart.h