Open lorenzodallacasa opened 5 months ago
Hi,
Yes we know the problem in fact we added a message here in the Kconfig.
Unfortunately the Linux IIO framework still not support all event types that our MEMS sensors are capable to generate so in order to have this event working an IIO patch is requested for extending the iio_chan_type_name_spec array to our custom types names.
Hi, I'm using LIS2DUX12 accelerometer in a Linux environment with kernel version 5.10 and I'm testing event monitoring with
iio_event_monitor
tool. I managed to verify the functionality of a few events (TAP, DTAP, FF and MLC) but I couldn't test the behavior of the SIGN_MOTION event because I'm having a hard time trying to enable that event from C code. This is because the file responsible to track the event enable/disable status has a particularly bad name: in my case it isin_???'L0_thresh_rising_en
. This made me realize that a few other event files were also incorrect because they are named likein_(null)0_thresh_rising_en
.So I decided to take a look inside the kernel and the driver to better understand what is going on and I found out that the driver is using custom enum type values to initialize the structure
struct iio_chan_spec
of these sensor.For my understanding, this is a problem because when the kernel generates the event names for these sensors/devices, it tries to get a char pointer from the
iio_chan_type_name_spec[]
variable that has only IIO_MASSCONCENTRATION (=34) items which is less than the first STM custom type STM_IIO_SIGN_MOTION (=57). So our index/type is out of bounds.I think this is the point where the empty string messes things up:
Am I understanding this behavior correctly? How can we fix this?
Thanks