aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-12-02 05:02:06 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-12-02 05:02:06 -0500
commit73c3d53f38e0a8e6c67b0d12d77a8e77c082cd03 (patch)
treefa620f0906a5e20bd2c00297bd106acfb1dc1089 /drivers/tty/serial/sh-sci.c
parentfaf02f8fee5563ea7f950b3f5f08c654aa6c4525 (diff)
serial: sh-sci: Avoid FIFO clear for MCE toggle.
When toggling the MCE support we don't want to concern ourselves with the FIFO state, so ensure that the clearing bits are masked out when updating the MCE state. 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.c19
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);