15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 25def4c47SEmmanuel Vadot%YAML 1.2 35def4c47SEmmanuel Vadot--- 45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/st,st-sensors.yaml# 55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 65def4c47SEmmanuel Vadot 75def4c47SEmmanuel Vadottitle: STMicroelectronics MEMS sensors 85def4c47SEmmanuel Vadot 95956d97fSEmmanuel Vadotdescription: The STMicroelectronics sensor devices are pretty straight-forward 105956d97fSEmmanuel Vadot I2C or SPI devices, all sharing the same device tree descriptions no matter 115956d97fSEmmanuel Vadot what type of sensor it is. 125def4c47SEmmanuel Vadot Note that whilst this covers many STMicro MEMs sensors, some more complex 135def4c47SEmmanuel Vadot IMUs need their own bindings. 145def4c47SEmmanuel Vadot 155def4c47SEmmanuel Vadotmaintainers: 165def4c47SEmmanuel Vadot - Denis Ciocca <denis.ciocca@st.com> 175956d97fSEmmanuel Vadot - Linus Walleij <linus.walleij@linaro.org> 185def4c47SEmmanuel Vadot 195def4c47SEmmanuel Vadotproperties: 205def4c47SEmmanuel Vadot compatible: 215956d97fSEmmanuel Vadot oneOf: 225956d97fSEmmanuel Vadot - description: STMicroelectronics Accelerometers 235def4c47SEmmanuel Vadot enum: 245956d97fSEmmanuel Vadot - st,h3lis331dl-accel 255956d97fSEmmanuel Vadot - st,lis2de12 265956d97fSEmmanuel Vadot - st,lis2dw12 275956d97fSEmmanuel Vadot - st,lis2hh12 285956d97fSEmmanuel Vadot - st,lis2dh12-accel 29d5b0e70fSEmmanuel Vadot - st,lis302dl 305956d97fSEmmanuel Vadot - st,lis331dl-accel 315956d97fSEmmanuel Vadot - st,lis331dlh-accel 325956d97fSEmmanuel Vadot - st,lis3de 335956d97fSEmmanuel Vadot - st,lis3dh-accel 345956d97fSEmmanuel Vadot - st,lis3dhh 355956d97fSEmmanuel Vadot - st,lis3l02dq 365def4c47SEmmanuel Vadot - st,lis3lv02dl-accel 375956d97fSEmmanuel Vadot - st,lng2dm-accel 385956d97fSEmmanuel Vadot - st,lsm303agr-accel 39cb7aa33aSEmmanuel Vadot - st,lsm303c-accel 405956d97fSEmmanuel Vadot - st,lsm303dl-accel 415def4c47SEmmanuel Vadot - st,lsm303dlh-accel 425def4c47SEmmanuel Vadot - st,lsm303dlhc-accel 435956d97fSEmmanuel Vadot - st,lsm303dlm-accel 445956d97fSEmmanuel Vadot - st,lsm330-accel 455def4c47SEmmanuel Vadot - st,lsm330d-accel 465def4c47SEmmanuel Vadot - st,lsm330dl-accel 475def4c47SEmmanuel Vadot - st,lsm330dlc-accel 48fac71e4eSEmmanuel Vadot - items: 49fac71e4eSEmmanuel Vadot - const: st,iis328dq 50fac71e4eSEmmanuel Vadot - const: st,h3lis331dl-accel 51c9ccf3a3SEmmanuel Vadot - description: Silan Accelerometers 52c9ccf3a3SEmmanuel Vadot enum: 53c9ccf3a3SEmmanuel Vadot - silan,sc7a20 545956d97fSEmmanuel Vadot - description: STMicroelectronics Gyroscopes 555956d97fSEmmanuel Vadot enum: 565def4c47SEmmanuel Vadot - st,l3g4200d-gyro 575956d97fSEmmanuel Vadot - st,l3g4is-gyro 585956d97fSEmmanuel Vadot - st,l3gd20-gyro 595956d97fSEmmanuel Vadot - st,l3gd20h-gyro 605956d97fSEmmanuel Vadot - st,lsm330-gyro 615def4c47SEmmanuel Vadot - st,lsm330d-gyro 625def4c47SEmmanuel Vadot - st,lsm330dl-gyro 635def4c47SEmmanuel Vadot - st,lsm330dlc-gyro 645def4c47SEmmanuel Vadot - st,lsm9ds0-gyro 655956d97fSEmmanuel Vadot - description: STMicroelectronics Magnetometers 665956d97fSEmmanuel Vadot enum: 675956d97fSEmmanuel Vadot - st,lis2mdl 685956d97fSEmmanuel Vadot - st,lis3mdl-magn 695def4c47SEmmanuel Vadot - st,lsm303agr-magn 70cb7aa33aSEmmanuel Vadot - st,lsm303c-magn 715def4c47SEmmanuel Vadot - st,lsm303dlh-magn 725def4c47SEmmanuel Vadot - st,lsm303dlhc-magn 735def4c47SEmmanuel Vadot - st,lsm303dlm-magn 745def4c47SEmmanuel Vadot - st,lsm9ds1-magn 755956d97fSEmmanuel Vadot - description: STMicroelectronics Pressure Sensors 765956d97fSEmmanuel Vadot enum: 775def4c47SEmmanuel Vadot - st,lps001wp-press 787ef62cebSEmmanuel Vadot - st,lps22df 795956d97fSEmmanuel Vadot - st,lps22hb-press 805956d97fSEmmanuel Vadot - st,lps22hh 815def4c47SEmmanuel Vadot - st,lps25h-press 825def4c47SEmmanuel Vadot - st,lps331ap-press 835def4c47SEmmanuel Vadot - st,lps33hw 845def4c47SEmmanuel Vadot - st,lps35hw 855956d97fSEmmanuel Vadot - description: IMUs 865956d97fSEmmanuel Vadot enum: 87f126890aSEmmanuel Vadot - st,lsm303d-imu 885956d97fSEmmanuel Vadot - st,lsm9ds0-imu 895956d97fSEmmanuel Vadot - description: Deprecated bindings 905956d97fSEmmanuel Vadot enum: 915956d97fSEmmanuel Vadot - st,lis302dl-spi 925956d97fSEmmanuel Vadot - st,lis3lv02d 935956d97fSEmmanuel Vadot deprecated: true 945def4c47SEmmanuel Vadot 955def4c47SEmmanuel Vadot reg: 965def4c47SEmmanuel Vadot maxItems: 1 975def4c47SEmmanuel Vadot 985def4c47SEmmanuel Vadot interrupts: 995956d97fSEmmanuel Vadot description: interrupt line(s) connected to the DRDY line(s) and/or the 100*aa1a8ff2SEmmanuel Vadot Inertial interrupt lines INT1 and INT2 if these exist. This means up to 1015956d97fSEmmanuel Vadot three interrupts, and the DRDY must be the first one if it exists on 1025956d97fSEmmanuel Vadot the package. The trigger edge of the interrupts is sometimes software 1035956d97fSEmmanuel Vadot configurable in the hardware so the operating system should parse this 1045956d97fSEmmanuel Vadot flag and set up the trigger edge as indicated in the device tree. 1055def4c47SEmmanuel Vadot minItems: 1 1065956d97fSEmmanuel Vadot maxItems: 2 1075def4c47SEmmanuel Vadot 1085def4c47SEmmanuel Vadot vdd-supply: true 1095def4c47SEmmanuel Vadot vddio-supply: true 1105def4c47SEmmanuel Vadot 1115def4c47SEmmanuel Vadot st,drdy-int-pin: 1125956d97fSEmmanuel Vadot description: the pin on the package that will be used to signal 1135956d97fSEmmanuel Vadot "data ready" (valid values 1 or 2). This property is not configurable 1145956d97fSEmmanuel Vadot on all sensors. 1155def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1165956d97fSEmmanuel Vadot enum: [1, 2] 1175def4c47SEmmanuel Vadot 1185def4c47SEmmanuel Vadot drive-open-drain: 1195def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1205956d97fSEmmanuel Vadot description: the interrupt/data ready line will be configured 1215956d97fSEmmanuel Vadot as open drain, which is useful if several sensors share the same 1225956d97fSEmmanuel Vadot interrupt line. (This binding is taken from pinctrl.) 1235956d97fSEmmanuel Vadot 1245956d97fSEmmanuel Vadot mount-matrix: 1255956d97fSEmmanuel Vadot description: an optional 3x3 mounting rotation matrix. 1265956d97fSEmmanuel Vadot 1275956d97fSEmmanuel VadotallOf: 1285956d97fSEmmanuel Vadot - if: 1295956d97fSEmmanuel Vadot properties: 1305956d97fSEmmanuel Vadot compatible: 1315956d97fSEmmanuel Vadot enum: 1325956d97fSEmmanuel Vadot # These have no interrupts 1335956d97fSEmmanuel Vadot - st,lps001wp 1345956d97fSEmmanuel Vadot then: 1355956d97fSEmmanuel Vadot properties: 1365956d97fSEmmanuel Vadot interrupts: false 1375956d97fSEmmanuel Vadot st,drdy-int-pin: false 1385956d97fSEmmanuel Vadot drive-open-drain: false 1395956d97fSEmmanuel Vadot 1405956d97fSEmmanuel Vadot - if: 1415956d97fSEmmanuel Vadot properties: 1425956d97fSEmmanuel Vadot compatible: 1435956d97fSEmmanuel Vadot enum: 1445956d97fSEmmanuel Vadot # These have only DRDY 1455956d97fSEmmanuel Vadot - st,lis2mdl 1465956d97fSEmmanuel Vadot - st,lis3l02dq 1475956d97fSEmmanuel Vadot - st,lis3lv02dl-accel 1487ef62cebSEmmanuel Vadot - st,lps22df 1495956d97fSEmmanuel Vadot - st,lps22hb-press 1505956d97fSEmmanuel Vadot - st,lps22hh 1515956d97fSEmmanuel Vadot - st,lps25h-press 1525956d97fSEmmanuel Vadot - st,lps33hw 1535956d97fSEmmanuel Vadot - st,lps35hw 1545956d97fSEmmanuel Vadot - st,lsm303agr-magn 1555956d97fSEmmanuel Vadot - st,lsm303dlh-magn 1565956d97fSEmmanuel Vadot - st,lsm303dlhc-magn 1575956d97fSEmmanuel Vadot - st,lsm303dlm-magn 1585956d97fSEmmanuel Vadot then: 1595956d97fSEmmanuel Vadot properties: 1605956d97fSEmmanuel Vadot interrupts: 1615956d97fSEmmanuel Vadot maxItems: 1 1625956d97fSEmmanuel Vadot st,drdy-int-pin: false 1635def4c47SEmmanuel Vadot 1645def4c47SEmmanuel Vadotrequired: 1655def4c47SEmmanuel Vadot - compatible 1665def4c47SEmmanuel Vadot - reg 1675def4c47SEmmanuel Vadot 1685def4c47SEmmanuel VadotadditionalProperties: false 1695def4c47SEmmanuel Vadot 1705def4c47SEmmanuel Vadotexamples: 1715def4c47SEmmanuel Vadot - | 1725def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 1735def4c47SEmmanuel Vadot i2c { 1745def4c47SEmmanuel Vadot #address-cells = <1>; 1755def4c47SEmmanuel Vadot #size-cells = <0>; 1765956d97fSEmmanuel Vadot 1775956d97fSEmmanuel Vadot accelerometer@1c { 1785956d97fSEmmanuel Vadot compatible = "st,lis331dl-accel"; 1795956d97fSEmmanuel Vadot reg = <0x1c>; 1805956d97fSEmmanuel Vadot st,drdy-int-pin = <1>; 1815956d97fSEmmanuel Vadot vdd-supply = <&ldo1>; 1825956d97fSEmmanuel Vadot vddio-supply = <&ldo2>; 1835956d97fSEmmanuel Vadot interrupt-parent = <&gpio>; 1845956d97fSEmmanuel Vadot interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>; 1855956d97fSEmmanuel Vadot }; 1865956d97fSEmmanuel Vadot }; 1875956d97fSEmmanuel Vadot spi { 1885956d97fSEmmanuel Vadot #address-cells = <1>; 1895956d97fSEmmanuel Vadot #size-cells = <0>; 1905956d97fSEmmanuel Vadot num-cs = <1>; 1915956d97fSEmmanuel Vadot 1925956d97fSEmmanuel Vadot l3g4200d: gyroscope@0 { 1935956d97fSEmmanuel Vadot compatible = "st,l3g4200d-gyro"; 1945956d97fSEmmanuel Vadot st,drdy-int-pin = <2>; 1955956d97fSEmmanuel Vadot reg = <0>; 1965956d97fSEmmanuel Vadot vdd-supply = <&vcc_io>; 1975956d97fSEmmanuel Vadot vddio-supply = <&vcc_io>; 1985def4c47SEmmanuel Vadot }; 1995def4c47SEmmanuel Vadot }; 2005def4c47SEmmanuel Vadot... 201