xref: /linux/Documentation/devicetree/bindings/iio/st,st-sensors.yaml (revision c29a017f9df34d190fbc7917d30dbefce7d9dc1f)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/st,st-sensors.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: STMicroelectronics MEMS sensors
8
9description: The STMicroelectronics sensor devices are pretty straight-forward
10  I2C or SPI devices, all sharing the same device tree descriptions no matter
11  what type of sensor it is.
12  Note that whilst this covers many STMicro MEMs sensors, some more complex
13  IMUs need their own bindings.
14  The STMicroelectronics sensor devices are pretty straight-forward I2C or
15  SPI devices, all sharing the same device tree descriptions no matter what
16  type of sensor it is.
17
18maintainers:
19  - Denis Ciocca <denis.ciocca@st.com>
20  - Linus Walleij <linus.walleij@linaro.org>
21
22properties:
23  compatible:
24    oneOf:
25      - description: STMicroelectronics Accelerometers
26        enum:
27          - st,h3lis331dl-accel
28          - st,lis2de12
29          - st,lis2dw12
30          - st,lis2hh12
31          - st,lis2dh12-accel
32          - st,lis302dl
33          - st,lis331dl-accel
34          - st,lis331dlh-accel
35          - st,lis3de
36          - st,lis3dh-accel
37          - st,lis3dhh
38          - st,lis3l02dq
39          - st,lis3lv02dl-accel
40          - st,lng2dm-accel
41          - st,lsm303agr-accel
42          - st,lsm303dl-accel
43          - st,lsm303dlh-accel
44          - st,lsm303dlhc-accel
45          - st,lsm303dlm-accel
46          - st,lsm330-accel
47          - st,lsm330d-accel
48          - st,lsm330dl-accel
49          - st,lsm330dlc-accel
50      - description: Silan Accelerometers
51        enum:
52          - silan,sc7a20
53      - description: STMicroelectronics Gyroscopes
54        enum:
55          - st,l3g4200d-gyro
56          - st,l3g4is-gyro
57          - st,l3gd20-gyro
58          - st,l3gd20h-gyro
59          - st,lsm330-gyro
60          - st,lsm330d-gyro
61          - st,lsm330dl-gyro
62          - st,lsm330dlc-gyro
63          - st,lsm9ds0-gyro
64      - description: STMicroelectronics Magnetometers
65        enum:
66          - st,lis2mdl
67          - st,lis3mdl-magn
68          - st,lsm303agr-magn
69          - st,lsm303dlh-magn
70          - st,lsm303dlhc-magn
71          - st,lsm303dlm-magn
72          - st,lsm9ds1-magn
73      - description: STMicroelectronics Pressure Sensors
74        enum:
75          - st,lps001wp-press
76          - st,lps22df
77          - st,lps22hb-press
78          - st,lps22hh
79          - st,lps25h-press
80          - st,lps331ap-press
81          - st,lps33hw
82          - st,lps35hw
83      - description: IMUs
84        enum:
85          - st,lsm9ds0-imu
86      - description: Deprecated bindings
87        enum:
88          - st,lis302dl-spi
89          - st,lis3lv02d
90        deprecated: true
91
92  reg:
93    maxItems: 1
94
95  interrupts:
96    description: interrupt line(s) connected to the DRDY line(s) and/or the
97      Intertial interrupt lines INT1 and INT2 if these exist. This means up to
98      three interrupts, and the DRDY must be the first one if it exists on
99      the package. The trigger edge of the interrupts is sometimes software
100      configurable in the hardware so the operating system should parse this
101      flag and set up the trigger edge as indicated in the device tree.
102    minItems: 1
103    maxItems: 2
104
105  vdd-supply: true
106  vddio-supply: true
107
108  st,drdy-int-pin:
109    description: the pin on the package that will be used to signal
110      "data ready" (valid values 1 or 2). This property is not configurable
111      on all sensors.
112    $ref: /schemas/types.yaml#/definitions/uint32
113    enum: [1, 2]
114
115  drive-open-drain:
116    $ref: /schemas/types.yaml#/definitions/flag
117    description: the interrupt/data ready line will be configured
118      as open drain, which is useful if several sensors share the same
119      interrupt line. (This binding is taken from pinctrl.)
120
121  mount-matrix:
122    description: an optional 3x3 mounting rotation matrix.
123
124allOf:
125  - if:
126      properties:
127        compatible:
128          enum:
129            # These have no interrupts
130            - st,lps001wp
131    then:
132      properties:
133        interrupts: false
134        st,drdy-int-pin: false
135        drive-open-drain: false
136
137  - if:
138      properties:
139        compatible:
140          enum:
141            # These have only DRDY
142            - st,lis2mdl
143            - st,lis3l02dq
144            - st,lis3lv02dl-accel
145            - st,lps22df
146            - st,lps22hb-press
147            - st,lps22hh
148            - st,lps25h-press
149            - st,lps33hw
150            - st,lps35hw
151            - st,lsm303agr-magn
152            - st,lsm303dlh-magn
153            - st,lsm303dlhc-magn
154            - st,lsm303dlm-magn
155    then:
156      properties:
157        interrupts:
158          maxItems: 1
159        st,drdy-int-pin: false
160
161required:
162  - compatible
163  - reg
164
165additionalProperties: false
166
167examples:
168  - |
169    #include <dt-bindings/interrupt-controller/irq.h>
170    i2c {
171      #address-cells = <1>;
172      #size-cells = <0>;
173
174      accelerometer@1c {
175        compatible = "st,lis331dl-accel";
176        reg = <0x1c>;
177        st,drdy-int-pin = <1>;
178        vdd-supply = <&ldo1>;
179        vddio-supply = <&ldo2>;
180        interrupt-parent = <&gpio>;
181        interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>;
182      };
183    };
184    spi {
185      #address-cells = <1>;
186      #size-cells = <0>;
187      num-cs = <1>;
188
189      l3g4200d: gyroscope@0 {
190        compatible = "st,l3g4200d-gyro";
191        st,drdy-int-pin = <2>;
192        reg = <0>;
193        vdd-supply = <&vcc_io>;
194        vddio-supply = <&vcc_io>;
195      };
196    };
197...
198