accelerometer not regonized when modules are loaded while in "lockdown mode" (all hks active)
Librem5v4 running Byzantium (Linux pureos 5.18.0-1-librem5)
When the modules for LSM9DS1 (st_lsm6dsx_i2c st_lsm6dsx_spi st_lsm6dsx) are loaded while all HKS are active (all sensors, modem, wireless switched OFF) the accelerometer is not recognized when later on one hks is disabled (and thereby "lockdown mode" is disabled) and LSM9DS1 comes back online.
To reproduce:
- set all hardware kill switches of the Librem5 to active thereby disabling modem, wireless, camera+mic and LSM9DS1
- unload modules for LSM9DS1:
rmmod st_lsm6dsx_i2c st_lsm6dsx_spi st_lsm6dsx
- load modules for LSM9DS1:
modprobe st_lsm6dsx_spi ; modprobe st_lsm6dsx_i2c
- message[15547.464123] st_lsm6dsx_i2c 1-006a: failed to read whoami register
can be found in dmesg - disable one of the hks thereby enabling LSM9DS1
If you follow the last step running monitor-sensor
you'll (probably
root@pureos:~# monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== No accelerometer
=== Has ambient light sensor (value: 2.880000, unit: lux)
=== Has proximity sensor (near: 0)
### now disabling camera/mic hks ###
--- Light sensor disappeared
--- Proximity sensor disappeared
--- iio-sensor-proxy vanished, waiting for it to appear
+++ iio-sensor-proxy appeared
=== No accelerometer
=== Has ambient light sensor (value: 0.000000, unit: lux)
=== Has proximity sensor (near: 0)
--- Accelerometer disappeared
Accelerometer orientation changed: undefined
+++ Light sensor appeared
Light changed: 0.000000 (lux)
+++ Proximity sensor appeared
Proximity value changed: 0
Light changed: 1.440000 (lux)
Light changed: 3.120000 (lux)
The icon in the top menu will stay locked for manually changing the screen orientation and cannot be changed by holding it long. If you turn the phone there'll be no screen turning and no sensor reading from the accelerometer.
To recover to the expected state you can follow the following steps:
- If not already done disable one HKS thereby enabling LSM9DS1
- unload modules for LSM9DS1:
rmmod st_lsm6dsx_i2c st_lsm6dsx_spi st_lsm6dsx
- load modules for LSM9DS1:
modprobe st_lsm6dsx_spi ; modprobe st_lsm6dsx_i2c
- the error message mentioned earlier when reproducing the issue will not appear in dmesg
If you check now for the icon in the pull down menu you'll see that it has changed to automatically adjust the screen orientation (which will work also when the phone is turned). Also you can now follow readings of the accelerometer using monitor-sensor
again.
The issue has been described in the forum.