xref: /linux/Documentation/devicetree/bindings/iio/accel/adi,adxl313.yaml (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/accel/adi,adxl313.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices ADXL312, ADXL313, and ADXL314 3-Axis Digital Accelerometers
8
9maintainers:
10  - Lucas Stankus <lucas.p.stankus@gmail.com>
11
12description: |
13  Analog Devices ADXL312, ADXL313, and ADXL314 3-Axis Digital Accelerometer that
14  support both I2C & SPI interfaces.
15    https://www.analog.com/en/products/adxl312.html
16    https://www.analog.com/en/products/adxl313.html
17    https://www.analog.com/en/products/adxl314.html
18
19properties:
20  compatible:
21    enum:
22      - adi,adxl312
23      - adi,adxl313
24      - adi,adxl314
25
26  reg:
27    maxItems: 1
28
29  spi-3wire: true
30
31  vs-supply:
32    description: Regulator that supplies power to the accelerometer
33
34  vdd-supply:
35    description: Regulator that supplies the digital interface supply voltage
36
37  interrupts:
38    minItems: 1
39    maxItems: 2
40
41  interrupt-names:
42    minItems: 1
43    maxItems: 2
44    items:
45      enum:
46        - INT1
47        - INT2
48
49required:
50  - compatible
51  - reg
52
53allOf:
54  - $ref: /schemas/spi/spi-peripheral-props.yaml#
55
56unevaluatedProperties: false
57
58examples:
59  - |
60    #include <dt-bindings/gpio/gpio.h>
61    #include <dt-bindings/interrupt-controller/irq.h>
62    i2c {
63        #address-cells = <1>;
64        #size-cells = <0>;
65
66        /* Example for a I2C device node */
67        accelerometer@53 {
68            compatible = "adi,adxl313";
69            reg = <0x53>;
70            interrupt-parent = <&gpio0>;
71            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
72            interrupt-names = "INT1";
73        };
74    };
75  - |
76    #include <dt-bindings/gpio/gpio.h>
77    #include <dt-bindings/interrupt-controller/irq.h>
78    spi {
79        #address-cells = <1>;
80        #size-cells = <0>;
81
82        /* Example for a SPI device node */
83        accelerometer@0 {
84            compatible = "adi,adxl313";
85            reg = <0>;
86            spi-max-frequency = <5000000>;
87            interrupt-parent = <&gpio0>;
88            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
89            interrupt-names = "INT1";
90        };
91    };
92