[PATCH linux] Fix double accelerometer initialisation

James Cameron quozl at laptop.org
Mon Dec 19 18:34:29 EST 2011


On Mon, Dec 19, 2011 at 08:45:33PM +0100, Sascha Silbe wrote:
> Thanks for testing! My approach was based on the assumption that only
> the combinations B1/old and C1/new exist, so the patch is expected to
> fail with the two other combinations.

For the moment, it would be nice for it to work on all combinations of
B1 and C1.  The B1s are still in use by developers.

> Is there any way to tell what kind of accelerometer device the board
> has hooked up, other than probing the device?  [...]

Not without probing.

If the board ID is C, then it will have the new chip.  If the board ID
is B then it may have the old or the new chip, but most likely the old
chip.  If the board ID is B and the chip is old, then the pullups on SCL
and SDA are likely to be missing.

OpenFirmware does this [1] by probing address 0x3a at 25 kHz bus rate,
and if that fails to elicit a response it configures the bus speed for
400 kHz and the address to 0x32.

1.
http://tracker.coreboot.org/trac/openfirmware/browser/cpu/arm/olpc/accelerometer.fth#L143

-- 
James Cameron
http://quozl.linux.org.au/



More information about the Devel mailing list