LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] I2C update for 2.6.6
Date: Fri, 14 May 2004 16:29:16 -0700	[thread overview]
Message-ID: <10845773561456@kroah.com> (raw)
In-Reply-To: <10845773562431@kroah.com>

ChangeSet 1.1587.15.4, 2004/05/01 22:34:26-07:00, kevin@koconnor.net

[PATCH] I2C: support I2C_M_NO_RD_ACK in i2c-algo-bit

I have an I2C device (Samsung ks0127 video grabber) with a peculiar i2c
implementation.  When reading bytes, it only senses for the stop condition
in the place where the acknowledge bit should be.  So, to properly support
this device acks need to be turned off during reads.

There is an I2C_M_NO_RD_ACK bit already defined in i2c.h which appears to
be what I want.  Unfortunately it doesn't seem to be used anywhere in the
current tree.  At the end of this message is a patch to teach i2c_algo_bit
to honor the bit.


 drivers/i2c/algos/i2c-algo-bit.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
--- a/drivers/i2c/algos/i2c-algo-bit.c	Fri May 14 16:21:12 2004
+++ b/drivers/i2c/algos/i2c-algo-bit.c	Fri May 14 16:21:12 2004
@@ -381,7 +381,13 @@
 			break;
 		}
 
-		if ( count > 1 ) {		/* send ack */
+		temp++;
+		count--;
+
+		if (msg->flags & I2C_M_NO_RD_ACK)
+			continue;
+
+		if ( count > 0 ) {		/* send ack */
 			sdalo(adap);
 			DEBPROTO(printk(" Am "));
 		} else {
@@ -395,8 +401,6 @@
 		};
 		scllo(adap);
 		sdahi(adap);
-		temp++;
-		count--;
 	}
 	return rdcount;
 }


  reply	other threads:[~2004-05-14 23:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-14 23:27 [BK PATCH] " Greg KH
2004-05-14 23:29 ` [PATCH] " Greg KH
2004-05-14 23:29   ` Greg KH
2004-05-14 23:29     ` Greg KH
2004-05-14 23:29       ` Greg KH [this message]
2004-05-14 23:29         ` Greg KH
2004-05-14 23:29           ` Greg KH
2004-05-14 23:29             ` Greg KH
2004-05-14 23:29               ` Greg KH
2004-05-14 23:29                 ` Greg KH
2004-05-14 23:29                   ` Greg KH
2004-05-14 23:29                     ` Greg KH
2004-05-14 23:29                       ` Greg KH
2004-05-14 23:29                         ` Greg KH
2004-05-14 23:29                           ` Greg KH
2004-05-14 23:29                             ` Greg KH
2004-05-14 23:29                               ` Greg KH
2004-05-14 23:29                                 ` Greg KH
2004-05-14 23:29                                   ` Greg KH

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=10845773561456@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    --subject='Re: [PATCH] I2C update for 2.6.6' \
    /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

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).