Skip to content

Sensors

The movement, environmental, and proximity sensors are not on the I²C/SPI buses of the application processor. They are on the ADSP sensor core (SSC).

A Linux IIO driver on the application processor cannot connect to them, unless you move those buses to the application processor.

The sensor identities come from /vendor/etc/sensors/sensor_def_sonim.conf and from the driver UUIDs in the ADSP image (Stock).

Sensor inventory

Sensor Part Bus Interrupt Confidence
Accelerometer + gyroscope (IMU) ST LSM6DS3 or Bosch BMI160 (config file names the two) SSC SPI, CS 0 SSC GPIO 68 Stock
Magnetometer AKM AK09915 SSC SPI, CS 1 SSC GPIO 70 Stock
Proximity + ambient light Sensortek STK3420 SSC I²C bus 3, 0x58, 2.8 V SSC GPIO 71 Stock
Barometer ST LPS22HB SSC I²C bus 3, 0x5C SSC GPIO 73 Stock
Hall switch Generic hall-effect SSC GPIO (hall_int_n) — Stock

It is not known which IMU the unit has (LSM6DS3 or BMI160). The config comment names the two IMUs. The ADSP image contains the strings lsm6ds3, lsm6dsm, and bmi160.

A read of WHO_AM_I during bring-up shows which IMU the unit has.

Stock axis map

Sensor X Y Z
Accelerometer +1 +2 +3
Gyroscope +1 +2 +3
Magnetometer −1 −2 +3

Architecture

flowchart TB
  subgraph SSC["ADSP sensor core (SSC)"]
    IMU["IMU — LSM6DS3/BMI160<br/>SPI CS0 — GPIO 68"]
    MAG["AK09915 magnetometer<br/>SPI CS1 — GPIO 70"]
    LIGHT["STK3420 prox/light<br/>I2C3 @0x58 — GPIO 71"]
    BARO["LPS22HB barometer<br/>I2C3 @0x5C — GPIO 73"]
    HALL["Hall switch — hall_int_n"]
  end
  SSC -->|Hexagon RPC| ADSP["ADSP"]
  ADSP --> AP["Application processor"]

Reaching the sensors from Linux

The parts are behind the ADSP, so a mainline stack needs a userspace bridge, and a plain IIO driver is not sufficient. The usual method on SDM660-class devices uses:

  • hexagonrpcd (ADSP RPC daemon)
  • libssc (sensor core client library)
  • iio-sensor-proxy (gives the sensors to the desktop and the UI)
  • the sensor registry files from the stock firmware

These are distribution packages, not upstream kernel drivers. They operate only when the ADSP operates.