generic-adc-thermal.yaml 2.2 KB

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