linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@tbox.biz>
To: Vitaly Bordug <vbordug@ru.mvista.com>
Cc: linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: [PATCH] CPM UART: Fix break generation
Date: Tue, 31 Oct 2006 08:58:28 +0100	[thread overview]
Message-ID: <200610310858.28622.laurent.pinchart@tbox.biz> (raw)
In-Reply-To: <20061030184002.35611755@vitb.ru.mvista.com>

When generating a break condition on a serial port, the CPM must be told
beforehand how long the break should be. Unfortunately, this information is
not available through the current serial break handling API. This patch works
around the problem by requesting a 32767 characters break followed by a 0
characters break after the requested duration. The CPM will stop the first
break when the second one is requested. This might not work with future CPM
revisions.

Signed-off-by: Laurent Pinchart <laurent@pclaurent.technotrade>
---
 drivers/serial/cpm_uart/cpm_uart_core.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c 
b/drivers/serial/cpm_uart/cpm_uart_core.c
index c29d87d..aa0a284 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -239,14 +239,23 @@ static void cpm_uart_break_ctl(struct ua
 {
 	struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
 	int line = pinfo - cpm_uart_ports;
+	volatile u16 *brkcr = IS_SMC(pinfo) ? &pinfo->smcup->smc_brkcr
+				: &pinfo->sccup->scc_brkcr;
 
 	pr_debug("CPM uart[%d]:break ctrl, break_state: %d\n", port->line,
 		break_state);
 
 	if (break_state)
+	{
+		*brkcr = 32767;
 		cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
+	}
 	else
+	{
+		*brkcr = 0;
+		cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
 		cpm_line_cr_cmd(line, CPM_CR_RESTART_TX);
+	}
 }
 
 /*
-- 
1.4.GIT

  parent reply	other threads:[~2006-10-31  7:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26  8:02 CPM2 SCC/SMC break handling broken Laurent Pinchart
2006-10-26 21:18 ` Ricardo Scop
2006-10-27  9:01   ` Laurent Pinchart
2006-10-27 18:20     ` Ricardo Scop
2006-10-30 15:23       ` Laurent Pinchart
2006-10-30 15:40         ` Vitaly Bordug
2006-10-30 21:52           ` Ricardo Scop
2006-10-31  7:58           ` Laurent Pinchart [this message]
2006-10-31  9:04             ` [PATCH] CPM UART: Fix break generation Pantelis Antoniou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200610310858.28622.laurent.pinchart@tbox.biz \
    --to=laurent.pinchart@tbox.biz \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=vbordug@ru.mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).