diff options
author | Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com> | 2012-04-05 20:59:14 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-04-09 04:39:34 -0400 |
commit | bbb4ce50f3169b08764f9965fd5b9655646d545a (patch) | |
tree | 78d1a6638af4dd952d78eb6e5cc5c7026bec0146 /drivers/tty | |
parent | 0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff) |
serial: sh-sci: modify sci_break_ctl()
SCIF modules which have SCSPTR can output the break signal. Now that we
have a way of determining port features/capabilities, add trivial break
control via SCSPTR support. Tested on sh7757lcr.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 3158e17b665c..3e471fc12991 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1564,10 +1564,32 @@ static void sci_enable_ms(struct uart_port *port) | |||
1564 | 1564 | ||
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 | /* | 1567 | struct sci_port *s = to_sci_port(port); |
1568 | * Not supported by hardware. Most parts couple break and rx | 1568 | unsigned short scscr, scsptr; |
1569 | * interrupts together, with break detection always enabled. | 1569 | |
1570 | */ | 1570 | switch (s->cfg->regtype) { |
1571 | case SCIx_SH4_SCIF_REGTYPE: | ||
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 | /* | ||
1588 | * Not supported by hardware. Most parts couple break and rx | ||
1589 | * interrupts together, with break detection always enabled. | ||
1590 | */ | ||
1591 | break; | ||
1592 | } | ||
1571 | } | 1593 | } |
1572 | 1594 | ||
1573 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1595 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |