All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: i2c/kernel i2c-algo-bit.c
Date: Thu, 19 May 2005 06:24:23 +0000	[thread overview]
Message-ID: <20031101170944.386fd941.khali@linux-fr.org> (raw)

> Modified Files:
> 	i2c-algo-bit.c 
> Log Message:
> (Khali) Fix sclhi() for adapters that do not have getscl().
>         Enable bit_test for adapters that do not have getscl().
>         Mostly rewrite test_bus(), cleaner and probably faster.

I'd like reviewers and testers on this, since I plan to submit a similar
for Linux 2.6. There are two distinct changes:

1* Fixed sclhi() for adapters that do not have getscl(). It looks like
there was a udelay call missing in this case.

2* Rewrote test_bus() almost entirely, to allow adapters without
getscl() to be tested. It's still interesting to test SDA in this case.

I have a pair of questions with regard to i2c-algo-bit:

1* I don't understand how the whole thing works. Each of sdalo(),
sdahi(), scllo() and sclhi() are waiting adap->udelay before returning.
How in this condition can the driver change both SCL and SDA values in a
row?

2* It looks like i2c-algo-bit assumes that both SDA and SCL are high by
the time it is called. Why that? Looks like not all drivers will do so.
Especially, I tried my changes using i2c-matroxfb and it looks like this
driver doesn't set SDA not SCL before registering with i2c-algo-bit,
causing bit_test to sometimes fail with the message "seems to be busy".
I wonder if it wouldn't be easier (and safer) not to assume anything
about SDA and SCL in i2c-algo-bit.c:test_bus() (that is, remove that
"may be busy" test).

-- 
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

             reply	other threads:[~2005-05-19  6:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19  6:24 Jean Delvare [this message]
2005-05-19  6:24 ` i2c/kernel i2c-algo-bit.c Mark M. Hoffman
2005-05-19  6:24 ` Jean Delvare
2005-05-19  6:24 ` Jean Delvare
2005-05-19  6:24 ` Mark Studebaker
2005-05-19  6:24 ` Kyösti Mälkki
2005-05-19  6:24 ` Jean Delvare
2005-05-19  6:24 ` Mark Studebaker
2005-05-19  6:24 ` Mark Studebaker
2005-05-19  6:24 ` Kyösti Mälkki
2005-05-19  6:24 ` Kyösti Mälkki

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=20031101170944.386fd941.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.