bugtracker
bugtracker copied to clipboard
N900: Support accelerometer
Device is already there, but what daemon should check it and send events?
/dev/input/by-path/platform-lis3lv02d-event
I thought it was handled by MCE via dbus signals.
https://github.com/maemo-leste/mce/blob/master/modules/accelerometer.c#L104 https://wiki.maemo.org/Using_Fremantle_widgets#Portrait_Mode
Yes, I somehow missed the mce module for it. I found it just a bit ago, and it seems to be using a non standard interface. We have to change it (or clone it) to support the event interface.
Also, just for fun I sent a rotation signal to mce (since it sends itself dbus signals) and this for sure confused the powervr driver and/or hildon-desktop. So it's good it doesn't work yet, in a way. ;)
Rotation is handled now with iio-sensors. There is still some quirk on N900 IIRC, so @MerlijnWajer please close this when you see fit.
iio-sensor-proxy blocks on n900 due to https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/313
Until a proper upstream solution is found it can be made to work by applying the workaround in https://github.com/maemo-leste/iio-sensor-proxy/pull/1/files. This has no negative effects what so ever for our use cases of iio-sensor-proxy.
I would not recommend actually applying this workaround at this time, since rotation fails due to pvr problems on n900, so having working iio-sensor-proxy dosent give us any benefit atm.
over all i would say this issue can be closed. infrastructure is in place to use the accel for rotation: iio-sensor-proxy/mce and also to use the accel in games: iio-uinput. And it works, at least in theory, on every device.
It seems there is a modern driver for this accelerometer, found at drivers/iio/accel/st_accel_i2c.c
We probably just need to change dts to use this one instead
@sicelo whats the status on this?
The modern driver has a couple of mistakes (maps the chip ID registers wrongly - our LIS302DL doesn't appear, but its ID is mapped as belonging to LIS331DL). I intend to engage upstream and get this fixed. Since N900 doesn't really use the iio accelerometer for rotation yet, maybe it is not an urgent fix for Leste.
Otherwise, patching the N900 dts as follows makes it work with upstream iio-proxy right away:
@@ -731,8 +761,8 @@ &i2c3 {
clock-frequency = <400000>;
- lis302dl: lis3lv02d@1d {
- compatible = "st,lis3lv02d";
+ lis302dl: lis302dl@1d {
+ compatible = "st,lis331dl-accel", "st,lis3lv02d";
reg = <0x1d>;
Vdd-supply = <&vaux1>;
Yes, this is the WRONG way to handle the issue. The driver needs updating
https://github.com/maemo-leste/droid4-linux/pull/3
should be fixed