diff options
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index fd60d72eac89..761a800cb483 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1771,18 +1771,25 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1771 | 1771 | ||
1772 | sci_init_pins(port, termios->c_cflag); | 1772 | sci_init_pins(port, termios->c_cflag); |
1773 | 1773 | ||
1774 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { | 1774 | reg = sci_getreg(port, SCFCR); |
1775 | reg = sci_getreg(port, SCFCR); | 1775 | if (reg->size) { |
1776 | if (reg->size) { | 1776 | unsigned short ctrl = sci_in(port, SCFCR); |
1777 | unsigned short ctrl; | ||
1778 | 1777 | ||
1779 | ctrl = sci_in(port, SCFCR); | 1778 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { |
1780 | if (termios->c_cflag & CRTSCTS) | 1779 | if (termios->c_cflag & CRTSCTS) |
1781 | ctrl |= SCFCR_MCE; | 1780 | ctrl |= SCFCR_MCE; |
1782 | else | 1781 | else |
1783 | ctrl &= ~SCFCR_MCE; | 1782 | ctrl &= ~SCFCR_MCE; |
1784 | sci_out(port, SCFCR, ctrl); | ||
1785 | } | 1783 | } |
1784 | |||
1785 | /* | ||
1786 | * As we've done a sci_reset() above, ensure we don't | ||
1787 | * interfere with the FIFOs while toggling MCE. As the | ||
1788 | * reset values could still be set, simply mask them out. | ||
1789 | */ | ||
1790 | ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); | ||
1791 | |||
1792 | sci_out(port, SCFCR, ctrl); | ||
1786 | } | 1793 | } |
1787 | 1794 | ||
1788 | sci_out(port, SCSCR, s->cfg->scscr); | 1795 | sci_out(port, SCSCR, s->cfg->scscr); |