xref: /linux/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml (revision 906fd46a65383cd639e5eec72a047efc33045d86)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: General Purpose Analog To Digital Converter (ADC) based thermal sensor
8
9maintainers:
10  - Laxman Dewangan <ldewangan@nvidia.com>
11
12description:
13  On some of platforms, thermal sensor like thermistors are connected to
14  one of ADC channel and sensor resistance is read via voltage across the
15  sensor resistor. The voltage read across the sensor is mapped to
16  temperature using voltage-temperature lookup table.
17
18properties:
19  compatible:
20    const: generic-adc-thermal
21
22  '#thermal-sensor-cells':
23    const: 0
24
25  io-channels:
26    maxItems: 1
27
28  io-channel-names:
29    const: sensor-channel
30
31  temperature-lookup-table:
32    description: |
33      Lookup table to map the relation between ADC value and temperature.
34      When ADC is read, the value is looked up on the table to get the
35      equivalent temperature.
36
37      If not specified, driver assumes the ADC channel gives milliCelsius
38      directly.
39    $ref: /schemas/types.yaml#/definitions/int32-matrix
40    items:
41      items:
42        - description: Temperature in milliCelsius
43        - description: ADC read value
44
45required:
46  - compatible
47  - '#thermal-sensor-cells'
48  - io-channels
49  - io-channel-names
50
51additionalProperties: false
52
53examples:
54  - |
55    #include <dt-bindings/thermal/thermal.h>
56
57    thermal-sensor {
58        compatible = "generic-adc-thermal";
59        #thermal-sensor-cells = <0>;
60        io-channels = <&ads1015 1>;
61        io-channel-names = "sensor-channel";
62        temperature-lookup-table = <
63              (-40000) 2578
64              (-39000) 2577
65              (-38000) 2576
66              (-37000) 2575
67              (-36000) 2574
68              (-35000) 2573
69              (-34000) 2572
70              (-33000) 2571
71              (-32000) 2569
72              (-31000) 2568
73              (-30000) 2567
74              /* skip */
75              118000 254
76              119000 247
77              120000 240
78              121000 233
79              122000 226
80              123000 220
81              124000 214
82              125000 208>;
83    };
84...
85