DISCONTINUED (October 2022): the maintenance for this repository has been discontinued. Please refer to https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal for the up-to-date HAL repository. This repository contains ST Android sensor Hardware Abstraction Layer (HAL) for MEMS Linux IIO drivers
Apache License 2.0
34
stars
21
forks
source link
Missing /sys paths. Is this SensorHAL compatible with just one particular Linux version? #12
I now find that Android can see the LSM6DSRX, but that Android gets no events from it.
After adding extensive logging to util.cpp, I can see many paths in /sys which the SensorHAL is expecting but which the Linux kernel driver does not provide. (The Linux kernel drivers can change what is in /sys with each release. I don't think that /sys is a stable interface.)
Is this SensorHAL targetted at one specific Linux release? If so which one?
Are the missing /sys paths the cause of the lack of sensor events? Or should I be looking elsewhere? (The SensorHAL does not log any errors related to these non-zero return values, which confuses me.)
I want to use the LSM6DSRX with Android 10, on a iMX8, where our vendor-provided kernel is Linux v4.19.42.
In the meantime, I've added support for the LSM6DSRX to this SensorHAL, by following the changes in the commit which added support for the LSM6DSR: https://github.com/STMicroelectronics/STMems_Android_Sensor_HAL_IIO/commit/b881cc23546473653e3feccfe57ce2d3f8f3b34b#diff-fb707bbb2b47122299b6dab9e5b27be184c6df6fa3707ca81c2fbd0770f57673
I've also added kernel support for the LSM6DSRX by backporting the driver from v5.14-rc7 to v4.19.42.
(I also had to revert https://patchwork.kernel.org/project/linux-iio/patch/20190801143908.27608-1-martin.kepplinger@puri.sm/ in order to get in_accel_x_scale to appear. After this, the SensorHAL was happy to start.)
I now find that Android can see the LSM6DSRX, but that Android gets no events from it.
After adding extensive logging to util.cpp, I can see many paths in /sys which the SensorHAL is expecting but which the Linux kernel driver does not provide. (The Linux kernel drivers can change what is in /sys with each release. I don't think that /sys is a stable interface.)
The missing paths in /sys are:
A fuller log: