iio: st-sensors: Update ST Sensor bindings
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / iio / st,st-sensors.yaml
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
7 title: STMicroelectronics MEMS sensors
8
9 description: 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
18 maintainers:
19   - Denis Ciocca <denis.ciocca@st.com>
20   - Linus Walleij <linus.walleij@linaro.org>
21
22 properties:
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,lis331dl-accel
33           - st,lis331dlh-accel
34           - st,lis3de
35           - st,lis3dh-accel
36           - st,lis3dhh
37           - st,lis3l02dq
38           - st,lis3lv02dl-accel
39           - st,lng2dm-accel
40           - st,lsm303agr-accel
41           - st,lsm303dl-accel
42           - st,lsm303dlh-accel
43           - st,lsm303dlhc-accel
44           - st,lsm303dlm-accel
45           - st,lsm330-accel
46           - st,lsm330d-accel
47           - st,lsm330dl-accel
48           - st,lsm330dlc-accel
49       - description: STMicroelectronics Gyroscopes
50         enum:
51           - st,l3g4200d-gyro
52           - st,l3g4is-gyro
53           - st,l3gd20-gyro
54           - st,l3gd20h-gyro
55           - st,lsm330-gyro
56           - st,lsm330d-gyro
57           - st,lsm330dl-gyro
58           - st,lsm330dlc-gyro
59           - st,lsm9ds0-gyro
60       - description: STMicroelectronics Magnetometers
61         enum:
62           - st,lis2mdl
63           - st,lis3mdl-magn
64           - st,lsm303agr-magn
65           - st,lsm303dlh-magn
66           - st,lsm303dlhc-magn
67           - st,lsm303dlm-magn
68           - st,lsm9ds1-magn
69       - description: STMicroelectronics Pressure Sensors
70         enum:
71           - st,lps001wp-press
72           - st,lps22hb-press
73           - st,lps22hh
74           - st,lps25h-press
75           - st,lps331ap-press
76           - st,lps33hw
77           - st,lps35hw
78       - description: Deprecated bindings
79         enum:
80           - st,lis302dl-spi
81           - st,lis3lv02d
82         deprecated: true
83
84   reg:
85     maxItems: 1
86
87   interrupts:
88     description: interrupt line(s) connected to the DRDY line(s) and/or the
89       Intertial interrupt lines INT1 and INT2 if these exist. This means up to
90       three interrupts, and the DRDY must be the first one if it exists on
91       the package. The trigger edge of the interrupts is sometimes software
92       configurable in the hardware so the operating system should parse this
93       flag and set up the trigger edge as indicated in the device tree.
94     minItems: 1
95     maxItems: 2
96
97   vdd-supply: true
98   vddio-supply: true
99
100   st,drdy-int-pin:
101     description: the pin on the package that will be used to signal
102       "data ready" (valid values 1 or 2). This property is not configurable
103       on all sensors.
104     $ref: /schemas/types.yaml#/definitions/uint32
105     enum: [1, 2]
106
107   drive-open-drain:
108     $ref: /schemas/types.yaml#/definitions/flag
109     description: the interrupt/data ready line will be configured
110       as open drain, which is useful if several sensors share the same
111       interrupt line. (This binding is taken from pinctrl.)
112
113   mount-matrix:
114     description: an optional 3x3 mounting rotation matrix.
115
116 allOf:
117   - if:
118       properties:
119         compatible:
120           enum:
121             # These have no interrupts
122             - st,lps001wp
123     then:
124       properties:
125         interrupts: false
126         st,drdy-int-pin: false
127         drive-open-drain: false
128
129   - if:
130       properties:
131         compatible:
132           enum:
133             # These have only DRDY
134             - st,lis2mdl
135             - st,lis3l02dq
136             - st,lis3lv02dl-accel
137             - st,lps22hb-press
138             - st,lps22hh
139             - st,lps25h-press
140             - st,lps33hw
141             - st,lps35hw
142             - st,lsm303agr-magn
143             - st,lsm303dlh-magn
144             - st,lsm303dlhc-magn
145             - st,lsm303dlm-magn
146     then:
147       properties:
148         interrupts:
149           maxItems: 1
150         st,drdy-int-pin: false
151
152   - if:
153       properties:
154         compatible:
155           enum:
156             # Two intertial interrupts i.e. accelerometer/gyro interrupts
157             - st,h3lis331dl-accel
158             - st,l3g4200d-gyro
159             - st,l3g4is-gyro
160             - st,l3gd20-gyro
161             - st,l3gd20h-gyro
162             - st,lis2de12
163             - st,lis2dw12
164             - st,lis2hh12
165             - st,lis2dh12-accel
166             - st,lis331dl-accel
167             - st,lis331dlh-accel
168             - st,lis3de
169             - st,lis3dh-accel
170             - st,lis3dhh
171             - st,lis3mdl-magn
172             - st,lng2dm-accel
173             - st,lps331ap-press
174             - st,lsm303agr-accel
175             - st,lsm303dlh-accel
176             - st,lsm303dlhc-accel
177             - st,lsm303dlm-accel
178             - st,lsm330-accel
179             - st,lsm330-gyro
180             - st,lsm330d-accel
181             - st,lsm330d-gyro
182             - st,lsm330dl-accel
183             - st,lsm330dl-gyro
184             - st,lsm330dlc-accel
185             - st,lsm330dlc-gyro
186             - st,lsm9ds0-gyro
187             - st,lsm9ds1-magn
188     then:
189       properties:
190         interrupts:
191           maxItems: 2
192
193 required:
194   - compatible
195   - reg
196
197 additionalProperties: false
198
199 examples:
200   - |
201     #include <dt-bindings/interrupt-controller/irq.h>
202     i2c {
203       #address-cells = <1>;
204       #size-cells = <0>;
205
206       accelerometer@1c {
207         compatible = "st,lis331dl-accel";
208         reg = <0x1c>;
209         st,drdy-int-pin = <1>;
210         vdd-supply = <&ldo1>;
211         vddio-supply = <&ldo2>;
212         interrupt-parent = <&gpio>;
213         interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>;
214       };
215     };
216     spi {
217       #address-cells = <1>;
218       #size-cells = <0>;
219       num-cs = <1>;
220
221       l3g4200d: gyroscope@0 {
222         compatible = "st,l3g4200d-gyro";
223         st,drdy-int-pin = <2>;
224         reg = <0>;
225         vdd-supply = <&vcc_io>;
226         vddio-supply = <&vcc_io>;
227       };
228     };
229 ...