summary refs log tree commit diff
path: root/drivers/tty/serial/stm32-usart.h
diff options
context:
space:
mode:
authorErwan Le Ray <erwan.leray@foss.st.com>2021-10-20 17:03:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-21 10:36:29 +0200
commitd1ec8a2eabe969b333031e8fb36fe7fc61a5f0ac (patch)
tree5daa872c93a40eea24e60eefd7d3ecb27a09a2e9 /drivers/tty/serial/stm32-usart.h
parent33bb2f6ac3088936b7aad3cab6f439f91af0223c (diff)
downloadlinux-d1ec8a2eabe969b333031e8fb36fe7fc61a5f0ac.tar.gz
serial: stm32: update throttle and unthrottle ops for dma mode
Disable DMA request line (if enabled) to switch in PIO mode in throttle
ops, so the RX data gets queues into the FIFO. The hardware flow control
is triggered when the RX FIFO is full.

Switch back to DMA mode (re-enable DMA request line) in unthrottle ops.
Hardware flow control is stopped when FIFO is not full anymore.

Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20211020150332.10214-4-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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index 53bcd032fce7..e23916bfbb60 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -265,6 +265,7 @@ struct stm32_port {
 	u32 cr3_irq;		 /* USART_CR3_RXFTIE */
 	int last_res;
 	bool tx_dma_busy;	 /* dma tx busy               */
+	bool throttled;		 /* port throttled            */
 	bool hw_flow_control;
 	bool swap;		 /* swap RX & TX pins */
 	bool fifoen;