# Qualcomm's SPMI PMIC ADC Thermal Monitoring

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Thermal bindings_

> Device-tree binding reference for Qualcomm's SPMI PMIC ADC Thermal Monitoring.

<!-- 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;thermal&#47;qcom&#45;spmi&#45;adc&#45;tm5&#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;Dmitry Baryshkov &#60;dmitry&#46;baryshkov&#64;linaro&#46;org&#62;&#34;</code></span>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d5c57c22d966a033492b">[<code>thermal&#45;sensor&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-thermal/thermal-sensor.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

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;qcom&#44;spmi&#45;adc&#45;tm5&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;qcom&#44;spmi&#45;adc&#45;tm5&#45;gen2&#34;</code></span>, <span id="dt-88ff8a31b3bd20d1ddec"><code>&#34;qcom&#44;adc&#45;tm7&#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>

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

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

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

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

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

**Exact value (<code>const</code>):** <span id="dt-864271cb6a9393891ea2"><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>1</code></span>

<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-3390736a1baec95b1395"></a>

### <code>qcom&#44;avg&#45;samples</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d4cbf1bc51bde5bdd5b6">[<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-a4213079616df7c2acf8">
<p style="white-space: pre-wrap">Number of samples to be used for measurement. Not applicable for Gen2 ADC_TM peripheral.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-bea5551e0f20fa72c173"></a> <span id="dt-53f1d46b4266f00ad3cb"><code>1</code></span>, <span id="dt-540585d246eb2c1b9358"><code>2</code></span>, <span id="dt-cb4c327488b35edb0959"><code>4</code></span>, <span id="dt-b54425d5e91790a34598"><code>8</code></span>, <span id="dt-a6b26c5051c1cb30e7ef"><code>16</code></span>

**Default value (<code>default</code>):** <span id="dt-6b0a351a3e343e3d57e9"><code>1</code></span>

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

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-24086233832749472270">[<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-78eeb39f4e4d8abea8c4">
<p style="white-space: pre-wrap">This parameter is used to decrease ADC sampling rate. Quicker measurements can be made by reducing decimation ratio. Not applicable for Gen2 ADC_TM peripheral.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-03e9816fdd152125121b"></a> <span id="dt-b1ff2cba6d71c085d133"><code>250</code></span>, <span id="dt-4ef149def645828e8dc6"><code>420</code></span>, <span id="dt-c96099df1e92a26e42bb"><code>840</code></span>

**Default value (<code>default</code>):** <span id="dt-445fd5744c9cbffd8d3c"><code>840</code></span>

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

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

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

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

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

<div id="dt-ccc4611ec17fff0c4c97">
<p style="white-space: pre-wrap">Represent one thermal sensor.</p>
</div>

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

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

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

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

<div id="dt-668081bfdb8783140be5">
<p style="white-space: pre-wrap">Specify the sensor channel. There are 8 channels in PMIC5's ADC TM</p>
</div>

**Minimum value (<code>minimum</code>):** <span id="dt-fae8c55b438ce11d7713"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-58a6d607658c937d784b"><code>7</code></span>

<a id="dt-7598caf96a36f9a1bb6c"></a>

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

<div id="dt-6f42091e3643bf5d4cb6">
<p style="white-space: pre-wrap">From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor</p>
</div>

<a id="dt-13ef1d33022a022f486c"></a>

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

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

<div id="dt-258b28f7f5ce7aacf28d">
<p style="white-space: pre-wrap">Channel calibration type. If this property is specified VADC will use the VDD reference (1.875V) and GND for channel calibration. If property is not found, channel will be calibrated with 0V and 1.25V reference channels, also known as absolute calibration.</p>
</div>

<a id="dt-52d6f18b5ae643ffe5da"></a>

**<code>qcom&#44;hw&#45;settle&#45;time&#45;us</code> — not listed as required here**

