# General Purpose Analog To Digital Converter (ADC) based thermal sensor

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

> Device-tree binding reference for General Purpose Analog To Digital Converter (ADC) based thermal sensor.

<!-- 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;thermal&#47;generic&#45;adc&#45;thermal&#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;Laxman Dewangan &#60;ldewangan&#64;nvidia&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">On some of platforms, thermal sensor like thermistors are connected to one of ADC channel and sensor resistance is read via voltage across the sensor resistor. The voltage read across the sensor is mapped to temperature using voltage-temperature lookup table.</p>
</div>

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

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;generic&#45;adc&#45;thermal&#34;</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>0</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>

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

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

**Exact value (<code>const</code>):** <span id="dt-27bb6bb6712fac2e8172"><code>&#34;sensor&#45;channel&#34;</code></span>

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

### <code>temperature&#45;lookup&#45;table</code> — not listed as required here

<div id="dt-fd984730ce778bbdec23">
<p style="white-space: pre-wrap">Lookup table to map the relation between ADC value and temperature.
When ADC is read, the value is looked up on the table to get the
equivalent temperature.</p>
<p style="white-space: pre-wrap">If not specified, driver assumes the ADC channel gives milliCelsius
directly.</p>
</div>

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

<a id="dt-4082e5f61ef7be556060"></a>

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

> <a id="dt-76ac13f704df3191d915"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-b4434cf2482584908e4a"></a>
>
> **Item 1**
>
> > <div id="dt-2c85ae9a96c7a445a44b">
> > <p style="white-space: pre-wrap">Temperature in milliCelsius</p>
> > </div>
>
> <a id="dt-a38346bfdf3b2188469c"></a>
>
> **Item 2**
>
> > <div id="dt-4dd5bb8722701fe3e400">
> > <p style="white-space: pre-wrap">ADC read value</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;io&#45;channel&#45;names&#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/thermal/thermal.h&gt;

thermal-sensor {
    compatible = "generic-adc-thermal";
    #thermal-sensor-cells = &lt;0&gt;;
    io-channels = &lt;&amp;ads1015 1&gt;;
    io-channel-names = "sensor-channel";
    temperature-lookup-table = &lt;
          (-40000) 2578
          (-39000) 2577
          (-38000) 2576
          (-37000) 2575
          (-36000) 2574
          (-35000) 2573
          (-34000) 2572
          (-33000) 2571
          (-32000) 2569
          (-31000) 2568
          (-30000) 2567
          /* skip */
          118000 254
          119000 247
          120000 240
          121000 233
          122000 226
          123000 220
          124000 214
          125000 208&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>
