diff options
author | Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com> | 2012-04-12 06:19:21 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-04-12 06:19:21 -0400 |
commit | a4e02f6d83d4fcdb13bcaba76878fc5ea0da9911 (patch) | |
tree | 03fa3cfb50f700049f4389b642cd1e232ea3ab89 | |
parent | ee565105ccedc63728a83f4deb1c10dc57091959 (diff) |
serial: sh-sci: Update break_ctl handling for all SCSPTR-capable regtypes.
This updates the earlier break_ctl support regardless of regtype so long
as the requisite SCSPTR exists. This is the same approach used by
sci_init_pins() for providing a generic solution now that we're able to
detect register capabilities on a per-port basis.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 3e471fc12991..be31d85a50e3 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1565,31 +1565,31 @@ static void sci_enable_ms(struct uart_port *port) | |||
1565 | static void sci_break_ctl(struct uart_port *port, int break_state) | 1565 | static void sci_break_ctl(struct uart_port *port, int break_state) |
1566 | { | 1566 | { |
1567 | struct sci_port *s = to_sci_port(port); | 1567 | struct sci_port *s = to_sci_port(port); |
1568 | struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR; | ||
1568 | unsigned short scscr, scsptr; | 1569 | unsigned short scscr, scsptr; |
1569 | 1570 | ||
1570 | switch (s->cfg->regtype) { | 1571 | /* check wheter the port has SCSPTR */ |
1571 | case SCIx_SH4_SCIF_REGTYPE: | 1572 | if (!reg->size) { |
1572 | scsptr = serial_port_in(port, SCSPTR); | ||
1573 | scscr = serial_port_in(port, SCSCR); | ||
1574 | |||
1575 | if (break_state == -1) { | ||
1576 | scsptr = (scsptr | SCSPTR_SPB2IO) & ~SCSPTR_SPB2DT; | ||
1577 | scscr &= ~SCSCR_TE; | ||
1578 | } else { | ||
1579 | scsptr = (scsptr | SCSPTR_SPB2DT) & ~SCSPTR_SPB2IO; | ||
1580 | scscr |= SCSCR_TE; | ||
1581 | } | ||
1582 | |||
1583 | serial_port_out(port, SCSPTR, scsptr); | ||
1584 | serial_port_out(port, SCSCR, scscr); | ||
1585 | break; | ||
1586 | default: | ||
1587 | /* | 1573 | /* |
1588 | * Not supported by hardware. Most parts couple break and rx | 1574 | * Not supported by hardware. Most parts couple break and rx |
1589 | * interrupts together, with break detection always enabled. | 1575 | * interrupts together, with break detection always enabled. |
1590 | */ | 1576 | */ |
1591 | break; | 1577 | return; |
1592 | } | 1578 | } |
1579 | |||
1580 | scsptr = serial_port_in(port, SCSPTR); | ||
1581 | scscr = serial_port_in(port, SCSCR); | ||
1582 | |||
1583 | if (break_state == -1) { | ||
1584 | scsptr = (scsptr | SCSPTR_SPB2IO) & ~SCSPTR_SPB2DT; | ||
1585 | scscr &= ~SCSCR_TE; | ||
1586 | } else { | ||
1587 | scsptr = (scsptr | SCSPTR_SPB2DT) & ~SCSPTR_SPB2IO; | ||
1588 | scscr |= SCSCR_TE; | ||
1589 | } | ||
1590 | |||
1591 | serial_port_out(port, SCSPTR, scsptr); | ||
1592 | serial_port_out(port, SCSCR, scscr); | ||
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1595 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |