From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Andrew Victor <linux@maxim.org.za>,
Nicolas Ferre <nicolas.ferre@rfo.atmel.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Peter Ma <pma@mediamatech.com>,
Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Subject: [PATCH 2/2] avr32: add hardware handshake support to atmel_serial
Date: Wed, 1 Apr 2009 10:53:58 +0200 [thread overview]
Message-ID: <1238576038-8915-2-git-send-email-haavard.skinnemoen@atmel.com> (raw)
In-Reply-To: <1238576038-8915-1-git-send-email-haavard.skinnemoen@atmel.com>
From: Peter Ma <pma@mediamatech.com>
Adds Hardware Handshake (aka RTS/CTS flow-control) support to
atmel_serial driver, as a termios flag.
For this to actually work, the platform code needs to configure the RTS
and CTS pins for use by the USART. This has been done for AVR32 as a
separate patch.
Signed-off-by: Peter Ma <pma@mediamatech.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
drivers/serial/atmel_serial.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 8f58f7f..b3497d7 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -1020,7 +1020,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
/* Get current mode register */
mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL
- | ATMEL_US_NBSTOP | ATMEL_US_PAR);
+ | ATMEL_US_NBSTOP | ATMEL_US_PAR
+ | ATMEL_US_USMODE);
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
quot = uart_get_divisor(port, baud);
@@ -1065,6 +1066,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
} else
mode |= ATMEL_US_PAR_NONE;
+ /* hardware handshake (RTS/CTS) */
+ if (termios->c_cflag & CRTSCTS)
+ mode |= ATMEL_US_USMODE_HWHS;
+ else
+ mode |= ATMEL_US_USMODE_NORMAL;
+
spin_lock_irqsave(&port->lock, flags);
port->read_status_mask = ATMEL_US_OVRE;
--
1.6.0.4
next prev parent reply other threads:[~2009-04-01 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-01 8:53 [PATCH 1/2] avr32: add RTS/CTS/CLK pin selection for the USARTs Haavard Skinnemoen
2009-04-01 8:53 ` Haavard Skinnemoen [this message]
2009-04-01 9:13 ` [PATCH 2/2] avr32: add hardware handshake support to atmel_serial Alan Cox
2009-04-01 9:21 ` Haavard Skinnemoen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1238576038-8915-2-git-send-email-haavard.skinnemoen@atmel.com \
--to=haavard.skinnemoen@atmel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@rfo.atmel.com \
--cc=pma@mediamatech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®