diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-12-02 19:02:06 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-12-02 19:02:06 +0900 |
commit | 73c3d53f38e0a8e6c67b0d12d77a8e77c082cd03 (patch) | |
tree | fa620f0906a5e20bd2c00297bd106acfb1dc1089 /drivers/tty/serial/sh-sci.c | |
parent | faf02f8fee5563ea7f950b3f5f08c654aa6c4525 (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.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, sci_init_pins(port, termios->c_cflag); - if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { - reg = sci_getreg(port, SCFCR); - if (reg->size) { - unsigned short ctrl; + reg = sci_getreg(port, SCFCR); + if (reg->size) { + unsigned short ctrl = sci_in(port, SCFCR); - ctrl = sci_in(port, SCFCR); + if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { if (termios->c_cflag & CRTSCTS) ctrl |= SCFCR_MCE; else ctrl &= ~SCFCR_MCE; - sci_out(port, SCFCR, ctrl); } + + /* + * As we've done a sci_reset() above, ensure we don't + * interfere with the FIFOs while toggling MCE. As the + * reset values could still be set, simply mask them out. + */ + ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); + + sci_out(port, SCFCR, ctrl); } sci_out(port, SCSCR, s->cfg->scscr); |