0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/st,st-sensors.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: STMicroelectronics MEMS sensors
0008
0009 description: The STMicroelectronics sensor devices are pretty straight-forward
0010 I2C or SPI devices, all sharing the same device tree descriptions no matter
0011 what type of sensor it is.
0012 Note that whilst this covers many STMicro MEMs sensors, some more complex
0013 IMUs need their own bindings.
0014 The STMicroelectronics sensor devices are pretty straight-forward I2C or
0015 SPI devices, all sharing the same device tree descriptions no matter what
0016 type of sensor it is.
0017
0018 maintainers:
0019 - Denis Ciocca <denis.ciocca@st.com>
0020 - Linus Walleij <linus.walleij@linaro.org>
0021
0022 properties:
0023 compatible:
0024 oneOf:
0025 - description: STMicroelectronics Accelerometers
0026 enum:
0027 - st,h3lis331dl-accel
0028 - st,lis2de12
0029 - st,lis2dw12
0030 - st,lis2hh12
0031 - st,lis2dh12-accel
0032 - st,lis302dl
0033 - st,lis331dl-accel
0034 - st,lis331dlh-accel
0035 - st,lis3de
0036 - st,lis3dh-accel
0037 - st,lis3dhh
0038 - st,lis3l02dq
0039 - st,lis3lv02dl-accel
0040 - st,lng2dm-accel
0041 - st,lsm303agr-accel
0042 - st,lsm303dl-accel
0043 - st,lsm303dlh-accel
0044 - st,lsm303dlhc-accel
0045 - st,lsm303dlm-accel
0046 - st,lsm330-accel
0047 - st,lsm330d-accel
0048 - st,lsm330dl-accel
0049 - st,lsm330dlc-accel
0050 - description: Silan Accelerometers
0051 enum:
0052 - silan,sc7a20
0053 - description: STMicroelectronics Gyroscopes
0054 enum:
0055 - st,l3g4200d-gyro
0056 - st,l3g4is-gyro
0057 - st,l3gd20-gyro
0058 - st,l3gd20h-gyro
0059 - st,lsm330-gyro
0060 - st,lsm330d-gyro
0061 - st,lsm330dl-gyro
0062 - st,lsm330dlc-gyro
0063 - st,lsm9ds0-gyro
0064 - description: STMicroelectronics Magnetometers
0065 enum:
0066 - st,lis2mdl
0067 - st,lis3mdl-magn
0068 - st,lsm303agr-magn
0069 - st,lsm303dlh-magn
0070 - st,lsm303dlhc-magn
0071 - st,lsm303dlm-magn
0072 - st,lsm9ds1-magn
0073 - description: STMicroelectronics Pressure Sensors
0074 enum:
0075 - st,lps001wp-press
0076 - st,lps22hb-press
0077 - st,lps22hh
0078 - st,lps25h-press
0079 - st,lps331ap-press
0080 - st,lps33hw
0081 - st,lps35hw
0082 - description: IMUs
0083 enum:
0084 - st,lsm9ds0-imu
0085 - description: Deprecated bindings
0086 enum:
0087 - st,lis302dl-spi
0088 - st,lis3lv02d
0089 deprecated: true
0090
0091 reg:
0092 maxItems: 1
0093
0094 interrupts:
0095 description: interrupt line(s) connected to the DRDY line(s) and/or the
0096 Intertial interrupt lines INT1 and INT2 if these exist. This means up to
0097 three interrupts, and the DRDY must be the first one if it exists on
0098 the package. The trigger edge of the interrupts is sometimes software
0099 configurable in the hardware so the operating system should parse this
0100 flag and set up the trigger edge as indicated in the device tree.
0101 minItems: 1
0102 maxItems: 2
0103
0104 vdd-supply: true
0105 vddio-supply: true
0106
0107 st,drdy-int-pin:
0108 description: the pin on the package that will be used to signal
0109 "data ready" (valid values 1 or 2). This property is not configurable
0110 on all sensors.
0111 $ref: /schemas/types.yaml#/definitions/uint32
0112 enum: [1, 2]
0113
0114 drive-open-drain:
0115 $ref: /schemas/types.yaml#/definitions/flag
0116 description: the interrupt/data ready line will be configured
0117 as open drain, which is useful if several sensors share the same
0118 interrupt line. (This binding is taken from pinctrl.)
0119
0120 mount-matrix:
0121 description: an optional 3x3 mounting rotation matrix.
0122
0123 allOf:
0124 - if:
0125 properties:
0126 compatible:
0127 enum:
0128 # These have no interrupts
0129 - st,lps001wp
0130 then:
0131 properties:
0132 interrupts: false
0133 st,drdy-int-pin: false
0134 drive-open-drain: false
0135
0136 - if:
0137 properties:
0138 compatible:
0139 enum:
0140 # These have only DRDY
0141 - st,lis2mdl
0142 - st,lis3l02dq
0143 - st,lis3lv02dl-accel
0144 - st,lps22hb-press
0145 - st,lps22hh
0146 - st,lps25h-press
0147 - st,lps33hw
0148 - st,lps35hw
0149 - st,lsm303agr-magn
0150 - st,lsm303dlh-magn
0151 - st,lsm303dlhc-magn
0152 - st,lsm303dlm-magn
0153 then:
0154 properties:
0155 interrupts:
0156 maxItems: 1
0157 st,drdy-int-pin: false
0158
0159 required:
0160 - compatible
0161 - reg
0162
0163 additionalProperties: false
0164
0165 examples:
0166 - |
0167 #include <dt-bindings/interrupt-controller/irq.h>
0168 i2c {
0169 #address-cells = <1>;
0170 #size-cells = <0>;
0171
0172 accelerometer@1c {
0173 compatible = "st,lis331dl-accel";
0174 reg = <0x1c>;
0175 st,drdy-int-pin = <1>;
0176 vdd-supply = <&ldo1>;
0177 vddio-supply = <&ldo2>;
0178 interrupt-parent = <&gpio>;
0179 interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>;
0180 };
0181 };
0182 spi {
0183 #address-cells = <1>;
0184 #size-cells = <0>;
0185 num-cs = <1>;
0186
0187 l3g4200d: gyroscope@0 {
0188 compatible = "st,l3g4200d-gyro";
0189 st,drdy-int-pin = <2>;
0190 reg = <0>;
0191 vdd-supply = <&vcc_io>;
0192 vddio-supply = <&vcc_io>;
0193 };
0194 };
0195 ...