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