summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/stm32-usart.h
diff options
context:
space:
mode:
authorErwan Le Ray <erwan.leray@foss.st.com>2021-03-04 19:23:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-10 11:34:11 +0300
commit3db1d52466dc11dca4e47ef12a6e6e97f846af62 (patch)
tree4d69aad6139f71ecdb50c81e71d8c3ba41bdde84 /drivers/tty/serial/stm32-usart.h
parent9f77d19207a0e8ba814c8ceb22e90ce7cb2aef64 (diff)
downloadlinux-3db1d52466dc11dca4e47ef12a6e6e97f846af62.tar.xz
serial: stm32: fix tx_empty condition
In "tx_empty", we should poll TC bit in both DMA and PIO modes (instead of TXE) to check transmission data register has been transmitted independently of the FIFO mode. TC indicates that both transmit register and shift register are empty. When shift register is empty, tx_empty should return TIOCSER_TEMT instead of TC value. Cleans the USART_CR_TC TCCF register define (transmission complete clear flag) as it is duplicate of USART_ICR_TCCF. Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com> Link: https://lore.kernel.org/r/20210304162308.8984-13-erwan.leray@foss.st.com 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.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index cb4f327c46db..94b568aa46bb 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -127,9 +127,6 @@ struct stm32_usart_info stm32h7_info = {
/* Dummy bits */
#define USART_SR_DUMMY_RX BIT(16)
-/* USART_ICR (F7) */
-#define USART_CR_TC BIT(6)
-
/* USART_DR */
#define USART_DR_MASK GENMASK(8, 0)