# ADC battery

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Power bindings / supply_

> Device-tree binding reference for ADC battery.

<!-- SPDX-License-Identifier: (GPL-2.0-only 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;power&#47;supply&#47;adc&#45;battery&#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;Sebastian Reichel &#60;sre&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Basic battery capacity meter, which only reports basic battery data via ADC channels and optionally indicate that the battery is full by polling a GPIO line.
The voltage is expected to be measured between the battery terminals and mandatory. The optional current/power channel is expected to monitor the current/power flowing out of the battery. Last but not least the temperature channel is supposed to measure the battery temperature.</p>
</div>

<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>power&#45;supply&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-power/supply/power-supply.md#dt-root>)</span>

<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;adc&#45;battery&#34;</code></span>

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

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

<div id="dt-73d7b3164b421b1c705a">
<p style="white-space: pre-wrap">GPIO which signals that the battery is fully charged. The GPIO is often provided by charger ICs, that are not software controllable.</p>
</div>

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

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

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-0350e4fe024bda6fb981"><code>1</code></span>

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

<a id="dt-52503acc5d03431d5405"></a>

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-a53aa242d05c553f066c"><code>1</code></span>

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

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

<a id="dt-55a5fdf011bea14cc16c"></a>

**Item 1**

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

<a id="dt-049f32fdf9d22ec0b83a"></a>

**Item 2**

> **Allowed values (<code>enum</code>):** <a id="dt-1678abfa659f3bcebe01"></a> <span id="dt-5acffd4131e314cb496e"><code>&#34;current&#34;</code></span>, <span id="dt-9fb192d10a5a769a95fc"><code>&#34;power&#34;</code></span>, <span id="dt-2d7a9dd594907d13fabd"><code>&#34;temperature&#34;</code></span>

<a id="dt-375e1fd47db466dce48b"></a>

**Item 3**

> **Allowed values (<code>enum</code>):** <a id="dt-3876698ba34405ca21bb"></a> <span id="dt-972831f65a0a0cf4e55b"><code>&#34;power&#34;</code></span>, <span id="dt-fb14c82e1f5991381d94"><code>&#34;temperature&#34;</code></span>

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

**Item 4**

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

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

### <code>monitored&#45;battery</code> — required here

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

**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;io&#45;channel&#45;names&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;monitored&#45;battery&#34;</code></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;

fuel-gauge {
    compatible = "adc-battery";
    charged-gpios = &lt;&amp;gpio 42 GPIO_ACTIVE_HIGH&gt;;
    io-channels = &lt;&amp;adc 13&gt;, &lt;&amp;adc 37&gt;;
    io-channel-names = "voltage", "current";

    power-supplies = &lt;&amp;charger&gt;;
    monitored-battery = &lt;&amp;battery&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-only OR BSD-2-Clause)</span></p>

</details>