<div id="dt-625fd33908d23a22ba91">
<p style="white-space: pre-wrap">Time between AMUX getting configured and the ADC starting conversion.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-9bda9bb36eb6cd6e1580"></a> <span id="dt-bc88ee71f9b70aff9033"><code>15</code></span>, <span id="dt-4888de55e889540593d3"><code>100</code></span>, <span id="dt-c85a631324a017a692f8"><code>200</code></span>, <span id="dt-4c7e9a70ca2979a33e79"><code>300</code></span>, <span id="dt-330971ce4e44d783484a"><code>400</code></span>, <span id="dt-e2a7ef2d4a1add275fa0"><code>500</code></span>, <span id="dt-aed34a731a1d9c5dd182"><code>600</code></span>, <span id="dt-8bb5f76233879ef2450a"><code>700</code></span>, <span id="dt-9ae77bccb738feb6c6fa"><code>1000</code></span>, <span id="dt-fd54c0307ab8f277c0bd"><code>2000</code></span>, <span id="dt-a2cb6e517993447e9335"><code>4000</code></span>, <span id="dt-0b62f8ee841c19ac7a7b"><code>8000</code></span>, <span id="dt-47546f1b6dd78fffc195"><code>16000</code></span>, <span id="dt-9b2c3232b72fe6b9bc1c"><code>32000</code></span>, <span id="dt-8b25cb331d791b76d8b6"><code>64000</code></span>, <span id="dt-349aed75f7e6242d587a"><code>128000</code></span>

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

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

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

<div id="dt-7c5434b844fbd55c9dec">
<p style="white-space: pre-wrap">Used for scaling the channel input signal before the signal is fed to VADC. The configuration for this node is to know the pre-determined ratio and use it for post scaling. It is a pair of integers, denoting the numerator and denominator of the fraction by which input signal is multiplied. For example, &lt;1 3&gt; indicates the signal is scaled down to 1/3 of its value before ADC measurement.  If property is not found default value depending on chip will be used.</p>
</div>

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

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

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

**Item 1**

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

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

**Item 2**

> **Allowed values (<code>enum</code>):** <a id="dt-fcffed6f5fbf77997c62"></a> <span id="dt-77e9fb018a260b92a87d"><code>1</code></span>, <span id="dt-bfad84d3b4209fa24742"><code>3</code></span>, <span id="dt-ba82ad26a8521b2244dc"><code>4</code></span>, <span id="dt-37b0d177b252dfe656db"><code>6</code></span>, <span id="dt-c3177f84b008811b0278"><code>20</code></span>, <span id="dt-0adcd283310442f2db32"><code>8</code></span>, <span id="dt-5ef2549be6f84bdc5bb1"><code>10</code></span>

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

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-29fc53756a91111cee1f">[<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-68ba2b9090fc990c99a1">
<p style="white-space: pre-wrap">Number of samples to be used for measurement. This property in child node is applicable only for Gen2 ADC_TM peripheral.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-bea79772037133d27cf6"></a> <span id="dt-8e9c4b98b26ecd5d2699"><code>1</code></span>, <span id="dt-9cb6d71a41f1d933c15a"><code>2</code></span>, <span id="dt-e33a0ed4963933b85958"><code>4</code></span>, <span id="dt-bc6ae53ffe6cec111b74"><code>8</code></span>, <span id="dt-095e123220abfad40387"><code>16</code></span>

**Default value (<code>default</code>):** <span id="dt-12a374433f9ed3c36308"><code>1</code></span>

<a id="dt-92305821d1270fe1a7b3"></a>

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d44bd255133d72c904fa">[<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-b2e324cea1b66233c934">
<p style="white-space: pre-wrap">This parameter is used to decrease ADC sampling rate. Quicker measurements can be made by reducing decimation ratio. This property in child node is applicable only for Gen2 ADC_TM peripheral.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-1889031d4dc3c53455f4"></a> <span id="dt-bb03be71973ef4e6f688"><code>85</code></span>, <span id="dt-a4700a377372bf93c2ed"><code>340</code></span>, <span id="dt-7a2edb10aef9c2e25a8a"><code>1360</code></span>

**Default value (<code>default</code>):** <span id="dt-a038728c5b4094a77a01"><code>1360</code></span>

**Required in this object (<code>required</code>):** <a id="dt-30722118f8732bc4db62"></a> <span id="dt-4e51a96cabe35184f062"><code>&#34;reg&#34;</code></span>, <span id="dt-b6fd9ec7b5984cfccfc4"><code>&#34;io&#45;channels&#34;</code></span>

<a id="dt-eeb8d3d2fef58812b640"></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

