aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-12-02 17:44:50 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-12-02 17:44:50 +0900
commitfaf02f8fee5563ea7f950b3f5f08c654aa6c4525 (patch)
tree83ec05fb78a55eef43f0a03abed9efcdc75aaf36 /drivers/tty/serial/sh-sci.c
parentdc7e3ef7dade7041fb1809f2a5403efac655a791 (diff)
serial: sh-sci: per-port modem control.
The bulk of the ports do not support any sort of modem control, so blindly twiddling the MCE bit doesn't accomplish much. We now require ports to manually specify which line supports modem control signals. While at it, tidy up the RTS/CTSIO handling in SCSPTR parts so it's a bit more obvious what's going on (and without clobbering other configurations in the process). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r--drivers/tty/serial/sh-sci.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 46deaaec836..fd60d72eac8 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -474,8 +474,15 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
if (!reg->size)
return;
- if (!(cflag & CRTSCTS))
- sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */
+ if ((s->cfg->capabilities & SCIx_HAVE_RTSCTS) &&
+ ((!(cflag & CRTSCTS)))) {
+ unsigned short status;
+
+ status = sci_in(port, SCSPTR);
+ status &= ~SCSPTR_CTSIO;
+ status |= SCSPTR_RTSIO;
+ sci_out(port, SCSPTR, status); /* Set RTS = 1 */
+ }
}
static int sci_txfill(struct uart_port *port)
@@ -1764,16 +1771,18 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
sci_init_pins(port, termios->c_cflag);
- reg = sci_getreg(port, SCFCR);
- if (reg->size) {
- unsigned short ctrl;
+ if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
+ reg = sci_getreg(port, SCFCR);
+ if (reg->size) {
+ unsigned short ctrl;
- ctrl = sci_in(port, SCFCR);
- if (termios->c_cflag & CRTSCTS)
- ctrl |= SCFCR_MCE;
- else
- ctrl &= ~SCFCR_MCE;
- sci_out(port, SCFCR, ctrl);
+ ctrl = sci_in(port, SCFCR);
+ if (termios->c_cflag & CRTSCTS)
+ ctrl |= SCFCR_MCE;
+ else
+ ctrl &= ~SCFCR_MCE;
+ sci_out(port, SCFCR, ctrl);
+ }
}
sci_out(port, SCSCR, s->cfg->scscr);