diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-08-21 21:02:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 19:33:48 +0300 |
commit | 5da0f468745bc2dd992f49511bae5183efadfa05 (patch) | |
tree | ec9a6ef97b0625aa030731d9b94c55a5a57bae56 /drivers/tty/serial/sh-sci.c | |
parent | a9efeca613a8fe5281d7c91f5c8c9ea46f2312f6 (diff) | |
download | linux-5da0f468745bc2dd992f49511bae5183efadfa05.tar.xz |
serial: sh-sci: Correct SCIF_ERROR_CLEAR for plain SCIF
SCIF_ERROR_CLEAR includes SCIFA_ORER, which exists only on SCIFA/SCIFB
and SCIF on sh7705/sh7720/sh7721.
To fix this:
1. Remove SCIFA_ORER from the definition of SCIF_ERROR_CLEAR,
2. During initialization, store the error clear mask to use,
incorporating the overrun bit only if it applies to the SCxSR
register.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index b014fce1509d..fa26be7f9414 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -84,6 +84,7 @@ struct sci_port { unsigned int overrun_reg; unsigned int overrun_mask; unsigned int error_mask; + unsigned int error_clear; unsigned int sampling_rate; resource_size_t reg_size; @@ -2319,15 +2320,22 @@ static int sci_init_single(struct platform_device *dev, /* * Establish some sensible defaults for the error detection. */ - sci_port->error_mask = (p->type == PORT_SCI) ? - SCI_DEFAULT_ERROR_MASK : SCIF_DEFAULT_ERROR_MASK; + if (p->type == PORT_SCI) { + sci_port->error_mask = SCI_DEFAULT_ERROR_MASK; + sci_port->error_clear = SCI_ERROR_CLEAR; + } else { + sci_port->error_mask = SCIF_DEFAULT_ERROR_MASK; + sci_port->error_clear = SCIF_ERROR_CLEAR; + } /* * Make the error mask inclusive of overrun detection, if * supported. */ - if (sci_port->overrun_reg == SCxSR) + if (sci_port->overrun_reg == SCxSR) { sci_port->error_mask |= sci_port->overrun_mask; + sci_port->error_clear &= ~sci_port->overrun_mask; + } port->type = p->type; port->flags = UPF_FIXED_PORT | p->flags; |