Enumerable I2C busses
Rafał Jaworowski
raj at semihalf.com
Sun Nov 23 12:30:06 PST 2008
On 2008-11-23, at 19:18, Dag-Erling Smørgrav wrote:
> Nathan Whitehorn <nwhitehorn at freebsd.org> writes:
>> The current I2C bus mechanism does not support the bus adding its own
>> children [...]
>
> That's because the I2C protocol does not support device enumeration or
> identification. You have to know in advance what kind of devices are
> attached and at what address. Even worse, it is not uncommon for
> similar but not entirely compatible devices to use the same I2C
> address
> (for instance, every I2C-capable RTC chip uses the same address, even
> though they have different feature sets)
Well, hard-coded addresses and conflicting assignments between vendors
do not technically prevent from scanning the bus; actually, our
current iicbus code can do bus scaning when compiled with a diag
define. The problem however is some slave devices are not well-
behaved, and they don't like to be read/written to other than in very
specific scenario: if polled during bus scan strange effects occur
e.g. they disappear from the bus, or do not react to consecutive
requests etc.
Nathan, not sure if this helps you, but I have a nice i2c diagnostic
tool, which among other features lets the user scan the I2C bus for
present slave devices. This is done from userland, so doing similar
thing in-kernel wouldn't be a problem. I was planning to post this for
review this coming week, so you can have a look.
Rafal
More information about the freebsd-arch
mailing list