xref: /freebsd/sys/contrib/device-tree/Bindings/iio/imu/invensense,mpu6050.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/imu/invensense,mpu6050.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Device
8
9maintainers:
10  - Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
11
12description: |
13  These devices support both I2C and SPI bus interfaces.
14
15properties:
16  compatible:
17    oneOf:
18      - enum:
19          - invensense,iam20680
20          - invensense,icm20608
21          - invensense,icm20609
22          - invensense,icm20689
23          - invensense,icm20602
24          - invensense,icm20690
25          - invensense,mpu6000
26          - invensense,mpu6050
27          - invensense,mpu6500
28          - invensense,mpu6515
29          - invensense,mpu6880
30          - invensense,mpu9150
31          - invensense,mpu9250
32          - invensense,mpu9255
33      - items:
34          - const: invensense,icm20600
35          - const: invensense,icm20602
36      - items:
37          - const: invensense,icm20608d
38          - const: invensense,icm20608
39
40  reg:
41    maxItems: 1
42
43  interrupts:
44    maxItems: 1
45
46  vdd-supply: true
47  vddio-supply: true
48
49  mount-matrix: true
50
51  invensense,level-shifter:
52    type: boolean
53    description: |
54      From ancient platform data struct: false: VLogic, true: VDD
55
56  i2c-gate:
57    $ref: /schemas/i2c/i2c-controller.yaml
58    unevaluatedProperties: false
59    description: |
60      These devices also support an auxiliary i2c bus via an i2c-gate.
61
62allOf:
63  - $ref: /schemas/spi/spi-peripheral-props.yaml#
64  - if:
65      not:
66        properties:
67          compatible:
68            contains:
69              enum:
70                - invensense,mpu9150
71                - invensense,mpu9250
72                - invensense,mpu9255
73    then:
74      properties:
75        i2c-gate: false
76
77unevaluatedProperties: false
78
79required:
80  - compatible
81  - reg
82  - interrupts
83
84examples:
85  - |
86    #include <dt-bindings/interrupt-controller/irq.h>
87    i2c {
88        #address-cells = <1>;
89        #size-cells = <0>;
90
91        imu@68 {
92            compatible = "invensense,mpu9250";
93            reg = <0x68>;
94            interrupt-parent = <&gpio3>;
95            interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
96            mount-matrix = "-0.984807753012208",  /* x0 */
97                           "0",                   /* y0 */
98                           "-0.173648177666930",  /* z0 */
99                           "0",                   /* x1 */
100                           "-1",                  /* y1 */
101                           "0",                   /* z1 */
102                           "-0.173648177666930",  /* x2 */
103                           "0",                   /* y2 */
104                           "0.984807753012208";   /* z2 */
105            i2c-gate {
106                #address-cells = <1>;
107                #size-cells = <0>;
108                magnetometer@c {
109                    compatible = "asahi-kasei,ak8975";
110                    reg = <0x0c>;
111                };
112            };
113        };
114    };
115...
116