summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
blob: 53f9feff137ba601cc5f3515e397ec17f2df1438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2022 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,max11410.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices MAX11410 ADC device driver

maintainers:
  - Ibrahim Tilki <Ibrahim.Tilki@analog.com>

description: |
  Bindings for the Analog Devices MAX11410 ADC device. Datasheet can be
  found here:
    https://datasheets.maximintegrated.com/en/ds/MAX11410.pdf

properties:
  compatible:
    enum:
      - adi,max11410

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2

  interrupt-names:
    description: Name of the gpio pin of max11410 used for IRQ
    minItems: 1
    items:
      - enum: [gpio0, gpio1]
      - const: gpio1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  avdd-supply:
    description: Optional avdd supply. Used as reference when no explicit reference supplied.

  vref0p-supply:
    description: vref0p supply can be used as reference for conversion.

  vref1p-supply:
    description: vref1p supply can be used as reference for conversion.

  vref2p-supply:
    description: vref2p supply can be used as reference for conversion.

  vref0n-supply:
    description: vref0n supply can be used as reference for conversion.

  vref1n-supply:
    description: vref1n supply can be used as reference for conversion.

  vref2n-supply:
    description: vref2n supply can be used as reference for conversion.

  spi-max-frequency:
    maximum: 8000000

patternProperties:
  "^channel(@[0-9])?$":
    $ref: adc.yaml
    type: object
    description: Represents the external channels which are connected to the ADC.

    properties:
      reg:
        description: The channel number in single-ended mode.
        minimum: 0
        maximum: 9

      adi,reference:
        description: |
          Select the reference source to use when converting on
          the specific channel. Valid values are:
          0: VREF0P/VREF0N
          1: VREF1P/VREF1N
          2: VREF2P/VREF2N
          3: AVDD/AGND
          4: VREF0P/AGND
          5: VREF1P/AGND
          6: VREF2P/AGND
          If this field is left empty, AVDD/AGND is selected.
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3, 4, 5, 6]
        default: 3

      adi,input-mode:
        description: |
          Select signal path of input channels. Valid values are:
          0: Buffered, low-power, unity-gain path (default)
          1: Bypass path
          2: PGA path
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2]
        default: 0

      diff-channels: true

      bipolar: true

      settling-time-us: true

      adi,buffered-vrefp:
        description: Enable buffered mode for positive reference.
        type: boolean

      adi,buffered-vrefn:
        description: Enable buffered mode for negative reference.
        type: boolean

    required:
      - reg

    additionalProperties: false

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        adc@0 {
            reg = <0>;
            compatible = "adi,max11410";
            spi-max-frequency = <8000000>;

            interrupt-parent = <&gpio>;
            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
            interrupt-names = "gpio1";

            avdd-supply = <&adc_avdd>;

            vref1p-supply = <&adc_vref1p>;
            vref1n-supply = <&adc_vref1n>;

            #address-cells = <1>;
            #size-cells = <0>;

            channel@0 {
                reg = <0>;
            };

            channel@1 {
                reg = <1>;
                diff-channels = <2 3>;
                adi,reference = <1>;
                bipolar;
                settling-time-us = <100000>;
            };

            channel@2 {
                reg = <2>;
                diff-channels = <7 9>;
                adi,reference = <5>;
                adi,input-mode = <2>;
                settling-time-us = <50000>;
            };
        };
    };