1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/accel/adi,adxl345.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
8
9maintainers:
10  - Michael Hennerich <michael.hennerich@analog.com>
11
12description: |
13  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
14  both I2C & SPI interfaces.
15    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
16    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
17
18properties:
19  compatible:
20    enum:
21      - adi,adxl345
22      - adi,adxl375
23
24  reg:
25    maxItems: 1
26
27  spi-cpha: true
28
29  spi-cpol: true
30
31  interrupts:
32    maxItems: 1
33
34required:
35  - compatible
36  - reg
37  - interrupts
38
39examples:
40  - |
41    #include <dt-bindings/gpio/gpio.h>
42    #include <dt-bindings/interrupt-controller/irq.h>
43    i2c0 {
44        #address-cells = <1>;
45        #size-cells = <0>;
46
47        /* Example for a I2C device node */
48        accelerometer@2a {
49            compatible = "adi,adxl345";
50            reg = <0x53>;
51            interrupt-parent = <&gpio0>;
52            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
53        };
54    };
55  - |
56    #include <dt-bindings/gpio/gpio.h>
57    #include <dt-bindings/interrupt-controller/irq.h>
58    spi0 {
59        #address-cells = <1>;
60        #size-cells = <0>;
61
62        /* Example for a SPI device node */
63        accelerometer@0 {
64            compatible = "adi,adxl345";
65            reg = <0>;
66            spi-max-frequency = <5000000>;
67            spi-cpol;
68            spi-cpha;
69            interrupt-parent = <&gpio0>;
70            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
71        };
72    };
73