From: Krzysztof Halasa <khc@pm.waw.pl>
To: Jean Delvare <khali@linux-fr.org>
Cc: <linux-kernel@vger.kernel.org>, lm-sensors@lm-sensors.org
Subject: [PATCH] I2C: i2c_bit_add_bus should initialize SDA and SCL lines
Date: Tue, 06 Jun 2006 18:58:46 +0200 [thread overview]
Message-ID: <m34pyyz0e1.fsf@defiant.localdomain> (raw)
Hi,
Another thing: I noticed the i2c_bit_add_bus doesn't set SDA and SCL
lines to a known levels. If the hw driver set them to 1 all is fine
and the first START condition is detected correctly. But if they're
set differently (for example, if both are zero), the START will not
work.
I'm not sure if the following patch isn't an overkill, though, and
if the lack of initialization is a real problem which shows in
practice and not only on my analyzer.
In case you think it's needed:
This patch makes i2c_bit_add_bus() initialize SDA and SCL lines
as required by subsequent START condition.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -544,6 +544,13 @@ int i2c_bit_add_bus(struct i2c_adapter *
adap->timeout = 100; /* default values, should */
adap->retries = 3; /* be replaced by defines */
+ setsda(bit_adap, 0); /* may mean START if SCL = 1 */
+ udelay(bit_adap->udelay);
+ setscl(bit_adap, 1); /* may clock a zero bit in */
+ udelay(bit_adap->udelay);
+ setsda(bit_adap, 1); /* STOP */
+ udelay(bit_adap->udelay);
+
i2c_add_adapter(adap);
return 0;
}
next reply other threads:[~2006-06-06 16:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-06 16:58 Krzysztof Halasa [this message]
2006-06-09 11:05 ` [lm-sensors] " Mark M. Hoffman
2006-06-10 22:27 ` Krzysztof Halasa
2006-06-12 12:36 ` Mark M. Hoffman
2006-06-12 17:13 ` Krzysztof Halasa
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=m34pyyz0e1.fsf@defiant.localdomain \
--to=khc@pm.waw.pl \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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
all inboxes | Powered by JetHome®