[PATCH] amba-pl011: support hardware flow control

Rabin Vincent rabin.vincent at stericsson.com
Mon Feb 8 08:41:50 EST 2010


Enable/disable hardware flow control as requested by the termios.

Acked-by: Linus Walleij <linus.walleij at stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent at stericsson.com>
---
 drivers/serial/amba-pl011.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index ef7adc8..6f37db4 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -532,6 +532,11 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
 	old_cr = readw(port->membase + UART011_CR);
 	writew(0, port->membase + UART011_CR);
 
+	if (termios->c_cflag & CRTSCTS)
+		old_cr |= UART011_CR_CTSEN | UART011_CR_RTSEN;
+	else
+		old_cr &= ~(UART011_CR_CTSEN | UART011_CR_RTSEN);
+
 	/* Set baud rate */
 	writew(quot & 0x3f, port->membase + UART011_FBRD);
 	writew(quot >> 6, port->membase + UART011_IBRD);
-- 
1.6.5.3




More information about the linux-arm-kernel mailing list