mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
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>
This commit is contained in:
parent
0034102808
commit
bbb4ce50f3
2 changed files with 28 additions and 4 deletions
|
@ -1564,10 +1564,32 @@ static void sci_enable_ms(struct uart_port *port)
|
||||||
|
|
||||||
static void sci_break_ctl(struct uart_port *port, int break_state)
|
static void sci_break_ctl(struct uart_port *port, int break_state)
|
||||||
{
|
{
|
||||||
|
struct sci_port *s = to_sci_port(port);
|
||||||
|
unsigned short scscr, scsptr;
|
||||||
|
|
||||||
|
switch (s->cfg->regtype) {
|
||||||
|
case SCIx_SH4_SCIF_REGTYPE:
|
||||||
|
scsptr = serial_port_in(port, SCSPTR);
|
||||||
|
scscr = serial_port_in(port, SCSCR);
|
||||||
|
|
||||||
|
if (break_state == -1) {
|
||||||
|
scsptr = (scsptr | SCSPTR_SPB2IO) & ~SCSPTR_SPB2DT;
|
||||||
|
scscr &= ~SCSCR_TE;
|
||||||
|
} else {
|
||||||
|
scsptr = (scsptr | SCSPTR_SPB2DT) & ~SCSPTR_SPB2IO;
|
||||||
|
scscr |= SCSCR_TE;
|
||||||
|
}
|
||||||
|
|
||||||
|
serial_port_out(port, SCSPTR, scsptr);
|
||||||
|
serial_port_out(port, SCSCR, scscr);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
/*
|
/*
|
||||||
* Not supported by hardware. Most parts couple break and rx
|
* Not supported by hardware. Most parts couple break and rx
|
||||||
* interrupts together, with break detection always enabled.
|
* interrupts together, with break detection always enabled.
|
||||||
*/
|
*/
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SERIAL_SH_SCI_DMA
|
#ifdef CONFIG_SERIAL_SH_SCI_DMA
|
||||||
|
|
|
@ -52,6 +52,8 @@ enum {
|
||||||
/* SCSPTR, optional */
|
/* SCSPTR, optional */
|
||||||
#define SCSPTR_RTSIO (1 << 7)
|
#define SCSPTR_RTSIO (1 << 7)
|
||||||
#define SCSPTR_CTSIO (1 << 5)
|
#define SCSPTR_CTSIO (1 << 5)
|
||||||
|
#define SCSPTR_SPB2IO (1 << 1)
|
||||||
|
#define SCSPTR_SPB2DT (1 << 0)
|
||||||
|
|
||||||
/* Offsets into the sci_port->irqs array */
|
/* Offsets into the sci_port->irqs array */
|
||||||
enum {
|
enum {
|
||||||
|
|
Loading…
Reference in a new issue