> <a id="dt-3bbb54dfa1f05dfb4d25"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-97f47e9dc804c839f86d"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-bbadeeb73dfaefabae79"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-ebe43a424f4497a78746"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Exact value (<code>const</code>):** <span id="dt-8997992e7087b5549d86"><code>&#34;qcom&#44;spmi&#45;adc&#45;tm5&#34;</code></span>
>
> <a id="dt-1ba25143802b75b74702"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-6a22a8f69a54bcbb7d12"></a>
> >
> > **Properties matching a name pattern (<code>patternProperties</code>)**
> >
> > <a id="dt-f8ff12c225184b72141c"></a>
> >
> > **<code>&#94;&#40;&#91;&#45;a&#45;z0&#45;9&#93;&#42;&#41;&#64;&#91;0&#45;7&#93;&#36;</code> — name matches this regular expression**
> >
> > <a id="dt-036af21452fe3bb0aa49"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-471aa5305534e84e3bf2"></a>
> >
> > **<code>qcom&#44;decimation</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-3bb62641a3fe4ff8a783"></a>
> >
> > **<code>qcom&#44;avg&#45;samples</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

<a id="dt-22ca5ec5b89308748ecc"></a>

### Rule 2

> <a id="dt-ffbf5afb799d5f07b3e1"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-05d9c37a1275e72a170e"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-e9866824361c1aee7933"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-d1402748b5f4caf0b18a"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Exact value (<code>const</code>):** <span id="dt-9b74ad9882646c4a5116"><code>&#34;qcom&#44;spmi&#45;adc&#45;tm5&#45;gen2&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-26d1c84fcc55a7d91dea"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-0f1ec0894e25f136f8b1"></a>
> >
> > **<code>qcom&#44;avg&#45;samples</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-4ce780a6ffbdf8a2f7f0"></a>
> >
> > **<code>qcom&#44;decimation</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted 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;reg&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;interrupts&#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>

<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/iio/qcom,spmi-vadc.h&gt;
#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

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

    pm8150b_adc: adc@3100 {
        compatible = "qcom,spmi-adc5";
        reg = &lt;0x3100&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
        #io-channel-cells = &lt;1&gt;;

        /* Other properties are omitted */
        channel@4f {
            reg = &lt;ADC5_AMUX_THM3_100K_PU&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time = &lt;200&gt;;
            label = "conn_therm";
        };
    };

    adc-tm@3500 {
        compatible = "qcom,spmi-adc-tm5";
        reg = &lt;0x3500&gt;;
        interrupts = &lt;0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING&gt;;
        #thermal-sensor-cells = &lt;1&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;

        conn-therm@0 {
            reg = &lt;0&gt;;
            io-channels = &lt;&amp;pm8150b_adc ADC5_AMUX_THM3_100K_PU&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time-us = &lt;200&gt;;
        };
    };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/iio/qcom,spmi-adc7-pmk8350.h&gt;
#include &lt;dt-bindings/iio/qcom,spmi-adc7-pm8350.h&gt;
#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

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

    pmk8350_vadc: adc@3100 {
        compatible = "qcom,spmi-adc7";
        reg = &lt;0x3100&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
        #io-channel-cells = &lt;1&gt;;

        /* Other properties are omitted */
        channel@44 {
            reg = &lt;PMK8350_ADC7_AMUX_THM1_100K_PU&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time = &lt;200&gt;;
            label = "xo_therm";
        };

        channel@147 {
            reg = &lt;PM8350_ADC7_AMUX_THM4_100K_PU(1)&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time = &lt;200&gt;;
            label = "conn_therm";
        };
    };

    adc-tm@3400 {
        compatible = "qcom,spmi-adc-tm5-gen2";
        reg = &lt;0x3400&gt;;
        interrupts = &lt;0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING&gt;;
        #thermal-sensor-cells = &lt;1&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;

        pmk8350-xo-therm@0 {
            reg = &lt;0&gt;;
            io-channels = &lt;&amp;pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU&gt;;
            qcom,decimation = &lt;340&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time-us = &lt;200&gt;;
        };

        conn-therm@1 {
            reg = &lt;1&gt;;
            io-channels = &lt;&amp;pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)&gt;;
            qcom,avg-samples = &lt;2&gt;;
            qcom,ratiometric;
            qcom,hw-settle-time-us = &lt;200&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 18:</strong> <span> Incomplete / subject to change</span></p>

</details>
