18bab661aSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 28bab661aSEmmanuel Vadot%YAML 1.2 38bab661aSEmmanuel Vadot--- 48bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml# 58bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 68bab661aSEmmanuel Vadot 78bab661aSEmmanuel Vadottitle: General Purpose Analog To Digital Converter (ADC) based thermal sensor 88bab661aSEmmanuel Vadot 98bab661aSEmmanuel Vadotmaintainers: 108bab661aSEmmanuel Vadot - Laxman Dewangan <ldewangan@nvidia.com> 118bab661aSEmmanuel Vadot 128bab661aSEmmanuel Vadotdescription: 138bab661aSEmmanuel Vadot On some of platforms, thermal sensor like thermistors are connected to 148bab661aSEmmanuel Vadot one of ADC channel and sensor resistance is read via voltage across the 158bab661aSEmmanuel Vadot sensor resistor. The voltage read across the sensor is mapped to 168bab661aSEmmanuel Vadot temperature using voltage-temperature lookup table. 178bab661aSEmmanuel Vadot 18*0e8011faSEmmanuel Vadot$ref: thermal-sensor.yaml# 19*0e8011faSEmmanuel Vadot 208bab661aSEmmanuel Vadotproperties: 218bab661aSEmmanuel Vadot compatible: 228bab661aSEmmanuel Vadot const: generic-adc-thermal 238bab661aSEmmanuel Vadot 248bab661aSEmmanuel Vadot '#thermal-sensor-cells': 258bab661aSEmmanuel Vadot const: 0 268bab661aSEmmanuel Vadot 278bab661aSEmmanuel Vadot io-channels: 288bab661aSEmmanuel Vadot maxItems: 1 298bab661aSEmmanuel Vadot 308bab661aSEmmanuel Vadot io-channel-names: 318bab661aSEmmanuel Vadot const: sensor-channel 328bab661aSEmmanuel Vadot 338bab661aSEmmanuel Vadot temperature-lookup-table: 348bab661aSEmmanuel Vadot description: | 358bab661aSEmmanuel Vadot Lookup table to map the relation between ADC value and temperature. 368bab661aSEmmanuel Vadot When ADC is read, the value is looked up on the table to get the 378bab661aSEmmanuel Vadot equivalent temperature. 388bab661aSEmmanuel Vadot 398bab661aSEmmanuel Vadot If not specified, driver assumes the ADC channel gives milliCelsius 408bab661aSEmmanuel Vadot directly. 418bab661aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/int32-matrix 428bab661aSEmmanuel Vadot items: 438bab661aSEmmanuel Vadot items: 448bab661aSEmmanuel Vadot - description: Temperature in milliCelsius 458bab661aSEmmanuel Vadot - description: ADC read value 468bab661aSEmmanuel Vadot 478bab661aSEmmanuel Vadotrequired: 488bab661aSEmmanuel Vadot - compatible 498bab661aSEmmanuel Vadot - io-channels 508bab661aSEmmanuel Vadot - io-channel-names 518bab661aSEmmanuel Vadot 52*0e8011faSEmmanuel VadotunevaluatedProperties: false 538bab661aSEmmanuel Vadot 548bab661aSEmmanuel Vadotexamples: 558bab661aSEmmanuel Vadot - | 568bab661aSEmmanuel Vadot #include <dt-bindings/thermal/thermal.h> 578bab661aSEmmanuel Vadot 588bab661aSEmmanuel Vadot thermal-sensor { 598bab661aSEmmanuel Vadot compatible = "generic-adc-thermal"; 608bab661aSEmmanuel Vadot #thermal-sensor-cells = <0>; 618bab661aSEmmanuel Vadot io-channels = <&ads1015 1>; 628bab661aSEmmanuel Vadot io-channel-names = "sensor-channel"; 638bab661aSEmmanuel Vadot temperature-lookup-table = < 648bab661aSEmmanuel Vadot (-40000) 2578 658bab661aSEmmanuel Vadot (-39000) 2577 668bab661aSEmmanuel Vadot (-38000) 2576 678bab661aSEmmanuel Vadot (-37000) 2575 688bab661aSEmmanuel Vadot (-36000) 2574 698bab661aSEmmanuel Vadot (-35000) 2573 708bab661aSEmmanuel Vadot (-34000) 2572 718bab661aSEmmanuel Vadot (-33000) 2571 728bab661aSEmmanuel Vadot (-32000) 2569 738bab661aSEmmanuel Vadot (-31000) 2568 748bab661aSEmmanuel Vadot (-30000) 2567 758bab661aSEmmanuel Vadot /* skip */ 768bab661aSEmmanuel Vadot 118000 254 778bab661aSEmmanuel Vadot 119000 247 788bab661aSEmmanuel Vadot 120000 240 798bab661aSEmmanuel Vadot 121000 233 808bab661aSEmmanuel Vadot 122000 226 818bab661aSEmmanuel Vadot 123000 220 828bab661aSEmmanuel Vadot 124000 214 838bab661aSEmmanuel Vadot 125000 208>; 848bab661aSEmmanuel Vadot }; 858bab661aSEmmanuel Vadot... 86