Skip to content

Commit

Permalink
serial: sh-sci: Clear (H)SCIF timeout and overrun during reset
Browse files Browse the repository at this point in the history
Add the missing timeout bit definition for (H)SCIF.
Clear the timeout and overrun flag bits during UART reset, cfr. the
initialization flowchart in the datasheet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Geert Uytterhoeven authored and Greg Kroah-Hartman committed Jun 25, 2016
1 parent 2768cf4 commit fc2af33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,11 @@ static void sci_reset(struct uart_port *port)
sci_clear_SCxSR(port,
SCxSR_RDxF_CLEAR(port) & SCxSR_ERROR_CLEAR(port) &
SCxSR_BREAK_CLEAR(port));
if (sci_getreg(port, SCLSR)->size) {
status = serial_port_in(port, SCLSR);
status &= ~(SCLSR_TO | SCLSR_ORER);
serial_port_out(port, SCLSR, status);
}
}

static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/sh-sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ enum {
#define SCFCR_LOOP BIT(0) /* Loopback Test */

/* SCLSR (Line Status Register) on (H)SCIF */
#define SCLSR_TO BIT(2) /* Timeout */
#define SCLSR_ORER BIT(0) /* Overrun Error */

/* SCSPTR (Serial Port Register), optional */
Expand Down

0 comments on commit fc2af33

Please sign in to comment.