1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0) 2c66ec88fSEmmanuel Vadot# Copyright 2020 Linaro Ltd. 3c66ec88fSEmmanuel Vadot%YAML 1.2 4c66ec88fSEmmanuel Vadot--- 5c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/thermal/thermal-sensor.yaml# 6c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7c66ec88fSEmmanuel Vadot 8*8bab661aSEmmanuel Vadottitle: Thermal sensor 9c66ec88fSEmmanuel Vadot 10c66ec88fSEmmanuel Vadotmaintainers: 11c66ec88fSEmmanuel Vadot - Amit Kucheria <amitk@kernel.org> 12c66ec88fSEmmanuel Vadot 13c66ec88fSEmmanuel Vadotdescription: | 14c66ec88fSEmmanuel Vadot Thermal management is achieved in devicetree by describing the sensor hardware 15c66ec88fSEmmanuel Vadot and the software abstraction of thermal zones required to take appropriate 16c66ec88fSEmmanuel Vadot action to mitigate thermal overloads. 17c66ec88fSEmmanuel Vadot 18c66ec88fSEmmanuel Vadot The following node types are used to completely describe a thermal management 19c66ec88fSEmmanuel Vadot system in devicetree: 20c66ec88fSEmmanuel Vadot - thermal-sensor: device that measures temperature, has SoC-specific bindings 21c66ec88fSEmmanuel Vadot - cooling-device: device used to dissipate heat either passively or actively 22c66ec88fSEmmanuel Vadot - thermal-zones: a container of the following node types used to describe all 23c66ec88fSEmmanuel Vadot thermal data for the platform 24c66ec88fSEmmanuel Vadot 25c66ec88fSEmmanuel Vadot This binding describes the thermal-sensor. 26c66ec88fSEmmanuel Vadot 27c66ec88fSEmmanuel Vadot Thermal sensor devices provide temperature sensing capabilities on thermal 28c66ec88fSEmmanuel Vadot zones. Typical devices are I2C ADC converters and bandgaps. Thermal sensor 29c66ec88fSEmmanuel Vadot devices may control one or more internal sensors. 30c66ec88fSEmmanuel Vadot 31c66ec88fSEmmanuel Vadotproperties: 32c66ec88fSEmmanuel Vadot "#thermal-sensor-cells": 33c66ec88fSEmmanuel Vadot description: 34c66ec88fSEmmanuel Vadot Used to uniquely identify a thermal sensor instance within an IC. Will be 35c66ec88fSEmmanuel Vadot 0 on sensor nodes with only a single sensor and at least 1 on nodes 36c66ec88fSEmmanuel Vadot containing several internal sensors. 37c66ec88fSEmmanuel Vadot enum: [0, 1] 38c66ec88fSEmmanuel Vadot 392eb4d8dcSEmmanuel Vadotrequired: 402eb4d8dcSEmmanuel Vadot - "#thermal-sensor-cells" 412eb4d8dcSEmmanuel Vadot 426be33864SEmmanuel VadotadditionalProperties: true 436be33864SEmmanuel Vadot 44c66ec88fSEmmanuel Vadotexamples: 45c66ec88fSEmmanuel Vadot - | 46c66ec88fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 47c66ec88fSEmmanuel Vadot 48c66ec88fSEmmanuel Vadot // Example 1: SDM845 TSENS 49c66ec88fSEmmanuel Vadot soc: soc { 50c66ec88fSEmmanuel Vadot #address-cells = <2>; 51c66ec88fSEmmanuel Vadot #size-cells = <2>; 52c66ec88fSEmmanuel Vadot 53c66ec88fSEmmanuel Vadot /* ... */ 54c66ec88fSEmmanuel Vadot 55c66ec88fSEmmanuel Vadot tsens0: thermal-sensor@c263000 { 56c66ec88fSEmmanuel Vadot compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; 57c66ec88fSEmmanuel Vadot reg = <0 0x0c263000 0 0x1ff>, /* TM */ 58c66ec88fSEmmanuel Vadot <0 0x0c222000 0 0x1ff>; /* SROT */ 59c66ec88fSEmmanuel Vadot #qcom,sensors = <13>; 60c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>, 61c66ec88fSEmmanuel Vadot <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>; 62c66ec88fSEmmanuel Vadot interrupt-names = "uplow", "critical"; 63c66ec88fSEmmanuel Vadot #thermal-sensor-cells = <1>; 64c66ec88fSEmmanuel Vadot }; 65c66ec88fSEmmanuel Vadot 66c66ec88fSEmmanuel Vadot tsens1: thermal-sensor@c265000 { 67c66ec88fSEmmanuel Vadot compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; 68c66ec88fSEmmanuel Vadot reg = <0 0x0c265000 0 0x1ff>, /* TM */ 69c66ec88fSEmmanuel Vadot <0 0x0c223000 0 0x1ff>; /* SROT */ 70c66ec88fSEmmanuel Vadot #qcom,sensors = <8>; 71c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>, 72c66ec88fSEmmanuel Vadot <GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH>; 73c66ec88fSEmmanuel Vadot interrupt-names = "uplow", "critical"; 74c66ec88fSEmmanuel Vadot #thermal-sensor-cells = <1>; 75c66ec88fSEmmanuel Vadot }; 76c66ec88fSEmmanuel Vadot }; 77c66ec88fSEmmanuel Vadot... 78