bugtracker icon indicating copy to clipboard operation
bugtracker copied to clipboard

N900: Support accelerometer

Open MerlijnWajer opened this issue 7 years ago • 8 comments

Device is already there, but what daemon should check it and send events?

/dev/input/by-path/platform-lis3lv02d-event

MerlijnWajer avatar May 21 '18 13:05 MerlijnWajer

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

android-808 avatar May 21 '18 13:05 android-808

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. ;)

MerlijnWajer avatar May 21 '18 13:05 MerlijnWajer

Rotation is handled now with iio-sensors. There is still some quirk on N900 IIRC, so @MerlijnWajer please close this when you see fit.

parazyd avatar Oct 30 '20 16:10 parazyd

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.

IMbackK avatar Nov 03 '20 12:11 IMbackK

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 avatar Jan 31 '21 17:01 sicelo

@sicelo whats the status on this?

IMbackK avatar Apr 14 '21 19:04 IMbackK

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

sicelo avatar Apr 23 '21 22:04 sicelo

https://github.com/maemo-leste/droid4-linux/pull/3

sicelo avatar Feb 27 '22 10:02 sicelo

should be fixed

IMbackK avatar Nov 25 '22 10:11 IMbackK