Letux Kernel

Issue 484: Accessing iio sensors

Reported by Nikolaus Schaller, Sep 24, 2013

we have a problem...

http://sourceforge.net/projects/iioutils/files/iioutils/

is not available in Debian. So we can't easily read values from the 
iio based drivers (ITG3200 and HMC5883).

They also lack /sys nodes for reading raw data.

The result is that we neither can use these sensors from shell 
scripts or similar tools nor can we add them to the hw-test.

Proposed solution:

add raw data nodes for these sensors.

Comment 1 by Nikolaus Schaller, Sep 25, 2013

more testing reveals that the hmc has a /sys node for raw data but 
it does not show values but returns 'invalid argument' errors:

root@gta04:~# cat /sys/bus/iio/devices/iio:device1/*   
252:1
1300
0.000009174
cat: /sys/bus/iio/devices/iio:device1/in_magn_x_raw: Invalid 
argument
cat: /sys/bus/iio/devices/iio:device1/in_magn_y_raw: Invalid 
argument
cat: /sys/bus/iio/devices/iio:device1/in_magn_z_raw: Invalid 
argument
0
hmc5883l
0
cat: /sys/bus/iio/devices/iio:device1/power: Is a directory
cat: /sys/bus/iio/devices/iio:device1/sampling_frequency: Remote I/O 
error
0.75 1.5 3 7.5 15 30 75
cat: /sys/bus/iio/devices/iio:device1/subsystem: Is a directory
MAJOR=252
MINOR=1
DEVNAME=iio:device1
DEVTYPE=iio_device
root@gta04:~#

Comment 2 by Nikolaus Schaller, Sep 25, 2013

And, there is a dmesg:

[    2.890014] Error: Driver 'itg3200' is already registered, 
aborting...

But it exists only once in the board file?
Or is it automatically matched with the gta04_vaux2_supply[]?

Comment 3 by Nikolaus Schaller, Oct 1, 2013

I think I have found at least one issue with the ITG3200. We have 
two drivers!

One from Neil (3.7-kernel) in staging/iio/itg3200.c and one 
introduced in 3.9:

http://lxr.free-electrons.com/source/include/linux/iio/gyro/itg3200.h
?v=3.9

These may conflict and do other harmful things...

So Neil's variant is now removed.

We should check if the official driver has all functions we did have 
in Neil's variant.

Comment 4 by Nikolaus Schaller, Oct 1, 2013

Owner: marekb

Comment 5 by Nikolaus Schaller, Oct 1, 2013

With the new/correct driver, the ITG3200 works well. It even has a 
in_temp_raw file in the /sysfs. So hw-test is now possible for the 
itg chip.

Only the hmc is still making problems as described above.
Status: Accepted

Comment 6 by Nikolaus Schaller, Oct 7, 2013

after upgrading to 3.12-rc4 the hmc5883 appears to work again!
Needs a little testing if it is working good now.

Comment 7 by Nikolaus Schaller, Oct 13, 2013

Status: Fixed

Created: 10 years 6 months ago by Nikolaus Schaller

Updated: 10 years 6 months ago

Status: Fixed

Owner: Marek Belisko

Labels:
Type:Defect
Priority:Medium
Milestone:3.12