summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/stm32-usart.h
diff options
context:
space:
mode:
authorMartin Devera <devik@eaxlabs.cz>2021-03-28 18:43:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-05 13:06:52 +0300
commit3cd66593725a234662955baaf78d2ce5333de56d (patch)
tree23ec4270a758fc328c50ed92cb659b2439db3795 /drivers/tty/serial/stm32-usart.h
parent1b8dc3988dd204aef296047a02364b5ad823f1b4 (diff)
downloadlinux-3cd66593725a234662955baaf78d2ce5333de56d.tar.xz
tty/serial: Add rx-tx-swap OF option to stm32-usart
STM32 F7/H7 usarts supports RX & TX pin swapping. Add option to turn it on. Tested on STM32MP157. Acked-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Signed-off-by: Martin Devera <devik@eaxlabs.cz> Link: https://lore.kernel.org/r/20210328154306.22674-2-devik@eaxlabs.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/stm32-usart.h')
-rw-r--r--drivers/tty/serial/stm32-usart.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index a86773f1a4c4..77d1ac082e89 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -25,6 +25,7 @@ struct stm32_usart_offsets {
struct stm32_usart_config {
u8 uart_enable_bit; /* USART_CR1_UE */
bool has_7bits_data;
+ bool has_swap;
bool has_wakeup;
bool has_fifo;
int fifosize;
@@ -76,6 +77,7 @@ struct stm32_usart_info stm32f7_info = {
.cfg = {
.uart_enable_bit = 0,
.has_7bits_data = true,
+ .has_swap = true,
.fifosize = 1,
}
};
@@ -97,6 +99,7 @@ struct stm32_usart_info stm32h7_info = {
.cfg = {
.uart_enable_bit = 0,
.has_7bits_data = true,
+ .has_swap = true,
.has_wakeup = true,
.has_fifo = true,
.fifosize = 16,
@@ -268,6 +271,7 @@ struct stm32_port {
int last_res;
bool tx_dma_busy; /* dma tx busy */
bool hw_flow_control;
+ bool swap; /* swap RX & TX pins */
bool fifoen;
bool wakeup_src;
int rdr_mask; /* receive data register mask */