STMicroelectronics MEMS sensors
Schema identifier ($id): "http://devicetree.org/schemas/iio/st,st-sensors.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
The STMicroelectronics sensor devices are pretty straight-forward I2C or SPI devices, all sharing the same device tree descriptions no matter what type of sensor it is. Note that whilst this covers many STMicro MEMs sensors, some more complex IMUs need their own bindings.
Maintainers (maintainers): "Denis Ciocca <denis.ciocca@st.com>", "Linus Walleij <linusw@kernel.org>"
Properties and child nodes (properties) #
compatible — required here #
Exactly one of these rules must match (oneOf) #
Rule 1
STMicroelectronics Accelerometers
Allowed values (
enum):"st,h3lis331dl-accel","st,lis2de12","st,lis2dw12","st,lis2hh12","st,lis2dh12-accel","st,lis2ds12","st,lis302dl","st,lis331dl-accel","st,lis331dlh-accel","st,lis3de","st,lis3dh-accel","st,lis3dhh","st,lis3l02dq","st,lis3lv02dl-accel","st,lng2dm-accel","st,lsm303agr-accel","st,lsm303c-accel","st,lsm303dl-accel","st,lsm303dlh-accel","st,lsm303dlhc-accel","st,lsm303dlm-accel","st,lsm330-accel","st,lsm330d-accel","st,lsm330dl-accel","st,lsm330dlc-accel"
Rule 2
Array item rules (
items)Item 1
Exact value (
const):"st,iis328dq"Item 2
Exact value (
const):"st,h3lis331dl-accel"
Rule 3
Silan Accelerometers
Rule 4
STMicroelectronics Gyroscopes
Allowed values (
enum):"st,l3g4200d-gyro","st,l3g4is-gyro","st,l3gd20-gyro","st,l3gd20h-gyro","st,lsm330-gyro","st,lsm330d-gyro","st,lsm330dl-gyro","st,lsm330dlc-gyro","st,lsm9ds0-gyro"
Rule 5
STMicroelectronics Magnetometers
Allowed values (
enum):"st,iis2mdc","st,lis2mdl","st,lis3mdl-magn","st,lsm303agr-magn","st,lsm303c-magn","st,lsm303dlh-magn","st,lsm303dlhc-magn","st,lsm303dlm-magn","st,lsm9ds1-magn"
Rule 6
STMicroelectronics Pressure Sensors
Allowed values (
enum):"st,lps001wp-press","st,lps22df","st,lps22hb-press","st,lps22hh","st,lps25h-press","st,lps331ap-press","st,lps33hw","st,lps35hw"
Rule 7
IMUs
Rule 8
Deprecated bindings
Allowed values (
enum):"st,lis302dl-spi","st,lis3lv02d"Deprecated (
deprecated):true
reg — required here #
Maximum number of items (maxItems): 1
interrupts — not listed as required here #
interrupt line(s) connected to the DRDY line(s) and/or the Inertial interrupt lines INT1 and INT2 if these exist. This means up to three interrupts, and the DRDY must be the first one if it exists on the package. The trigger edge of the interrupts is sometimes software configurable in the hardware so the operating system should parse this flag and set up the trigger edge as indicated in the device tree.
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
vdd-supply — not listed as required here #
true — No constraints added by this property rule.
vddio-supply — not listed as required here #
true — No constraints added by this property rule.
st,drdy-int-pin — not listed as required here #
the pin on the package that will be used to signal "data ready" (valid values 1 or 2). This property is not configurable on all sensors.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
drive-open-drain — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
the interrupt/data ready line will be configured as open drain, which is useful if several sensors share the same interrupt line. (This binding is taken from pinctrl.)
mount-matrix — not listed as required here #
an optional 3x3 mounting rotation matrix.
All of these rules must match (allOf) #
Rule 1 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereWhen the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required here
false— Not permitted by this property rule.
st,drdy-int-pin— not listed as required here
false— Not permitted by this property rule.
drive-open-drain— not listed as required here
false— Not permitted by this property rule.
Rule 2 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereAllowed values (
enum):"st,lis2mdl","st,lis3l02dq","st,lis3lv02dl-accel","st,lps22df","st,lps22hb-press","st,lps22hh","st,lps25h-press","st,lps33hw","st,lps35hw","st,lsm303agr-magn","st,lsm303dlh-magn","st,lsm303dlhc-magn","st,lsm303dlm-magn"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMaximum number of items (
maxItems):1
st,drdy-int-pin— not listed as required here
false— Not permitted by this property rule.
Required in this object (required): "compatible", "reg"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
accelerometer@1c {
compatible = "st,lis331dl-accel";
reg = <0x1c>;
st,drdy-int-pin = <1>;
vdd-supply = <&ldo1>;
vddio-supply = <&ldo2>;
interrupt-parent = <&gpio>;
interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>;
};
};
spi {
#address-cells = <1>;
#size-cells = <0>;
num-cs = <1>;
l3g4200d: gyroscope@0 {
compatible = "st,l3g4200d-gyro";
st,drdy-int-pin = <2>;
reg = <0>;
vdd-supply = <&vcc_io>;
vddio-supply = <&vcc_io>;
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 134: These have no interrupts
Line 146: These have only DRDY