thermal-generic-adc.txt 2.2 KB

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