You are not logged in.

#1 2012-01-02 12:25:42

gjasso
Member
From: Bonn, Germany
Registered: 2011-09-08
Posts: 29

Problem setting up LSM303DLH Accelerometer on a Dell Inspiron 1090

Hi, I'm trying to set up the accelerometer for a Dell Inspiron Duo. According to this website: http://lukeross.name/dell/, the accelerometer is an LSM303DLH made my STMicroelectronics (there are even some instructions to make it work). It seems that there are two drivers available: 

- One at lklm.org https://lkml.org/lkml/2010/12/1/3, that according to the previous website should be patched with this http://lukeross.name/dell/lukeross-fixe … dlh_a.diff
- and another at a cached version of the manufacturers website http://webcache.googleusercontent.com/s … en&ct=clnk (this is supposed to be newer)

I've succeded to build the module using both drivers with this Makefile:

obj-m += lsm303dlh_a.o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

where one changes lsm303dlh_a.o to lsm303dlh_acc_sysfs.o to keep the name conventions of each driver.

Then when I load the first one (lsm303dlh_a) i get the following output from dmesg:

[   91.231412] i2c i2c-2: new_device: Instantiated device lsm303dlh_a at 0x19
[   97.868807] i2c i2c-2: Failed to register i2c client lsm303dlh_a at 0x19 (-16)

And this is dmesg output for the second (lsm303dlh_acc_sysfs):

 
[  124.908804] lsm303dlh_acc_sysfs accelerometer driver: init
[  124.908876] i2c-core: driver [lsm303dlh_acc_sysfs] using legacy suspend method
[  124.908885] i2c-core: driver [lsm303dlh_acc_sysfs] using legacy resume method

So far (with the second driver), everything looks OK. But when I try to instantiate the device with this command

# echo lsm303dlh_acc_sysfs 25 > /sys/bus/i2c/devices/i2c-2/new_device

I get this output from dmesg

...
[  833.274769] lsm303dlh_acc_sysfs: probe start.
[  833.274781] lsm303dlh_acc_sysfs 2-0019: platform data is NULL. exiting.
[  833.274790] lsm303dlh_acc_sysfs: Driver Init failed
[  833.274813] i2c i2c-2: new_device: Instantiated device lsm303dlh_acc_sysfs at 0x19

Then, I cannot do enable the device with

echo 1 > /sys/bus/i2c/devices/i2c-2/2-0019/mode

as there is no file "mode" in this directory. An thus no file data to read the accelerometer's output with

cat sys/bus/i2c/devices/i2c-2/2-0019/data

Any ideas? Thanks.

Offline

Board footer

Powered by FluxBB