Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: thermal: Convert generic-adc-thermal to DT schema

Convert the 'generic-adc-thermal' binding to DT schema format.

The binding said '#thermal-sensor-cells' should be 1, but all in tree
users are 0 and 1 doesn't make sense for a single channel.

Drop the example's related providers and consumers of the
'generic-adc-thermal' node as the convention is to not have those in
the examples.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221011175235.3191509-1-robh@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Rob Herring and committed by
Daniel Lezcano
87f9fe8c d37edc73

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