* [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema
@ 2022-10-11 17:52 Rob Herring
2022-10-11 18:46 ` Krzysztof Kozlowski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring @ 2022-10-11 17:52 UTC (permalink / raw
To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Krzysztof Kozlowski, Laxman Dewangan
Cc: linux-pm, devicetree, linux-kernel
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>
---
.../bindings/thermal/generic-adc-thermal.yaml | 84 ++++++++++++++++
.../bindings/thermal/thermal-generic-adc.txt | 95 -------------------
2 files changed, 84 insertions(+), 95 deletions(-)
create mode 100644 Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
delete mode 100644 Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
diff --git a/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
new file mode 100644
index 000000000000..f1fc3b0d8608
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: General Purpose Analog To Digital Converter (ADC) based thermal sensor
+
+maintainers:
+ - Laxman Dewangan <ldewangan@nvidia.com>
+
+description:
+ On some of platforms, thermal sensor like thermistors are connected to
+ one of ADC channel and sensor resistance is read via voltage across the
+ sensor resistor. The voltage read across the sensor is mapped to
+ temperature using voltage-temperature lookup table.
+
+properties:
+ compatible:
+ const: generic-adc-thermal
+
+ '#thermal-sensor-cells':
+ const: 0
+
+ io-channels:
+ maxItems: 1
+
+ io-channel-names:
+ const: sensor-channel
+
+ temperature-lookup-table:
+ description: |
+ Lookup table to map the relation between ADC value and temperature.
+ When ADC is read, the value is looked up on the table to get the
+ equivalent temperature.
+
+ If not specified, driver assumes the ADC channel gives milliCelsius
+ directly.
+ $ref: /schemas/types.yaml#/definitions/int32-matrix
+ items:
+ items:
+ - description: Temperature in milliCelsius
+ - description: ADC read value
+
+required:
+ - compatible
+ - '#thermal-sensor-cells'
+ - io-channels
+ - io-channel-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/thermal/thermal.h>
+
+ thermal-sensor {
+ compatible = "generic-adc-thermal";
+ #thermal-sensor-cells = <0>;
+ io-channels = <&ads1015 1>;
+ io-channel-names = "sensor-channel";
+ temperature-lookup-table = <
+ (-40000) 2578
+ (-39000) 2577
+ (-38000) 2576
+ (-37000) 2575
+ (-36000) 2574
+ (-35000) 2573
+ (-34000) 2572
+ (-33000) 2571
+ (-32000) 2569
+ (-31000) 2568
+ (-30000) 2567
+ /* skip */
+ 118000 254
+ 119000 247
+ 120000 240
+ 121000 233
+ 122000 226
+ 123000 220
+ 124000 214
+ 125000 208>;
+ };
+...
diff --git a/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt b/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
deleted file mode 100644
index e136946a2f4f..000000000000
--- a/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-General Purpose Analog To Digital Converter (ADC) based thermal sensor.
-
-On some of platforms, thermal sensor like thermistors are connected to
-one of ADC channel and sensor resistance is read via voltage across the
-sensor resistor. The voltage read across the sensor is mapped to
-temperature using voltage-temperature lookup table.
-
-Required properties:
-===================
-- compatible: Must be "generic-adc-thermal".
-- #thermal-sensor-cells: Should be 1. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description
- of this property.
-Optional properties:
-===================
-- temperature-lookup-table: Two dimensional array of Integer; lookup table
- to map the relation between ADC value and
- temperature. When ADC is read, the value is
- looked up on the table to get the equivalent
- temperature.
-
- The first value of the each row of array is the
- temperature in milliCelsius and second value of
- the each row of array is the ADC read value.
-
- If not specified, driver assumes the ADC channel
- gives milliCelsius directly.
-
-Example :
-#include <dt-bindings/thermal/thermal.h>
-
-i2c@7000c400 {
- ads1015: ads1015@4a {
- reg = <0x4a>;
- compatible = "ads1015";
- sampling-frequency = <3300>;
- #io-channel-cells = <1>;
- };
-};
-
-tboard_thermistor: thermal-sensor {
- compatible = "generic-adc-thermal";
- #thermal-sensor-cells = <0>;
- io-channels = <&ads1015 1>;
- io-channel-names = "sensor-channel";
- temperature-lookup-table = < (-40000) 2578
- (-39000) 2577
- (-38000) 2576
- (-37000) 2575
- (-36000) 2574
- (-35000) 2573
- (-34000) 2572
- (-33000) 2571
- (-32000) 2569
- (-31000) 2568
- (-30000) 2567
- ::::::::::
- 118000 254
- 119000 247
- 120000 240
- 121000 233
- 122000 226
- 123000 220
- 124000 214
- 125000 208>;
-};
-
-dummy_cool_dev: dummy-cool-dev {
- compatible = "dummy-cooling-dev";
- #cooling-cells = <2>; /* min followed by max */
-};
-
-thermal-zones {
- Tboard {
- polling-delay = <15000>; /* milliseconds */
- polling-delay-passive = <0>; /* milliseconds */
- thermal-sensors = <&tboard_thermistor>;
-
- trips {
- therm_est_trip: therm_est_trip {
- temperature = <40000>;
- type = "active";
- hysteresis = <1000>;
- };
- };
-
- cooling-maps {
- map0 {
- trip = <&therm_est_trip>;
- cooling-device = <&dummy_cool_dev THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
- contribution = <100>;
- };
-
- };
- };
-};
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema
2022-10-11 17:52 [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema Rob Herring
@ 2022-10-11 18:46 ` Krzysztof Kozlowski
2022-10-17 7:27 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-11 18:46 UTC (permalink / raw
To: Rob Herring, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
Zhang Rui, Krzysztof Kozlowski, Laxman Dewangan
Cc: linux-pm, devicetree, linux-kernel
On 11/10/2022 13:52, Rob Herring wrote:
> 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.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema
2022-10-11 17:52 [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema Rob Herring
2022-10-11 18:46 ` Krzysztof Kozlowski
@ 2022-10-17 7:27 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2022-10-17 7:27 UTC (permalink / raw
To: Rob Herring, Rafael J. Wysocki, Amit Kucheria, Zhang Rui,
Krzysztof Kozlowski, Laxman Dewangan
Cc: linux-pm, devicetree, linux-kernel
On 11/10/2022 19:52, Rob Herring wrote:
> 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>
> ---
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
* [thermal: thermal/next] dt-bindings: thermal: Convert generic-adc-thermal to DT schema
2022-10-11 17:52 [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema Rob Herring
2022-10-11 18:46 ` Krzysztof Kozlowski
2022-10-17 7:27 ` Daniel Lezcano
@ 2022-12-09 15:26 ` thermal-bot for Rob Herring
2 siblings, 0 replies; 4+ messages in thread
From: thermal-bot for Rob Herring @ 2022-12-09 15:26 UTC (permalink / raw
To: linux-pm; +Cc: Rob Herring, Krzysztof Kozlowski, Daniel Lezcano, rui.zhang,
amitk
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: baf00b6096b41571741153da3e7c8ef778649726
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//baf00b6096b41571741153da3e7c8ef778649726
Author: Rob Herring <robh@kernel.org>
AuthorDate: Tue, 11 Oct 2022 12:52:35 -05:00
Committer: Daniel Lezcano <daniel.lezcano@kernel.org>
CommitterDate: Thu, 08 Dec 2022 14:30:43 +01:00
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>
---
Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt | 95 +----------------------------------------------------------------------
2 files changed, 84 insertions(+), 95 deletions(-)
create mode 100644 Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
delete mode 100644 Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
diff --git a/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
new file mode 100644
index 0000000..f1fc3b0
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: General Purpose Analog To Digital Converter (ADC) based thermal sensor
+
+maintainers:
+ - Laxman Dewangan <ldewangan@nvidia.com>
+
+description:
+ On some of platforms, thermal sensor like thermistors are connected to
+ one of ADC channel and sensor resistance is read via voltage across the
+ sensor resistor. The voltage read across the sensor is mapped to
+ temperature using voltage-temperature lookup table.
+
+properties:
+ compatible:
+ const: generic-adc-thermal
+
+ '#thermal-sensor-cells':
+ const: 0
+
+ io-channels:
+ maxItems: 1
+
+ io-channel-names:
+ const: sensor-channel
+
+ temperature-lookup-table:
+ description: |
+ Lookup table to map the relation between ADC value and temperature.
+ When ADC is read, the value is looked up on the table to get the
+ equivalent temperature.
+
+ If not specified, driver assumes the ADC channel gives milliCelsius
+ directly.
+ $ref: /schemas/types.yaml#/definitions/int32-matrix
+ items:
+ items:
+ - description: Temperature in milliCelsius
+ - description: ADC read value
+
+required:
+ - compatible
+ - '#thermal-sensor-cells'
+ - io-channels
+ - io-channel-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/thermal/thermal.h>
+
+ thermal-sensor {
+ compatible = "generic-adc-thermal";
+ #thermal-sensor-cells = <0>;
+ io-channels = <&ads1015 1>;
+ io-channel-names = "sensor-channel";
+ temperature-lookup-table = <
+ (-40000) 2578
+ (-39000) 2577
+ (-38000) 2576
+ (-37000) 2575
+ (-36000) 2574
+ (-35000) 2573
+ (-34000) 2572
+ (-33000) 2571
+ (-32000) 2569
+ (-31000) 2568
+ (-30000) 2567
+ /* skip */
+ 118000 254
+ 119000 247
+ 120000 240
+ 121000 233
+ 122000 226
+ 123000 220
+ 124000 214
+ 125000 208>;
+ };
+...
diff --git a/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt b/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
deleted file mode 100644
index e136946..0000000
--- a/Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-General Purpose Analog To Digital Converter (ADC) based thermal sensor.
-
-On some of platforms, thermal sensor like thermistors are connected to
-one of ADC channel and sensor resistance is read via voltage across the
-sensor resistor. The voltage read across the sensor is mapped to
-temperature using voltage-temperature lookup table.
-
-Required properties:
-===================
-- compatible: Must be "generic-adc-thermal".
-- #thermal-sensor-cells: Should be 1. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description
- of this property.
-Optional properties:
-===================
-- temperature-lookup-table: Two dimensional array of Integer; lookup table
- to map the relation between ADC value and
- temperature. When ADC is read, the value is
- looked up on the table to get the equivalent
- temperature.
-
- The first value of the each row of array is the
- temperature in milliCelsius and second value of
- the each row of array is the ADC read value.
-
- If not specified, driver assumes the ADC channel
- gives milliCelsius directly.
-
-Example :
-#include <dt-bindings/thermal/thermal.h>
-
-i2c@7000c400 {
- ads1015: ads1015@4a {
- reg = <0x4a>;
- compatible = "ads1015";
- sampling-frequency = <3300>;
- #io-channel-cells = <1>;
- };
-};
-
-tboard_thermistor: thermal-sensor {
- compatible = "generic-adc-thermal";
- #thermal-sensor-cells = <0>;
- io-channels = <&ads1015 1>;
- io-channel-names = "sensor-channel";
- temperature-lookup-table = < (-40000) 2578
- (-39000) 2577
- (-38000) 2576
- (-37000) 2575
- (-36000) 2574
- (-35000) 2573
- (-34000) 2572
- (-33000) 2571
- (-32000) 2569
- (-31000) 2568
- (-30000) 2567
- ::::::::::
- 118000 254
- 119000 247
- 120000 240
- 121000 233
- 122000 226
- 123000 220
- 124000 214
- 125000 208>;
-};
-
-dummy_cool_dev: dummy-cool-dev {
- compatible = "dummy-cooling-dev";
- #cooling-cells = <2>; /* min followed by max */
-};
-
-thermal-zones {
- Tboard {
- polling-delay = <15000>; /* milliseconds */
- polling-delay-passive = <0>; /* milliseconds */
- thermal-sensors = <&tboard_thermistor>;
-
- trips {
- therm_est_trip: therm_est_trip {
- temperature = <40000>;
- type = "active";
- hysteresis = <1000>;
- };
- };
-
- cooling-maps {
- map0 {
- trip = <&therm_est_trip>;
- cooling-device = <&dummy_cool_dev THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
- contribution = <100>;
- };
-
- };
- };
-};
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-09 15:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-11 17:52 [PATCH] dt-bindings: thermal: Convert generic-adc-thermal to DT schema Rob Herring
2022-10-11 18:46 ` Krzysztof Kozlowski
2022-10-17 7:27 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Rob Herring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.