1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/accel/bosch,bma255.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Bosch BMA255 and Similar Accelerometers
8
9maintainers:
10  - Linus Walleij <linus.walleij@linaro.org>
11  - Stephan Gerhold <stephan@gerhold.net>
12
13description:
14  3 axis accelerometers with varying range and I2C or SPI
15  4-wire interface.
16
17properties:
18  compatible:
19    enum:
20      # bmc150-accel driver in Linux
21      - bosch,bma222
22      - bosch,bma222e
23      - bosch,bma250e
24      - bosch,bma253
25      - bosch,bma254
26      - bosch,bma255
27      - bosch,bma280
28      - bosch,bmc150_accel
29      - bosch,bmc156_accel
30      - bosch,bmi055_accel
31
32      # bma180 driver in Linux
33      - bosch,bma023
34      - bosch,bma150
35      - bosch,bma180
36      - bosch,bma250
37      - bosch,smb380
38
39  reg:
40    maxItems: 1
41
42  vdd-supply: true
43  vddio-supply: true
44
45  interrupts:
46    minItems: 1
47    maxItems: 2
48    description: |
49      Without interrupt-names, the first interrupt listed must be the one
50      connected to the INT1 pin, the second (optional) interrupt listed must be
51      the one connected to the INT2 pin (if available). The type should be
52      IRQ_TYPE_EDGE_RISING.
53
54      BMC156 does not have an INT1 pin, therefore the first interrupt pin is
55      always treated as INT2.
56
57  interrupt-names:
58    minItems: 1
59    maxItems: 2
60    items:
61      enum:
62        - INT1
63        - INT2
64
65  mount-matrix:
66    description: an optional 3x3 mounting rotation matrix.
67
68  spi-max-frequency:
69    maximum: 10000000
70
71required:
72  - compatible
73  - reg
74
75additionalProperties: false
76
77examples:
78  - |
79    #include <dt-bindings/interrupt-controller/irq.h>
80    i2c {
81        #address-cells = <1>;
82        #size-cells = <0>;
83        accelerometer@8 {
84            compatible = "bosch,bma222";
85            reg = <0x08>;
86            vddio-supply = <&vddio>;
87            vdd-supply = <&vdd>;
88            interrupts = <57 IRQ_TYPE_EDGE_RISING>;
89            interrupt-names = "INT1";
90        };
91    };
92  - |
93    #include <dt-bindings/interrupt-controller/irq.h>
94    i2c {
95        #address-cells = <1>;
96        #size-cells = <0>;
97        accelerometer@10 {
98            compatible = "bosch,bmc156_accel";
99            reg = <0x10>;
100            vddio-supply = <&vddio>;
101            vdd-supply = <&vdd>;
102            interrupts = <116 IRQ_TYPE_EDGE_RISING>;
103            interrupt-names = "INT2";
104        };
105    };
106  - |
107    # include <dt-bindings/interrupt-controller/irq.h>
108    spi {
109        #address-cells = <1>;
110        #size-cells = <0>;
111        accel@0 {
112            compatible = "bosch,bma222";
113            reg = <0>;
114            spi-max-frequency = <10000000>;
115        };
116    };
117...
118