Skip to contentSkip to conversation

serial: sh-sci: modify sci_break_ctl()

PATCH Superseded Shimoda, Yoshihiro 1 participant 2 messages Apr 5, 2012 – Apr 6, 2012

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: sh-sci: modify sci_break_ctl()

SCIF modules which have SCSPTR can output the break signal. This patch supports it.

This patch tested on sh7757lcr.

---
 drivers/tty/serial/sh-sci.c |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)
drivers/tty/serial/sh-sci.c +26 -4
index bf461cf..4f46532 100644
@@ -1567,10 +1567,32 @@ static void sci_enable_ms(struct uart_port *port)
 
 static void sci_break_ctl(struct uart_port *port, int break_state)
 {
-	/*
-	 * Not supported by hardware. Most parts couple break and rx
-	 * interrupts together, with break detection always enabled.
-	 */
+	struct sci_port *s = to_sci_port(port);
+	unsigned short scscr, scsptr;
+
+	switch (s->cfg->regtype) {
+	case SCIx_SH4_SCIF_REGTYPE:
+		scsptr = sci_in(port, SCSPTR);
+		scscr = sci_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;
+		}
+
+		sci_out(port, SCSPTR, scsptr);
+		sci_out(port, SCSCR, scscr);
+		break;
+	default:
+		/*
+		 * Not supported by hardware. Most parts couple break and rx
+		 * interrupts together, with break detection always enabled.
+		 */
+		break;
+	}
 }
 
 #ifdef CONFIG_SERIAL_SH_SCI_DMA
Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines · Yoshihiro

SCIF modules which have SCSPTR can output the break signal. This patch supports it.

This patch tested on sh7757lcr.

---
 drivers/tty/serial/sh-sci.c |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

I would like to cancel this patch because I forgot to add serial_sci.h to the patch.

Best regards,
Yoshihiro Shimoda