All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] "sensors" no longer finding pcf8574 and pca9541
Date: Thu, 04 Jan 2007 21:28:07 +0000	[thread overview]
Message-ID: <20070104222807.91a39db3.khali@linux-fr.org> (raw)
In-Reply-To: <459BC8E4.1010106@kr4jb.net>

Hi James,

Hey, long time no see, how are you?

On Thu, 4 Jan 2007 15:38:36 -0500, James Olin Oden wrote:
> Jean I work with Alan, and I can definately say that that is easy
> enough, but don't you think there ought to be some generic way to list
> from a CLI and/or an API the I2C devices (similar to lspci for PCI
> devices)?
> 
> Just my 2 cents...james

Well we have "i2cdetect -l" already, which lists the i2c busses, then
"i2cdetect N" to list the devices on i2c bus N. It doesn't give the
chip names though. The problem is that I2C differs fundamentally from
PCI in that the devices are not enumerated and have no unique ID.
i2cdetect attempts to detect the addresses where a device lives, but
it's only trick, we're not following any specification.

So you could write an "lsi2c" tool, but it would have to list the
devices known by the kernel, i.e. for which a driver has already been
loaded. That would be done by walking /sys, should be easy enough. But
it might be a bit confusing that it lists only "driven" devices, as
opposed to lspci or lsusb which list all present devices, even without
a driver.

Or you could add device identification to the tool, and it would
attempt to find out which devices are there, as sensors-detect is
trying to do for I2C/SMBus hardware monitoring chips. But then this is
a huge task, because many I2C chips are really hard to identify just by
probing them, and it some cases it can even be unsafe to just try.

All in all it really depends on what exactly you are trying to achieve.

-- 
Jean Delvare


  parent reply	other threads:[~2007-01-04 21:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-03 15:16 [lm-sensors] "sensors" no longer finding pcf8574 and pca9541 Alan Porter
2007-01-03 20:05 ` Alan Porter
2007-01-04 20:15 ` Jean Delvare
2007-01-04 20:38 ` James Olin Oden
2007-01-04 21:28 ` Jean Delvare [this message]
2007-01-04 21:51 ` James Olin Oden

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=20070104222807.91a39db3.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.