Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/i2c



On Tue, 26 Aug 2008, Michael Lorenz wrote:


Module Name:    src
Committed By:   macallan
Date:           Tue Aug 26 16:29:14 UTC 2008

Modified Files:
        src/sys/dev/i2c: files.i2c

Log Message:
allow wildcard for addr so we can have spdmem* at iic? addr ?

I responded earlier:

I don't think this will work.  The i2c bus is not enumerable, and
the spdmem driver requires the devices to be at fixed i2c addresses
in the range of 0x50 - 0x57.

To be more precise, the existing i2c code includes a bus scan to
enumerate the devices on the bus, however this loop is currently
#ifdef'd out.  It is unclear (to me, at least) if this enumeration
has ever been tested, or if it's probing of bus addresses is both
reliable and non-intrusive;  I have to assume that it was #ifdef'd
out for a reason.  Allowing wildcarding of the i2c addr locator
doesn't really make any sense unless/until the scan routine is
enabled.

Due to the (lack of) size of the i2c address space, a number of i2c
devices share addresses.  There are at least two devices (spdmem
and ad24cxx) sharing an address-match range 0x50 thru 0x57, and of
course only one of these devices could be attached at that address.
Multiple other devices also use address 0x50, while several others
use 0x68.

It's fortunate that few i2c devices are included in any architecture
by default.  Only three of the i2c device drivers make any effort
beyond address matching to verify that the device present at a given
address is actually the one that the driver can handle (spdmem,
adt7463, and lm75). The remaining drivers blindly assume that any device at a given address must be the right device.

Given that we (currently) make no attempt to scan the i2c bus, I
wonder if it makes any sense to permit wildcarding of it locators
at this time?


----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul%whooppee.com@localhost   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette%juniper.net@localhost |
----------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index