[PATCH linux] Fix double accelerometer initialisation

James Cameron quozl at laptop.org
Wed Nov 23 01:00:43 EST 2011


On Tue, Nov 22, 2011 at 01:13:55PM +0100, Sascha Silbe wrote:
> The lis3lv02d driver doesn't support multiple instances of itself, so
> we need to make sure we instantiate only the one that's actually
> present. This also avoids logging an error message about not being
> able to initialise the 8-bit sensor on C1 and above.
> 
> Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
> ---
> Tested on B1 only since I don't have a C1. Are there even actual C1s
> or just patched-up Bx? I wonder because the wiki page for C1 doesn't
> exist yet.

Yes, many C1 exist.  Sorry about the Wiki page.

Tested your patch with 5611fd36a7b30edac640e1bd8ab2948ca91d09d5 by
Andres, since this is needed for board detect to work, and also with
q4c05jc [1] which changes /proc/device-tree/openprom/architecture to
OLPC.

On an XO-1.75 C1 with new accelerometer, dmesg contains:

lis3lv02d: 16 bits sensor found
input: ST LIS3LV02DL Accelerometer as /devices/platform/lis3lv02d/input/input0

On an XO-1.75 B1 with old accelerometer, dmesg contains:

lis3lv02d: 8 bits sensor found
input: ST LIS3LV02DL Accelerometer as /devices/platform/lis3lv02d/input/input0

On an XO-1.75 B1 with new accelerometer, dmesg contains:

lis3lv02d: unknown sensor type 0x87
lis3lv02d_i2c: probe of 5-001d failed with error -22

On an XO-1.75 B4 with new accelerometer, dmesg contains:

lis3lv02d: unknown sensor type 0x87
lis3lv02d_i2c: probe of 5-001d failed with error -22

So effectively your patch breaks XO-1.75 B1 and B4 with new
accelerometer chip.  ;-}

Saadia is looking into this, she said.

--

[1]  http://dev.laptop.org/~quozl/q4c05jc.rom

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



More information about the Devel mailing list