QCOM SoC Temperature Sensor (TSENS)
Schema identifier ($id): "http://devicetree.org/schemas/thermal/qcom-tsens.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Amit Kucheria <amitk@kernel.org>"
QCOM SoCs have TSENS IP to allow temperature measurement. There are currently three distinct major versions of the IP that is supported by a single driver. The IP versions are named v0.1, v1 and v2 in the driver, where v0.1 captures everything before v1 when there was no versioning information.
Properties and child nodes (properties) #
compatible — required here #
Exactly one of these rules must match (oneOf) #
Rule 1
msm8960 TSENS based
Array item rules (
items)Item 1
Allowed values (
enum):"qcom,ipq8064-tsens","qcom,msm8960-tsens"
Rule 2
v0.1 of TSENS
Array item rules (
items)Item 1
Allowed values (
enum):"qcom,mdm9607-tsens","qcom,msm8226-tsens","qcom,msm8909-tsens","qcom,msm8916-tsens","qcom,msm8939-tsens","qcom,msm8974-tsens"Item 2
Exact value (
const):"qcom,tsens-v0_1"
Rule 3
v1 of TSENS without RPM which requires to be explicitly reset and enabled in the driver.
Rule 4
v1 of TSENS
Array item rules (
items)Item 1
Allowed values (
enum):"qcom,msm8937-tsens","qcom,msm8956-tsens","qcom,msm8976-tsens","qcom,qcs404-tsens"Item 2
Exact value (
const):"qcom,tsens-v1"
Rule 5
v2 of TSENS
Array item rules (
items)Item 1
Allowed values (
enum):"qcom,glymur-tsens","qcom,kaanapali-tsens","qcom,milos-tsens","qcom,msm8953-tsens","qcom,msm8996-tsens","qcom,msm8998-tsens","qcom,qcm2290-tsens","qcom,qcs8300-tsens","qcom,qcs615-tsens","qcom,sa8255p-tsens","qcom,sa8775p-tsens","qcom,sar2130p-tsens","qcom,sc7180-tsens","qcom,sc7280-tsens","qcom,sc8180x-tsens","qcom,sc8280xp-tsens","qcom,sdm630-tsens","qcom,sdm845-tsens","qcom,sm6115-tsens","qcom,sm6350-tsens","qcom,sm6375-tsens","qcom,sm8150-tsens","qcom,sm8250-tsens","qcom,sm8350-tsens","qcom,sm8450-tsens","qcom,sm8550-tsens","qcom,sm8650-tsens","qcom,x1e80100-tsens"Item 2
Exact value (
const):"qcom,tsens-v2"
Rule 6
v2 of TSENS with combined interrupt
Allowed values (
enum):"qcom,ipq5332-tsens","qcom,ipq5424-tsens","qcom,ipq8074-tsens"
Rule 7
v2 of TSENS with combined interrupt
Array item rules (
items)Item 1
Allowed values (
enum):"qcom,ipq6018-tsens","qcom,ipq9574-tsens"Item 2
Exact value (
const):"qcom,ipq8074-tsens"
reg — not listed as required here #
Array item rules (items) #
Item 1
TM registers
Item 2
SROT registers
interrupts — required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
interrupt-names — required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
nvmem-cells — not listed as required here #
Exactly one of these rules must match (oneOf) #
Rule 1
Minimum number of items (
minItems):1Maximum number of items (
maxItems):2Reference to an nvmem node for the calibration data
Rule 2
Minimum number of items (
minItems):5Maximum number of items (
maxItems):35Reference to nvmem cells for the calibration mode, two calibration bases and two cells per each sensor
Rule 3
Maximum number of items (
maxItems):51Reference to nvmem cells for the calibration mode, two calibration bases and two cells per each sensor, main and backup copies, plus use_backup cell
nvmem-cell-names — not listed as required here #
Exactly one of these rules must match (oneOf) #
Rule 1
Minimum number of items (
minItems):1Array item rules (
items)Item 1
Exact value (
const):"calib"Item 2
Rule 2
Minimum number of items (
minItems):5Array item rules (
items)Item 1
Exact value (
const):"mode"Item 2
Exact value (
const):"base1"Item 3
Exact value (
const):"base2"Item 4
String pattern (
pattern):"^s[0-9]+_p1$"Item 5
String pattern (
pattern):"^s[0-9]+_p2$"Item 6
String pattern (
pattern):"^s[0-9]+_p1$"Item 7
String pattern (
pattern):"^s[0-9]+_p2$"Item 8
String pattern (
pattern):"^s[0-9]+_p1$"Item 9
String pattern (
pattern):"^s[0-9]+_p2$"Item 10
String pattern (
pattern):"^s[0-9]+_p1$"Item 11
String pattern (
pattern):"^s[0-9]+_p2$"Item 12
String pattern (
pattern):"^s[0-9]+_p1$"Item 13
String pattern (
pattern):"^s[0-9]+_p2$"Item 14
String pattern (
pattern):"^s[0-9]+_p1$"Item 15
String pattern (
pattern):"^s[0-9]+_p2$"Item 16
String pattern (
pattern):"^s[0-9]+_p1$"Item 17
String pattern (
pattern):"^s[0-9]+_p2$"Item 18
String pattern (
pattern):"^s[0-9]+_p1$"Item 19
String pattern (
pattern):"^s[0-9]+_p2$"Item 20
String pattern (
pattern):"^s[0-9]+_p1$"Item 21
String pattern (
pattern):"^s[0-9]+_p2$"Item 22
String pattern (
pattern):"^s[0-9]+_p1$"Item 23
String pattern (
pattern):"^s[0-9]+_p2$"Item 24
String pattern (
pattern):"^s[0-9]+_p1$"Item 25
String pattern (
pattern):"^s[0-9]+_p2$"Item 26
String pattern (
pattern):"^s[0-9]+_p1$"Item 27
String pattern (
pattern):"^s[0-9]+_p2$"Item 28
String pattern (
pattern):"^s[0-9]+_p1$"Item 29
String pattern (
pattern):"^s[0-9]+_p2$"Item 30
String pattern (
pattern):"^s[0-9]+_p1$"Item 31
String pattern (
pattern):"^s[0-9]+_p2$"Item 32
String pattern (
pattern):"^s[0-9]+_p1$"Item 33
String pattern (
pattern):"^s[0-9]+_p2$"Item 34
String pattern (
pattern):"^s[0-9]+_p1$"Item 35
String pattern (
pattern):"^s[0-9]+_p2$"
Rule 3
Array item rules (
items)Item 1
Exact value (
const):"mode"Item 2
Exact value (
const):"base1"Item 3
Exact value (
const):"base2"Item 4
Exact value (
const):"use_backup"Item 5
Exact value (
const):"mode_backup"Item 6
Exact value (
const):"base1_backup"Item 7
Exact value (
const):"base2_backup"Item 8
Exact value (
const):"s0_p1"Item 9
Exact value (
const):"s0_p2"Item 10
Exact value (
const):"s1_p1"Item 11
Exact value (
const):"s1_p2"Item 12
Exact value (
const):"s2_p1"Item 13
Exact value (
const):"s2_p2"Item 14
Exact value (
const):"s3_p1"Item 15
Exact value (
const):"s3_p2"Item 16
Exact value (
const):"s4_p1"Item 17
Exact value (
const):"s4_p2"Item 18
Exact value (
const):"s5_p1"Item 19
Exact value (
const):"s5_p2"Item 20
Exact value (
const):"s6_p1"Item 21
Exact value (
const):"s6_p2"Item 22
Exact value (
const):"s7_p1"Item 23
Exact value (
const):"s7_p2"Item 24
Exact value (
const):"s8_p1"Item 25
Exact value (
const):"s8_p2"Item 26
Exact value (
const):"s9_p1"Item 27
Exact value (
const):"s9_p2"Item 28
Exact value (
const):"s10_p1"Item 29
Exact value (
const):"s10_p2"Item 30
Exact value (
const):"s0_p1_backup"Item 31
Exact value (
const):"s0_p2_backup"Item 32
Exact value (
const):"s1_p1_backup"Item 33
Exact value (
const):"s1_p2_backup"Item 34
Exact value (
const):"s2_p1_backup"Item 35
Exact value (
const):"s2_p2_backup"Item 36
Exact value (
const):"s3_p1_backup"Item 37
Exact value (
const):"s3_p2_backup"Item 38
Exact value (
const):"s4_p1_backup"Item 39
Exact value (
const):"s4_p2_backup"Item 40
Exact value (
const):"s5_p1_backup"Item 41
Exact value (
const):"s5_p2_backup"Item 42
Exact value (
const):"s6_p1_backup"Item 43
Exact value (
const):"s6_p2_backup"Item 44
Exact value (
const):"s7_p1_backup"Item 45
Exact value (
const):"s7_p2_backup"Item 46
Exact value (
const):"s8_p1_backup"Item 47
Exact value (
const):"s8_p2_backup"Item 48
Exact value (
const):"s9_p1_backup"Item 49
Exact value (
const):"s9_p2_backup"Item 50
Exact value (
const):"s10_p1_backup"Item 51
Exact value (
const):"s10_p2_backup"
Rule 4
Minimum number of items (
minItems):8Array item rules (
items)Item 1
Exact value (
const):"mode"Item 2
Exact value (
const):"base0"Item 3
Exact value (
const):"base1"Item 4
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 5
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 6
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 7
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 8
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 9
String pattern (
pattern):"^tsens_sens[0-9]+_off$"Item 10
String pattern (
pattern):"^tsens_sens[0-9]+_off$"
#qcom,sensors — required here #
Number of sensors enabled on this platform
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
Minimum value (minimum): 1
Maximum value (maximum): 16
#thermal-sensor-cells — not listed as required here #
Exact value (const): 1
Required in this object (required): "compatible", "interrupts", "interrupt-names", "#qcom,sensors"
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):thermal-sensor.yaml#
Rule 2 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Allowed values (
enum):"qcom,ipq5018-tsens","qcom,ipq8064-tsens","qcom,msm8960-tsens","qcom,tsens-v0_1","qcom,tsens-v1"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereArray item rules (
items)Item 1
Combined interrupt if upper or lower threshold crossed
interrupt-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"uplow"
Rule 3 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"qcom,tsens-v2"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereArray item rules (
items)Item 1
Combined interrupt if upper or lower threshold crossed
Item 2
Interrupt if critical threshold crossed
interrupt-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"uplow"Item 2
Exact value (
const):"critical"
Rule 4 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Allowed values (
enum):"qcom,ipq5332-tsens","qcom,ipq5424-tsens","qcom,ipq8074-tsens"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereArray item rules (
items)Item 1
Combined interrupt if upper, lower or critical thresholds crossed
interrupt-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"combined"
Rule 5 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Allowed values (
enum):"qcom,ipq5332-tsens","qcom,ipq5424-tsens","qcom,ipq8074-tsens","qcom,tsens-v0_1","qcom,tsens-v1","qcom,tsens-v2"When the condition matches (
then) #
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/interrupt-controller/arm-gic.h>
thermal-sensor {
compatible = "qcom,ipq8064-tsens";
nvmem-cells = <&tsens_calib>, <&tsens_calib_backup>;
nvmem-cell-names = "calib", "calib_backup";
interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow";
#qcom,sensors = <11>;
#thermal-sensor-cells = <1>;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 1 (new calibration data: for pre v1 IP):
thermal-sensor@4a9000 {
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
reg = <0x4a9000 0x1000>, /* TM */
<0x4a8000 0x1000>; /* SROT */
nvmem-cells = <&tsens_mode>,
<&tsens_base1>, <&tsens_base2>,
<&tsens_s0_p1>, <&tsens_s0_p2>,
<&tsens_s1_p1>, <&tsens_s1_p2>,
<&tsens_s2_p1>, <&tsens_s2_p2>,
<&tsens_s4_p1>, <&tsens_s4_p2>,
<&tsens_s5_p1>, <&tsens_s5_p2>;
nvmem-cell-names = "mode",
"base1", "base2",
"s0_p1", "s0_p2",
"s1_p1", "s1_p2",
"s2_p1", "s2_p2",
"s4_p1", "s4_p2",
"s5_p1", "s5_p2";
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow";
#qcom,sensors = <5>;
#thermal-sensor-cells = <1>;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 1 (legacy: for pre v1 IP):
tsens1: thermal-sensor@4a9000 {
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
reg = <0x4a9000 0x1000>, /* TM */
<0x4a8000 0x1000>; /* SROT */
nvmem-cells = <&tsens_caldata>, <&tsens_calsel>;
nvmem-cell-names = "calib", "calib_sel";
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow";
#qcom,sensors = <5>;
#thermal-sensor-cells = <1>;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 2 (for any platform containing v1 of the TSENS IP):
tsens2: thermal-sensor@4a9000 {
compatible = "qcom,qcs404-tsens", "qcom,tsens-v1";
reg = <0x004a9000 0x1000>, /* TM */
<0x004a8000 0x1000>; /* SROT */
nvmem-cells = <&tsens_caldata>;
nvmem-cell-names = "calib";
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow";
#qcom,sensors = <10>;
#thermal-sensor-cells = <1>;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 3 (for any platform containing v2 of the TSENS IP):
tsens3: thermal-sensor@c263000 {
compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
reg = <0xc263000 0x1ff>,
<0xc222000 0x1ff>;
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow", "critical";
#qcom,sensors = <13>;
#thermal-sensor-cells = <1>;
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 4 (for any IPQ8074 based SoC-s):
tsens4: thermal-sensor@4a9000 {
compatible = "qcom,ipq8074-tsens";
reg = <0x4a9000 0x1000>,
<0x4a8000 0x1000>;
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "combined";
#qcom,sensors = <16>;
#thermal-sensor-cells = <1>;
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0 OR MIT)
Line 2: Copyright 2019 Linaro Ltd.
Line 124: special case for msm8974 / apq8084
Line 175: special case for msm8974 / apq8084