public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix CTS handling in pmac-zilog.c
Date: Sat, 08 May 2004 14:08:44 +1000	[thread overview]
Message-ID: <1083989323.19985.151.camel@gaston> (raw)

(From: Paul Mackerras <paulus@samba.org>)

This patch fixes a bug in the pmac-zilog driver where if you enable
CRTSCTS mode, it won't output data when CTS is asserted.  On
powermacs, the CTS input is inverted.  It also fixes a logic bug in
testing for CTS and DCD changes.

diff -urN linux-2.5/drivers/serial/pmac_zilog.c pmac-2.5/drivers/serial/pmac_zilog.c
--- linux-2.5/drivers/serial/pmac_zilog.c	2004-04-01 06:59:37.000000000 +1000
+++ pmac-2.5/drivers/serial/pmac_zilog.c	2004-05-07 21:06:49.000000000 +1000
@@ -352,13 +352,14 @@
 		/* The Zilog just gives us an interrupt when DCD/CTS/etc. change.
 		 * But it does not tell us which bit has changed, we have to keep
 		 * track of this ourselves.
+		 * The CTS input is inverted for some reason.  -- paulus
 		 */
-		if ((status & DCD) ^ uap->prev_status)
+		if ((status ^ uap->prev_status) & DCD)
 			uart_handle_dcd_change(&uap->port,
 					       (status & DCD));
-		if ((status & CTS) ^ uap->prev_status)
+		if ((status ^ uap->prev_status) & CTS)
 			uart_handle_cts_change(&uap->port,
-					       (status & CTS));
+					       !(status & CTS));
 
 		wake_up_interruptible(&uap->port.info->delta_msr_wait);
 	}
@@ -595,7 +596,7 @@
 		ret |= TIOCM_CAR;
 	if (status & SYNC_HUNT)
 		ret |= TIOCM_DSR;
-	if (status & CTS)
+	if (!(status & CTS))
 		ret |= TIOCM_CTS;
 
 	return ret;
-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>


                 reply	other threads:[~2004-05-08  4:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1083989323.19985.151.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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