1*4882a593SmuzhiyunGeneral Purpose Analog To Digital Converter (ADC) based thermal sensor. 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunOn some of platforms, thermal sensor like thermistors are connected to 4*4882a593Smuzhiyunone of ADC channel and sensor resistance is read via voltage across the 5*4882a593Smuzhiyunsensor resistor. The voltage read across the sensor is mapped to 6*4882a593Smuzhiyuntemperature using voltage-temperature lookup table. 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunRequired properties: 9*4882a593Smuzhiyun=================== 10*4882a593Smuzhiyun- compatible: Must be "generic-adc-thermal". 11*4882a593Smuzhiyun- #thermal-sensor-cells: Should be 1. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description 12*4882a593Smuzhiyun of this property. 13*4882a593SmuzhiyunOptional properties: 14*4882a593Smuzhiyun=================== 15*4882a593Smuzhiyun- temperature-lookup-table: Two dimensional array of Integer; lookup table 16*4882a593Smuzhiyun to map the relation between ADC value and 17*4882a593Smuzhiyun temperature. When ADC is read, the value is 18*4882a593Smuzhiyun looked up on the table to get the equivalent 19*4882a593Smuzhiyun temperature. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun The first value of the each row of array is the 22*4882a593Smuzhiyun temperature in milliCelsius and second value of 23*4882a593Smuzhiyun the each row of array is the ADC read value. 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun If not specified, driver assumes the ADC channel 26*4882a593Smuzhiyun gives milliCelsius directly. 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunExample : 29*4882a593Smuzhiyun#include <dt-bindings/thermal/thermal.h> 30*4882a593Smuzhiyun 31*4882a593Smuzhiyuni2c@7000c400 { 32*4882a593Smuzhiyun ads1015: ads1015@4a { 33*4882a593Smuzhiyun reg = <0x4a>; 34*4882a593Smuzhiyun compatible = "ads1015"; 35*4882a593Smuzhiyun sampling-frequency = <3300>; 36*4882a593Smuzhiyun #io-channel-cells = <1>; 37*4882a593Smuzhiyun }; 38*4882a593Smuzhiyun}; 39*4882a593Smuzhiyun 40*4882a593Smuzhiyuntboard_thermistor: thermal-sensor { 41*4882a593Smuzhiyun compatible = "generic-adc-thermal"; 42*4882a593Smuzhiyun #thermal-sensor-cells = <0>; 43*4882a593Smuzhiyun io-channels = <&ads1015 1>; 44*4882a593Smuzhiyun io-channel-names = "sensor-channel"; 45*4882a593Smuzhiyun temperature-lookup-table = < (-40000) 2578 46*4882a593Smuzhiyun (-39000) 2577 47*4882a593Smuzhiyun (-38000) 2576 48*4882a593Smuzhiyun (-37000) 2575 49*4882a593Smuzhiyun (-36000) 2574 50*4882a593Smuzhiyun (-35000) 2573 51*4882a593Smuzhiyun (-34000) 2572 52*4882a593Smuzhiyun (-33000) 2571 53*4882a593Smuzhiyun (-32000) 2569 54*4882a593Smuzhiyun (-31000) 2568 55*4882a593Smuzhiyun (-30000) 2567 56*4882a593Smuzhiyun :::::::::: 57*4882a593Smuzhiyun 118000 254 58*4882a593Smuzhiyun 119000 247 59*4882a593Smuzhiyun 120000 240 60*4882a593Smuzhiyun 121000 233 61*4882a593Smuzhiyun 122000 226 62*4882a593Smuzhiyun 123000 220 63*4882a593Smuzhiyun 124000 214 64*4882a593Smuzhiyun 125000 208>; 65*4882a593Smuzhiyun}; 66*4882a593Smuzhiyun 67*4882a593Smuzhiyundummy_cool_dev: dummy-cool-dev { 68*4882a593Smuzhiyun compatible = "dummy-cooling-dev"; 69*4882a593Smuzhiyun #cooling-cells = <2>; /* min followed by max */ 70*4882a593Smuzhiyun}; 71*4882a593Smuzhiyun 72*4882a593Smuzhiyunthermal-zones { 73*4882a593Smuzhiyun Tboard { 74*4882a593Smuzhiyun polling-delay = <15000>; /* milliseconds */ 75*4882a593Smuzhiyun polling-delay-passive = <0>; /* milliseconds */ 76*4882a593Smuzhiyun thermal-sensors = <&tboard_thermistor>; 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun trips { 79*4882a593Smuzhiyun therm_est_trip: therm_est_trip { 80*4882a593Smuzhiyun temperature = <40000>; 81*4882a593Smuzhiyun type = "active"; 82*4882a593Smuzhiyun hysteresis = <1000>; 83*4882a593Smuzhiyun }; 84*4882a593Smuzhiyun }; 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun cooling-maps { 87*4882a593Smuzhiyun map0 { 88*4882a593Smuzhiyun trip = <&therm_est_trip>; 89*4882a593Smuzhiyun cooling-device = <&dummy_cool_dev THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 90*4882a593Smuzhiyun contribution = <100>; 91*4882a593Smuzhiyun }; 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun }; 94*4882a593Smuzhiyun }; 95*4882a593Smuzhiyun}; 96