mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 21:01:50 +00:00
serial: sh-sci: Move overrun_bit and error_mask fields out of pdata
None of the fields is ever set by board code, and both of them are set in the driver at probe time. Move them out of struct plat_sci_port to struct sci_port. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
This commit is contained in:
parent
1fcc91a607
commit
3ae988d97b
3 changed files with 24 additions and 31 deletions
|
@ -64,6 +64,9 @@ struct sci_port {
|
||||||
|
|
||||||
/* Platform configuration */
|
/* Platform configuration */
|
||||||
struct plat_sci_port *cfg;
|
struct plat_sci_port *cfg;
|
||||||
|
int overrun_bit;
|
||||||
|
unsigned int error_mask;
|
||||||
|
|
||||||
|
|
||||||
/* Break timer */
|
/* Break timer */
|
||||||
struct timer_list break_timer;
|
struct timer_list break_timer;
|
||||||
|
@ -760,11 +763,8 @@ static int sci_handle_errors(struct uart_port *port)
|
||||||
struct tty_port *tport = &port->state->port;
|
struct tty_port *tport = &port->state->port;
|
||||||
struct sci_port *s = to_sci_port(port);
|
struct sci_port *s = to_sci_port(port);
|
||||||
|
|
||||||
/*
|
/* Handle overruns */
|
||||||
* Handle overruns, if supported.
|
if (status & (1 << s->overrun_bit)) {
|
||||||
*/
|
|
||||||
if (s->cfg->overrun_bit != SCIx_NOT_SUPPORTED) {
|
|
||||||
if (status & (1 << s->cfg->overrun_bit)) {
|
|
||||||
port->icount.overrun++;
|
port->icount.overrun++;
|
||||||
|
|
||||||
/* overrun error */
|
/* overrun error */
|
||||||
|
@ -773,7 +773,6 @@ static int sci_handle_errors(struct uart_port *port)
|
||||||
|
|
||||||
dev_notice(port->dev, "overrun error");
|
dev_notice(port->dev, "overrun error");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (status & SCxSR_FER(port)) {
|
if (status & SCxSR_FER(port)) {
|
||||||
if (sci_rxd_in(port) == 0) {
|
if (sci_rxd_in(port) == 0) {
|
||||||
|
@ -834,7 +833,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
|
||||||
if (!reg->size)
|
if (!reg->size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((serial_port_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {
|
if ((serial_port_in(port, SCLSR) & (1 << s->overrun_bit))) {
|
||||||
serial_port_out(port, SCLSR, 0);
|
serial_port_out(port, SCLSR, 0);
|
||||||
|
|
||||||
port->icount.overrun++;
|
port->icount.overrun++;
|
||||||
|
@ -2253,28 +2252,25 @@ static int sci_init_single(struct platform_device *dev,
|
||||||
/*
|
/*
|
||||||
* Establish some sensible defaults for the error detection.
|
* Establish some sensible defaults for the error detection.
|
||||||
*/
|
*/
|
||||||
if (!p->error_mask)
|
sci_port->error_mask = (p->type == PORT_SCI) ?
|
||||||
p->error_mask = (p->type == PORT_SCI) ?
|
|
||||||
SCI_DEFAULT_ERROR_MASK : SCIF_DEFAULT_ERROR_MASK;
|
SCI_DEFAULT_ERROR_MASK : SCIF_DEFAULT_ERROR_MASK;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Establish sensible defaults for the overrun detection, unless
|
* Establish sensible defaults for the overrun detection, unless
|
||||||
* the part has explicitly disabled support for it.
|
* the part has explicitly disabled support for it.
|
||||||
*/
|
*/
|
||||||
if (p->overrun_bit != SCIx_NOT_SUPPORTED) {
|
|
||||||
if (p->type == PORT_SCI)
|
if (p->type == PORT_SCI)
|
||||||
p->overrun_bit = 5;
|
sci_port->overrun_bit = 5;
|
||||||
else if (p->scbrr_algo_id == SCBRR_ALGO_4)
|
else if (p->scbrr_algo_id == SCBRR_ALGO_4)
|
||||||
p->overrun_bit = 9;
|
sci_port->overrun_bit = 9;
|
||||||
else
|
else
|
||||||
p->overrun_bit = 0;
|
sci_port->overrun_bit = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make the error mask inclusive of overrun detection, if
|
* Make the error mask inclusive of overrun detection, if
|
||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
p->error_mask |= (1 << p->overrun_bit);
|
sci_port->error_mask |= 1 << sci_port->overrun_bit;
|
||||||
}
|
|
||||||
|
|
||||||
port->type = p->type;
|
port->type = p->type;
|
||||||
port->flags = UPF_FIXED_PORT | p->flags;
|
port->flags = UPF_FIXED_PORT | p->flags;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
|
#define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
|
||||||
#define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
|
#define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
|
||||||
|
|
||||||
#define SCxSR_ERRORS(port) (to_sci_port(port)->cfg->error_mask)
|
#define SCxSR_ERRORS(port) (to_sci_port(port)->error_mask)
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
|
||||||
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
|
||||||
|
|
|
@ -152,9 +152,6 @@ struct plat_sci_port {
|
||||||
/*
|
/*
|
||||||
* Platform overrides if necessary, defaults otherwise.
|
* Platform overrides if necessary, defaults otherwise.
|
||||||
*/
|
*/
|
||||||
int overrun_bit;
|
|
||||||
unsigned int error_mask;
|
|
||||||
|
|
||||||
int port_reg;
|
int port_reg;
|
||||||
unsigned char regshift;
|
unsigned char regshift;
|
||||||
unsigned char regtype;
|
unsigned char regtype;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue