From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH 2.6] I2C: Rewrite i2c_probe
Date: Tue, 09 Aug 2005 23:31:46 +0000 [thread overview]
Message-ID: <20050809233135.73870eeb.khali@linux-fr.org> (raw)
In-Reply-To: <20050809201755.15962b81.khali@linux-fr.org>
Hi David,
> From places like below (a snippet from your patch). You use 0 instead
> of preprocessor tokens. It is also this way in various other places
> in the i2c core code.
>
> // Snippet of i2c_probe_addresses
> + /* Make sure there is something at this address, unless forced */
> + if (kind < 0
> + && i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0)
> + return 0;
> // Snippet end
As far as I can see only one "0" (the middle one) has a replacement
preprocessor token (I2C_SMBUS_WRITE), right? I don't think we have
preprocessor token for "no flags" nor "command doesn't matter", and I
don't think we should introduce them, as 0 is just as natural in this
case.
I think that I2C_SMBUS_WRITE is not used here on purpose, because there
is not such thing as a quick read command in the SMBus protocol. The
quick command is always a write, sending a single bit of data to the
target chip. This is a *very* weird choice from Intel if you want my
opinion, but that's the way SMBus was designed. I'd expect that you will
find 0 or 1 instead of I2C_SMBUS_WRITE or I2C_SMBUS_READ, respectively,
only when I2C_SMBUS_QUICK is used. If this is the case, that's not
something we want to change, as it makes some sense with regards to the
SMBus protocol.
Now, if there are non-quick commands not using I2C_SMBUS_WRITE/READ when
they should, please point them out to us.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2005-08-09 23:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-09 20:18 [lm-sensors] [PATCH 2.6] I2C: Rewrite i2c_probe Jean Delvare
2005-08-09 20:36 ` David van Hoose
2005-08-09 21:29 ` Jean Delvare
2005-08-09 22:25 ` Jean Delvare
2005-08-09 22:59 ` David van Hoose
2005-08-09 23:31 ` Jean Delvare [this message]
2005-08-10 0:03 ` David van Hoose
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=20050809233135.73870eeb.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.