# Analog Devices AD7124 ADC device driver

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Industrial I/O bindings / adc_

> Device-tree binding reference for Analog Devices AD7124 ADC device driver.

<!-- SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;iio&#47;adc&#47;adi&#44;ad7124&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Marcelo Schmitt &#60;marcelo&#46;schmitt&#64;analog&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Nuno Sá &#60;nuno&#46;sa&#64;analog&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<pre><code>Bindings for the Analog Devices AD7124 ADC device. Datasheet can be
found here:
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-8.pdf</code></pre>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;adi&#44;ad7124&#45;4&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;adi&#44;ad7124&#45;8&#34;</code></span>

<a id="dt-9c1635fdb65d87e33d77"></a>

### <code>reg</code> — required here

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">SPI chip select number for the device</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

<a id="dt-4e9a371963ac013ad39d"></a>

### <code>clocks</code> — not listed as required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-c7438d9082840936a9a7"><code>1</code></span>

<div id="dt-853257adf43f6880d753">
<p style="white-space: pre-wrap">Optional external clock connected to the CLK pin.</p>
</div>

<a id="dt-041d7cd76b652a5de06a"></a>

### <code>clock&#45;names</code> — not listed as required here

**Deprecated (<code>deprecated</code>):** <span id="dt-097f337b0ba1a3020e40"><code>true</code></span>

<div id="dt-d153c20aa0faf1618c41">
<p style="white-space: pre-wrap">MCLK is an internal counter in the ADC. Do not use this property.</p>
</div>

<a id="dt-3d1de59bdfddccf00eed"></a>

#### Array item rules (<code>items</code>)

<a id="dt-b779484bf9e022991fd6"></a>

**Item 1**

> **Exact value (<code>const</code>):** <span id="dt-3403d68873725c15739a"><code>&#34;mclk&#34;</code></span>

<a id="dt-7471877b51a93881192b"></a>

### <code>&#35;clock&#45;cells</code> — not listed as required here

<div id="dt-6709a835409866cbd3af">
<p style="white-space: pre-wrap">The CLK pin can be used as an output. When that is the case, include this property.</p>
</div>

**Exact value (<code>const</code>):** <span id="dt-0eebe37dd30ae3dd2a72"><code>0</code></span>

<a id="dt-c2de09e7f7fd211b679d"></a>

### <code>interrupts</code> — required here

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">IRQ line for the ADC</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b7823fb65b2f27642d26"><code>1</code></span>

<a id="dt-0ea5d2d0b1cce91e5db8"></a>

### <code>rdy&#45;gpios</code> — not listed as required here

<div id="dt-295a48021a1bd8398484">
<p style="white-space: pre-wrap">GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its DOUT aka MISO role) and so usually triggers a spurious interrupt. The distinction between such a spurious event and a real one can only be done by reading such a GPIO. (There is a register telling the same information, but accessing that one needs a SPI transfer which then triggers another interrupt event.)</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-61e1f1a3fc0ad0a9f460"><code>1</code></span>

<a id="dt-2efe70314a961a652abe"></a>

### <code>&#35;address&#45;cells</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-e6e6af09ab617572731b"><code>1</code></span>

<a id="dt-ee0e5bf71366d312f1dc"></a>

### <code>&#35;size&#45;cells</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-793e842f88ef513a8f93"><code>0</code></span>

<a id="dt-b34e63e3a773c2ea1e59"></a>

### <code>refin1&#45;supply</code> — not listed as required here

<div id="dt-499f7e33edebd49929e8">
<p style="white-space: pre-wrap">refin1 supply can be used as reference for conversion.</p>
</div>

<a id="dt-8c53fd8590d8b72773d4"></a>

### <code>refin2&#45;supply</code> — not listed as required here

<div id="dt-c3197e92f941eba40d86">
<p style="white-space: pre-wrap">refin2 supply can be used as reference for conversion.</p>
</div>

<a id="dt-14397a69ba55f41119c5"></a>

### <code>avdd&#45;supply</code> — not listed as required here

<div id="dt-c928412db05126ef65e3">
<p style="white-space: pre-wrap">avdd supply can be used as reference for conversion.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;reg&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;interrupts&#34;</code></span>

<a id="dt-1da6abea48a862a4fc31"></a>

## This rule must not match (<code>not</code>)

> **Required in this object (<code>required</code>):** <a id="dt-9fad73862614d75a0904"></a> <span id="dt-c7f46e8c9dbe0db0ba60"><code>&#34;&#35;clock&#45;cells&#34;</code></span>, <span id="dt-64be1b44c74dbf16522b"><code>&#34;clocks&#34;</code></span>

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-9b3d992570bfa2dab57e"></a>

### <code>&#94;channel&#64;&#40;&#91;0&#45;9&#93;&#124;1&#91;0&#45;5&#93;&#41;&#36;</code> — name matches this regular expression

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-be0cefbc0c886a4aae58">[<code>adc&#46;yaml</code>](</kernel/hardware/devicetree-bindings/dt-iio/adc/adc.md#dt-root>)</span>

