* [PATCH] serial: sh-sci: modify sci_break_ctl()
@ 2012-04-05 9:34 Shimoda, Yoshihiro
2012-04-06 0:22 ` Shimoda, Yoshihiro
0 siblings, 1 reply; 2+ messages in thread
From: Shimoda, Yoshihiro @ 2012-04-05 9:34 UTC (permalink / raw)
To: linux-sh
SCIF modules which have SCSPTR can output the break signal.
This patch supports it.
This patch tested on sh7757lcr.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
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 bf461cf..4f46532 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: sh-sci: modify sci_break_ctl()
2012-04-05 9:34 [PATCH] serial: sh-sci: modify sci_break_ctl() Shimoda, Yoshihiro
@ 2012-04-06 0:22 ` Shimoda, Yoshihiro
0 siblings, 0 replies; 2+ messages in thread
From: Shimoda, Yoshihiro @ 2012-04-06 0:22 UTC (permalink / raw)
To: linux-sh
2012/04/05 18:34, Shimoda, Yoshihiro wrote:
> SCIF modules which have SCSPTR can output the break signal.
> This patch supports it.
>
> This patch tested on sh7757lcr.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-06 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 9:34 [PATCH] serial: sh-sci: modify sci_break_ctl() Shimoda, Yoshihiro
2012-04-06 0:22 ` Shimoda, Yoshihiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).