diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-05 07:35:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 17:57:27 -0500 |
commit | 19038ad9f08c96dcff870b18af8fd5ae5141dec1 (patch) | |
tree | b3524f4c8e6b4015f6f9ef2ec5bc0388b8286c7b /drivers/tty/serial/xilinx_uartps.c | |
parent | f77d55a3b56a98d14b6e7dc549c24b33011d175d (diff) |
tty: xuartps: Add support for setting modem control signals
Add support for setting the state of the DTR and RTS signals.
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/xilinx_uartps.c')
-rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 200c1af2141b..542bab37e502 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c | |||
@@ -133,6 +133,15 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255"); | |||
133 | #define CDNS_UART_IXR_BRK 0x80000000 | 133 | #define CDNS_UART_IXR_BRK 0x80000000 |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Modem Control register: | ||
137 | * The read/write Modem Control register controls the interface with the modem | ||
138 | * or data set, or a peripheral device emulating a modem. | ||
139 | */ | ||
140 | #define CDNS_UART_MODEMCR_FCM 0x00000020 /* Automatic flow control mode */ | ||
141 | #define CDNS_UART_MODEMCR_RTS 0x00000002 /* Request to send output control */ | ||
142 | #define CDNS_UART_MODEMCR_DTR 0x00000001 /* Data Terminal Ready */ | ||
143 | |||
144 | /* | ||
136 | * Channel Status Register: | 145 | * Channel Status Register: |
137 | * The channel status register (CSR) is provided to enable the control logic | 146 | * The channel status register (CSR) is provided to enable the control logic |
138 | * to monitor the status of bits in the channel interrupt status register, | 147 | * to monitor the status of bits in the channel interrupt status register, |
@@ -915,7 +924,18 @@ static unsigned int cdns_uart_get_mctrl(struct uart_port *port) | |||
915 | 924 | ||
916 | static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) | 925 | static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) |
917 | { | 926 | { |
918 | /* N/A */ | 927 | u32 val; |
928 | |||
929 | val = cdns_uart_readl(CDNS_UART_MODEMCR_OFFSET); | ||
930 | |||
931 | val &= ~(CDNS_UART_MODEMCR_RTS | CDNS_UART_MODEMCR_DTR); | ||
932 | |||
933 | if (mctrl & TIOCM_RTS) | ||
934 | val |= CDNS_UART_MODEMCR_RTS; | ||
935 | if (mctrl & TIOCM_DTR) | ||
936 | val |= CDNS_UART_MODEMCR_DTR; | ||
937 | |||
938 | cdns_uart_writel(val, CDNS_UART_MODEMCR_OFFSET); | ||
919 | } | 939 | } |
920 | 940 | ||
921 | #ifdef CONFIG_CONSOLE_POLL | 941 | #ifdef CONFIG_CONSOLE_POLL |