**Value type (<code>type</code>):** <span id="dt-a30551ac55636d35b7f2"><code>&#34;object&#34;</code></span>

<div id="dt-15c0553c9de06ff9d278">
<p style="white-space: pre-wrap">Represents the external channels which are connected to the ADC.</p>
</div>

<a id="dt-20b45ab7f50bd1a96215"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-e5ed1c0adb30bbaafe18"></a>

**<code>reg</code> — required here**

<div id="dt-8bb8d24a83365aaef566">
<p style="white-space: pre-wrap">The channel number. It can have up to 8 channels on ad7124-4
and 16 channels on ad7124-8, numbered from 0 to 15.</p>
</div>

<a id="dt-60677d78d8e1ba388939"></a>

**Array item rules (<code>items</code>)**

> **Minimum value (<code>minimum</code>):** <span id="dt-1ab131a4f09f4076120a"><code>0</code></span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-1496a8db42aa5b072ef9"><code>15</code></span>

<a id="dt-c2b069d9b2e9ed92b76d"></a>

**<code>adi&#44;reference&#45;select</code> — not listed as required here**

<div id="dt-04b92463bbb10fd4a413">
<p style="white-space: pre-wrap">Select the reference source to use when converting on
the specific channel. Valid values are:
0: REFIN1(+)/REFIN1(−).
1: REFIN2(+)/REFIN2(−).
3: AVDD
If this field is left empty, internal reference is selected.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-b8a267477bf975cd6133">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Allowed values (<code>enum</code>):** <a id="dt-5176060340dcdb8acc50"></a> <span id="dt-cb473a90b048dc313dd2"><code>0</code></span>, <span id="dt-4ff8350bdd65c380c9b0"><code>1</code></span>, <span id="dt-9d7bfa6e02bf3c855957"><code>3</code></span>

<a id="dt-82cd6b8329b20cfe39ff"></a>

**<code>diff&#45;channels</code> — required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-43adb7d3fe668414527b"></a>

**<code>bipolar</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-77a0cdd205b4d18d7c7d"></a>

**<code>adi&#44;buffered&#45;positive</code> — not listed as required here**

<div id="dt-1f27fd2af7a8b181801c">
<p style="white-space: pre-wrap">Enable buffered mode for positive input.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-7c2c0f5481a3f69c39f1"><code>&#34;boolean&#34;</code></span>

<a id="dt-99490a302cede0c4b914"></a>

**<code>adi&#44;buffered&#45;negative</code> — not listed as required here**

<div id="dt-8008406f1e180ce03953">
<p style="white-space: pre-wrap">Enable buffered mode for negative input.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-2b4a6c24c95c77c94ea9"><code>&#34;boolean&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-dea278d5fb5254c3f1ca"></a> <span id="dt-b186d2154f49611f8132"><code>&#34;reg&#34;</code></span>, <span id="dt-7b45d93a16862458e017"><code>&#34;diff&#45;channels&#34;</code></span>

<a id="dt-570a3ff75ff57c6791cb"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

<a id="dt-d33de94ac1d3652cd22a"></a>

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>&#47;schemas&#47;spi&#47;spi&#45;peripheral&#45;props&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-spi/spi-peripheral-props.md#dt-root>)</span>

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;
spi {
  #address-cells = &lt;1&gt;;
  #size-cells = &lt;0&gt;;

  adc@0 {
    compatible = "adi,ad7124-4";
    reg = &lt;0&gt;;
    spi-max-frequency = &lt;5000000&gt;;
    interrupts = &lt;25 2&gt;;
    interrupt-parent = &lt;&amp;gpio&gt;;
    rdy-gpios = &lt;&amp;gpio 25 GPIO_ACTIVE_LOW&gt;;
    refin1-supply = &lt;&amp;adc_vref&gt;;

    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    channel@0 {
      reg = &lt;0&gt;;
      diff-channels = &lt;0 1&gt;;
      adi,reference-select = &lt;0&gt;;
      adi,buffered-positive;
    };

    channel@1 {
      reg = &lt;1&gt;;
      bipolar;
      diff-channels = &lt;2 3&gt;;
      adi,reference-select = &lt;0&gt;;
      adi,buffered-positive;
      adi,buffered-negative;
    };

    channel@2 {
      reg = &lt;2&gt;;
      diff-channels = &lt;4 5&gt;;
    };

    channel@3 {
      reg = &lt;3&gt;;
      diff-channels = &lt;6 7&gt;;
    };
  };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)</span></p>

<p id="dt-comment-1"><strong>Line 2:</strong> <span> Copyright 2019 Analog Devices Inc.</span></p>

<p id="dt-comment-2"><strong>Line 81:</strong> <span> Can't have both clock input and output at the same time.</span></p>

</details>
