Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2008 21:18:54 +0100
From:      =?ISO-8859-2?Q?Rafa=B3_Jaworowski?= <raj@semihalf.com>
To:        =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        Nathan Whitehorn <nwhitehorn@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: Enumerable I2C busses
Message-ID:  <C1917DFE-AA7F-4042-8A8F-088599FCDBB4@semihalf.com>
In-Reply-To: <86myfq9uha.fsf@ds4.des.no>
References:  <4929877B.6060307@freebsd.org> <86myfq9uha.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2008-11-23, at 19:18, Dag-Erling Sm=C3=B8rgrav wrote:

> Nathan Whitehorn <nwhitehorn@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 =20
> 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 =20=

do not technically prevent from scanning the bus; actually, our =20
current iicbus code can do bus scaning when compiled with a diag =20
define. The problem however is some slave devices are not well-=20
behaved, and they don't like to be read/written to other than in very =20=

specific scenario: if polled during bus scan strange effects occur =20
e.g. they disappear from the bus, or do not react to consecutive =20
requests etc.

Nathan, not sure if this helps you, but I have a nice i2c diagnostic =20
tool, which among other features lets the user scan the I2C bus for =20
present slave devices. This is done from userland, so doing similar =20
thing in-kernel wouldn't be a problem. I was planning to post this for =20=

review this coming week, so you can have a look.

Rafal=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C1917DFE-AA7F-4042-8A8F-088599FCDBB4>