summaryrefslogtreecommitdiffstats
path: root/drivers/serial/imx.c
diff options
context:
space:
mode:
authorSascha Hauer <sascha@saschahauer.de>2005-08-31 21:48:47 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-08-31 21:48:47 +0100
commit0f302dc35412dc67035efc188b9d5c40711b4222 (patch)
tree57cbbe8e722e6a82bfd8bb3b8227898c54615c72 /drivers/serial/imx.c
parentb129a8ccd53f74c43e4c83c8e0031a4990040830 (diff)
downloadkernel-crypto-0f302dc35412dc67035efc188b9d5c40711b4222.tar.gz
kernel-crypto-0f302dc35412dc67035efc188b9d5c40711b4222.tar.xz
kernel-crypto-0f302dc35412dc67035efc188b9d5c40711b4222.zip
[ARM] 2866/1: add i.MX set_mctrl / get_mctrl functions
Patch from Sascha Hauer This patch adds support for setting and getting RTS / CTS via set_mtctrl / get_mctrl functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r--drivers/serial/imx.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 8861bcf84ad..4c985e6b378 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -291,13 +291,31 @@ static unsigned int imx_tx_empty(struct uart_port *port)
return USR2((u32)sport->port.membase) & USR2_TXDC ? TIOCSER_TEMT : 0;
}
+/*
+ * We have a modem side uart, so the meanings of RTS and CTS are inverted.
+ */
static unsigned int imx_get_mctrl(struct uart_port *port)
{
- return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
+ struct imx_port *sport = (struct imx_port *)port;
+ unsigned int tmp = TIOCM_DSR | TIOCM_CAR;
+
+ if (USR1((u32)sport->port.membase) & USR1_RTSS)
+ tmp |= TIOCM_CTS;
+
+ if (UCR2((u32)sport->port.membase) & UCR2_CTS)
+ tmp |= TIOCM_RTS;
+
+ return tmp;
}
static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
+ struct imx_port *sport = (struct imx_port *)port;
+
+ if (mctrl & TIOCM_RTS)
+ UCR2((u32)sport->port.membase) |= UCR2_CTS;
+ else
+ UCR2((u32)sport->port.membase) &= ~UCR2_CTS;
}
/*