xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/adi,ad7124.yaml (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2019 Analog Devices Inc.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/iio/adc/adi,ad7124.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Analog Devices AD7124 ADC device driver
9
10maintainers:
11  - Stefan Popa <stefan.popa@analog.com>
12
13description: |
14  Bindings for the Analog Devices AD7124 ADC device. Datasheet can be
15  found here:
16    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf
17
18properties:
19  compatible:
20    enum:
21      - adi,ad7124-4
22      - adi,ad7124-8
23
24  reg:
25    description: SPI chip select number for the device
26    maxItems: 1
27
28  clocks:
29    maxItems: 1
30    description: phandle to the master clock (mclk)
31
32  clock-names:
33    items:
34      - const: mclk
35
36  interrupts:
37    description: IRQ line for the ADC
38    maxItems: 1
39
40  '#address-cells':
41    const: 1
42
43  '#size-cells':
44    const: 0
45
46  refin1-supply:
47    description: refin1 supply can be used as reference for conversion.
48
49  refin2-supply:
50    description: refin2 supply can be used as reference for conversion.
51
52  avdd-supply:
53    description: avdd supply can be used as reference for conversion.
54
55  spi-max-frequency: true
56
57required:
58  - compatible
59  - reg
60  - clocks
61  - clock-names
62  - interrupts
63
64patternProperties:
65  "^channel@([0-9]|1[0-5])$":
66    type: object
67    description: |
68      Represents the external channels which are connected to the ADC.
69      See Documentation/devicetree/bindings/iio/adc/adc.txt.
70
71    properties:
72      reg:
73        description: |
74          The channel number. It can have up to 8 channels on ad7124-4
75          and 16 channels on ad7124-8, numbered from 0 to 15.
76        items:
77          minimum: 0
78          maximum: 15
79
80      adi,reference-select:
81        description: |
82          Select the reference source to use when converting on
83          the specific channel. Valid values are:
84          0: REFIN1(+)/REFIN1(−).
85          1: REFIN2(+)/REFIN2(−).
86          3: AVDD
87          If this field is left empty, internal reference is selected.
88        $ref: /schemas/types.yaml#/definitions/uint32
89        enum: [0, 1, 3]
90
91      diff-channels:
92        description: see Documentation/devicetree/bindings/iio/adc/adc.txt
93        items:
94          minimum: 0
95          maximum: 15
96
97      bipolar:
98        description: see Documentation/devicetree/bindings/iio/adc/adc.txt
99        type: boolean
100
101      adi,buffered-positive:
102        description: Enable buffered mode for positive input.
103        type: boolean
104
105      adi,buffered-negative:
106        description: Enable buffered mode for negative input.
107        type: boolean
108
109    required:
110      - reg
111      - diff-channels
112
113additionalProperties: false
114
115examples:
116  - |
117    spi {
118      #address-cells = <1>;
119      #size-cells = <0>;
120
121      adc@0 {
122        compatible = "adi,ad7124-4";
123        reg = <0>;
124        spi-max-frequency = <5000000>;
125        interrupts = <25 2>;
126        interrupt-parent = <&gpio>;
127        refin1-supply = <&adc_vref>;
128        clocks = <&ad7124_mclk>;
129        clock-names = "mclk";
130
131        #address-cells = <1>;
132        #size-cells = <0>;
133
134        channel@0 {
135          reg = <0>;
136          diff-channels = <0 1>;
137          adi,reference-select = <0>;
138          adi,buffered-positive;
139        };
140
141        channel@1 {
142          reg = <1>;
143          bipolar;
144          diff-channels = <2 3>;
145          adi,reference-select = <0>;
146          adi,buffered-positive;
147          adi,buffered-negative;
148        };
149
150        channel@2 {
151          reg = <2>;
152          diff-channels = <4 5>;
153        };
154
155        channel@3 {
156          reg = <3>;
157          diff-channels = <6 7>;
158        };
159      };
160    };
161