aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-12-02 03:44:50 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-12-02 03:44:50 -0500
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 46deaaec836d..fd60d72eac89 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)
474 if (!reg->size) 474 if (!reg->size)
475 return; 475 return;
476 476
477 if (!(cflag & CRTSCTS)) 477 if ((s->cfg->capabilities & SCIx_HAVE_RTSCTS) &&
478 sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */ 478 ((!(cflag & CRTSCTS)))) {
479 unsigned short status;
480
481 status = sci_in(port, SCSPTR);
482 status &= ~SCSPTR_CTSIO;
483 status |= SCSPTR_RTSIO;
484 sci_out(port, SCSPTR, status); /* Set RTS = 1 */
485 }
479} 486}
480 487
481static int sci_txfill(struct uart_port *port) 488static int sci_txfill(struct uart_port *port)
@@ -1764,16 +1771,18 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
1764 1771
1765 sci_init_pins(port, termios->c_cflag); 1772 sci_init_pins(port, termios->c_cflag);
1766 1773
1767 reg = sci_getreg(port, SCFCR); 1774 if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
1768 if (reg->size) { 1775 reg = sci_getreg(port, SCFCR);
1769 unsigned short ctrl; 1776 if (reg->size) {
1777 unsigned short ctrl;
1770 1778
1771 ctrl = sci_in(port, SCFCR); 1779 ctrl = sci_in(port, SCFCR);
1772 if (termios->c_cflag & CRTSCTS) 1780 if (termios->c_cflag & CRTSCTS)
1773 ctrl |= SCFCR_MCE; 1781 ctrl |= SCFCR_MCE;
1774 else 1782 else
1775 ctrl &= ~SCFCR_MCE; 1783 ctrl &= ~SCFCR_MCE;
1776 sci_out(port, SCFCR, ctrl); 1784 sci_out(port, SCFCR, ctrl);
1785 }
1777 } 1786 }
1778 1787
1779 sci_out(port, SCSCR, s->cfg->scscr); 1788 sci_out(port, SCSCR, s->cfg->scscr);