# Qualcomm's PM8xxx voltage XOADC

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

> Device-tree binding reference for Qualcomm's PM8xxx voltage XOADC.

<!-- 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;qcom&#44;pm8018&#45;adc&#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;Linus Walleij &#60;linusw&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921.</p>
</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;qcom&#44;pm8018&#45;adc&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;qcom&#44;pm8038&#45;adc&#34;</code></span>, <span id="dt-88ff8a31b3bd20d1ddec"><code>&#34;qcom&#44;pm8058&#45;adc&#34;</code></span>, <span id="dt-76b67e65b51f033b1109"><code>&#34;qcom&#44;pm8921&#45;adc&#34;</code></span>

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

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

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">ADC base address in the PMIC, typically 0x197.</p>
</div>

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

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

<div id="dt-5e64170f140a4fceb1e5">
<p style="white-space: pre-wrap">The reference voltage may vary with PMIC variant but is typically something like 2.2 or 1.8V.</p>
</div>

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

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

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

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

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

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

<div id="dt-56d7bd958afc920979c6">
<p style="white-space: pre-wrap">The first cell is the prescaler (on PM8058) or premux (on PM8921) with two valid bits  so legal values are 0x00, 0x01 or 0x02. The second cell is the main analog mux setting (0x00..0x0f). The combination of prescaler/premux and analog mux uniquely addresses a hardware channel on all systems.</p>
</div>

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

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

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

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

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

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

<div id="dt-99ec207a6d110eacb63a">
<p style="white-space: pre-wrap">The cells are precaler or premux followed by the analog muxing line.</p>
</div>

<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.

**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;&#35;io&#45;channel&#45;cells&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;&#35;address&#45;cells&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;&#35;size&#45;cells&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;adc&#45;channel&#64;c&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;adc&#45;channel&#64;d&#34;</code></span>, <span id="dt-4503833a9b225761c43a"><code>&#34;adc&#45;channel&#64;f&#34;</code></span>

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

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

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

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

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

<div id="dt-3b936b8ac86ce57a679a">
<p style="white-space: pre-wrap">ADC channel specific configuration.
Note that channels c, d and f must be present for calibration.
These three nodes are used for absolute and ratiometric calibration
and only need to have these reg values: they are by hardware definition
1:1 ratio converters that sample 625, 1250 and 0 milliV and create
an interpolation calibration for all other ADCs.</p>
</div>

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

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

<a id="dt-6a51f564be115c065d17"></a>

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

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

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

**<code>qcom&#44;decimation</code> — not listed as required here**

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

<div id="dt-72443274bac33ea3c7d5">
<p style="white-space: pre-wrap">This parameter is used to decrease the ADC sampling rate.
Quicker measurements can be made by reducing the decimation ratio.
Valid values are 512, 1024, 2048, 4096.
If the property is not found, a default value of 512 will be used.</p>
</div>

<a id="dt-6faa97a22ded47a4611a"></a>

**<code>qcom&#44;ratiometric</code> — not listed as required here**

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

<div id="dt-d84dd2720b655871b15b">
<p style="white-space: pre-wrap">Channel calibration type. If this property is specified
VADC will use a special voltage references for channel
calibration. The available references are specified in the
as a u32 value setting (see below) and it is compulsory
to also specify this reference if ratiometric calibration
is selected.</p>
<p style="white-space: pre-wrap">If the property is not found, the channel will be
calibrated with the 0.625V and 1.25V reference channels, also
known as an absolute calibration.</p>
<p style="white-space: pre-wrap">The reference voltage pairs when using ratiometric calibration:
0 = XO_IN/XOADC_GND
1 = PMIC_IN/XOADC_GND
2 = PMIC_IN/BMS_CSP
3 (invalid)
4 = XOADC_GND/XOADC_GND
5 = XOADC_VREF/XOADC_GND</p>
</div>

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

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

<code>false</code>

Not allowed by this rule.

**Required in this object (<code>required</code>):** <a id="dt-44762fd8cf36418ccef5"></a> <span id="dt-666cd170eca210077761"><code>&#34;reg&#34;</code></span>

<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;
pmic {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    adc@197 {
        compatible = "qcom,pm8058-adc";
        reg = &lt;0x197&gt;;
        interrupts-extended = &lt;&amp;pm8058 76 IRQ_TYPE_EDGE_RISING&gt;;
        #address-cells = &lt;2&gt;;
        #size-cells = &lt;0&gt;;
        #io-channel-cells = &lt;2&gt;;

        vcoin: adc-channel@0 {
            reg = &lt;0x00 0x00&gt;;
        };
        vbat: adc-channel@1 {
            reg = &lt;0x00 0x01&gt;;
        };
        dcin: adc-channel@2 {
            reg = &lt;0x00 0x02&gt;;
        };
        ichg: adc-channel@3 {
            reg = &lt;0x00 0x03&gt;;
        };
        vph_pwr: adc-channel@4 {
            reg = &lt;0x00 0x04&gt;;
        };
        usb_vbus: adc-channel@a {
            reg = &lt;0x00 0x0a&gt;;
        };
        die_temp: adc-channel@b {
            reg = &lt;0x00 0x0b&gt;;
        };
        ref_625mv: adc-channel@c {
            reg = &lt;0x00 0x0c&gt;;
        };
        ref_1250mv: adc-channel@d {
            reg = &lt;0x00 0x0d&gt;;
        };
        ref_325mv: adc-channel@e {
            reg = &lt;0x00 0x0e&gt;;
        };
        ref_muxoff: adc-channel@f {
            reg = &lt;0x00 0x0f&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>

</details>
