Documentation / devicetree / bindings / iio / adc / adi,ad4695.yaml


Based on kernel version 6.12.4. Page generated on 2024-12-12 21:01 EST.

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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4695.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices Easy Drive Multiplexed SAR Analog to Digital Converters

maintainers:
  - Michael Hennerich <Michael.Hennerich@analog.com>
  - Nuno Sá <nuno.sa@analog.com>

description: |
  A family of similar multi-channel analog to digital converters with SPI bus.
 
  * https://www.analog.com/en/products/ad4695.html
  * https://www.analog.com/en/products/ad4696.html
  * https://www.analog.com/en/products/ad4697.html
  * https://www.analog.com/en/products/ad4698.html
 
$ref: /schemas/spi/spi-peripheral-props.yaml#

properties:
  compatible:
    enum:
      - adi,ad4695
      - adi,ad4696
      - adi,ad4697
      - adi,ad4698

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 80000000

  spi-cpol: true
  spi-cpha: true

  spi-rx-bus-width:
    minimum: 1
    maximum: 4

  avdd-supply:
    description: Analog power supply.

  vio-supply:
    description: I/O pin power supply.

  ldo-in-supply:
    description: Internal LDO Input. Mutually exclusive with vdd-supply.

  vdd-supply:
    description: Core power supply. Mutually exclusive with ldo-in-supply.

  ref-supply:
    description:
      External reference voltage. Mutually exclusive with refin-supply.

  refin-supply:
    description:
      Internal reference buffer input. Mutually exclusive with ref-supply.

  com-supply:
    description: Common voltage supply for pseudo-differential analog inputs.

  adi,no-ref-current-limit:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      When this flag is present, the REF Overvoltage Reduced Current protection
      is disabled.

  adi,no-ref-high-z:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Enable this flag if the ref-supply requires Reference Input High-Z Mode
      to be disabled for proper operation.

  cnv-gpios:
    description: The Convert Input (CNV). If omitted, CNV is tied to SPI CS.
    maxItems: 1

  reset-gpios:
    description: The Reset Input (RESET). Should be configured GPIO_ACTIVE_LOW.
    maxItems: 1

  interrupts:
    minItems: 1
    items:
      - description: Signal coming from the BSY_ALT_GP0 pin (ALERT or BUSY).
      - description: Signal coming from the GP2 pin (ALERT).
      - description: Signal coming from the GP3 pin (BUSY).

  interrupt-names:
    minItems: 1
    items:
      - const: gp0
      - const: gp2
      - const: gp3

  gpio-controller: true
 
  "#gpio-cells":
    const: 2
    description: |
      The first cell is the GPn number: 0 to 3.
      The second cell takes standard GPIO flags.
 
  "#address-cells":
    const: 1
 
  "#size-cells":
    const: 0

patternProperties:
  "^in(?:[13579]|1[135])-supply$":
    description:
      Optional voltage supply for odd numbered channels when they are used as
      the negative input for a pseudo-differential channel.
 
  "^channel@[0-9a-f]$":
    type: object
    $ref: adc.yaml
    unevaluatedProperties: false
    description:
      Describes each individual channel. In addition the properties defined
      below, bipolar from adc.yaml is also supported.

    properties:
      reg:
        maximum: 15

      common-mode-channel:
        description:
          Describes the common mode channel for single channels. 0xFF is REFGND
          and OxFE is COM. Macros are available for these values in
          dt-bindings/iio/adi,ad4695.h. Values 1 to 15 correspond to INx inputs.
          Only odd numbered INx inputs can be used as common mode channels.
        enum: [1, 3, 5, 7, 9, 11, 13, 15, 0xFE, 0xFF]
        default: 0xFF

      adi,no-high-z:
        $ref: /schemas/types.yaml#/definitions/flag
        description:
          Enable this flag if the input pin requires the Analog Input High-Z
          Mode to be disabled for proper operation.

    required:
      - reg

    allOf:
      # bipolar mode can't be used with REFGND
      - if:
          properties:
            common-mode-channel:
              const: 0xFF
        then:
          properties:
            bipolar: false

required:
  - compatible
  - reg
  - avdd-supply
  - vio-supply

allOf:
  - oneOf:
      - required:
          - ldo-in-supply
      - required:
          - vdd-supply

  - oneOf:
      - required:
          - ref-supply
      - required:
          - refin-supply
 
  # the internal reference buffer always requires high-z mode
  - if:
      required:
        - refin-supply
    then:
      properties:
        adi,no-ref-high-z: false
 
  # limit channels for 8-channel chips
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad4697
              - adi,ad4698
    then:
      patternProperties:
        "^in(?:9|1[135])-supply$": false
        "^channel@[0-7]$":
          properties:
            reg:
              maximum: 7
            common-mode-channel:
              enum: [1, 3, 5, 7, 0xFE, 0xFF]
        "^channel@[8-9a-f]$": false

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/iio/adi,ad4695.h>
 
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
 
        adc@0 {
            compatible = "adi,ad4695";
            reg = <0>;
            spi-cpol;
            spi-cpha;
            spi-max-frequency = <80000000>;
            avdd-supply = <&power_supply>;
            ldo-in-supply = <&power_supply>;
            vio-supply = <&io_supply>;
            refin-supply = <&supply_5V>;
            com-supply = <&supply_2V5>;
            in3-supply = <&supply_2V5>;
            reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
 
            #address-cells = <1>;
            #size-cells = <0>;
 
            /* Pseudo-differential channel between IN0 and REFGND. */
            channel@0 {
                reg = <0>;
            };
 
            /* Pseudo-differential channel between IN1 and COM. */
            channel@1 {
                reg = <1>;
                common-mode-channel = <AD4695_COMMON_MODE_COM>;
                bipolar;
            };
 
            /* Pseudo-differential channel between IN2 and IN3. */
            channel@2 {
                reg = <2>;
                common-mode-channel = <3>;
                bipolar;
            };
        };
    };