# Voltage divider

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

> Device-tree binding reference for Voltage divider.

<!-- 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;afe&#47;voltage&#45;divider&#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;Peter Rosin &#60;peda&#64;axentia&#46;se&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">When an io-channel measures the midpoint of a voltage divider, the
interesting voltage is often the voltage over the full resistance
of the divider. This binding describes the voltage divider in such
a circuit.</p>
<pre><code>  Vin ----.
          |
       .-----.
       |  R  |
       '-----'
          |
          +---- Vout
          |
       .-----.
       | Rout|
       '-----'
          |
         GND</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

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;voltage&#45;divider&#34;</code></span>

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

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

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

<div id="dt-00f0389e57ab952e1ac1">
<p style="white-space: pre-wrap">Channel node of a voltage io-channel.</p>
</div>

<a id="dt-6971e222e0082656e9f5"></a>

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

<div id="dt-99ec207a6d110eacb63a">
<p style="white-space: pre-wrap">In addition to consuming the measurement services of a voltage output channel, the voltage divider can act as a provider of measurement services to other devices. This is particularly useful in scenarios wherein an ADC has an analog frontend, such as a voltage divider, and then consuming its raw value isn't interesting. In this case, the voltage before the divider is desired.</p>
</div>

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

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

### <code>output&#45;ohms</code> — required here

<div id="dt-9e3e136fb3039ddf5db0">
<p style="white-space: pre-wrap">Resistance Rout over which the output voltage is measured. See full-ohms.</p>
</div>

<a id="dt-6538e1439f97795842ce"></a>

### <code>full&#45;ohms</code> — required here

<div id="dt-15e2b9a6e5268269f601">
<p style="white-space: pre-wrap">Resistance R + Rout for the full divider. The io-channel is scaled by the Rout / (R + Rout) quotient.</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;io&#45;channels&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;output&#45;ohms&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;full&#45;ohms&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></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-1a130cabaa8a47b058bf"></a>

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

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/irq.h&gt;
/*
 * The system voltage is circa 12V, but divided down with a 22/222
 * voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC.
 */
spi {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;
    maxadc: adc@0 {
        compatible = "maxim,max1027";
        reg = &lt;0&gt;;
        #io-channel-cells = &lt;1&gt;;
        interrupt-parent = &lt;&amp;gpio5&gt;;
        interrupts = &lt;15 IRQ_TYPE_EDGE_RISING&gt;;
        spi-max-frequency = &lt;1000000&gt;;
    };
};
sysv {
    compatible = "voltage-divider";
    io-channels = &lt;&amp;maxadc 1&gt;;

    /* Scale the system voltage by 22/222 to fit the ADC range. */
    output-ohms = &lt;22&gt;;
    full-ohms = &lt;222&gt;; /* 200 + 22 */
};
</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>

</details>
