^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: (GPL-2.0 OR MIT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # Copyright 2019 Linaro Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) %YAML 1.2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ---
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) $id: http://devicetree.org/schemas/thermal/qcom-tsens.yaml#
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) $schema: http://devicetree.org/meta-schemas/core.yaml#
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) title: QCOM SoC Temperature Sensor (TSENS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) maintainers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) - Amit Kucheria <amitk@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) description: |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) QCOM SoCs have TSENS IP to allow temperature measurement. There are currently
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) three distinct major versions of the IP that is supported by a single driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) The IP versions are named v0.1, v1 and v2 in the driver, where v0.1 captures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) everything before v1 when there was no versioning information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) compatible:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) oneOf:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) - description: v0.1 of TSENS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) - enum:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) - qcom,msm8916-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) - qcom,msm8939-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) - qcom,msm8974-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) - const: qcom,tsens-v0_1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) - description: v1 of TSENS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) - enum:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) - qcom,msm8976-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) - qcom,qcs404-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) - const: qcom,tsens-v1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) - description: v2 of TSENS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) - enum:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) - qcom,msm8996-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) - qcom,msm8998-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) - qcom,sc7180-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) - qcom,sdm845-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) - qcom,sm8150-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) - qcom,sm8250-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) - const: qcom,tsens-v2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) reg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) - description: TM registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) - description: SROT registers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) interrupts:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) minItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) - description: Combined interrupt if upper or lower threshold crossed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) - description: Interrupt if critical threshold crossed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) interrupt-names:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) minItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) - const: uplow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) - const: critical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) nvmem-cells:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) minItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) maxItems: 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Reference to an nvmem node for the calibration data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) nvmem-cell-names:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) minItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) maxItems: 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) items:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) - const: calib
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) - const: calib_sel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) "#qcom,sensors":
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) Number of sensors enabled on this platform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) $ref: /schemas/types.yaml#/definitions/uint32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) minimum: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) maximum: 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) "#thermal-sensor-cells":
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) const: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) Number of cells required to uniquely identify the thermal sensors. Since
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) we have multiple sensors this is set to 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) allOf:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) - if:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) compatible:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) contains:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) enum:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) - qcom,msm8916-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) - qcom,msm8974-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) - qcom,msm8976-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) - qcom,qcs404-tsens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) - qcom,tsens-v0_1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) - qcom,tsens-v1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) then:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) interrupts:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) maxItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) interrupt-names:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) maxItems: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) else:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) interrupts:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) minItems: 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) interrupt-names:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) minItems: 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) required:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) - compatible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) - reg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) - "#qcom,sensors"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) - interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) - interrupt-names
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) - "#thermal-sensor-cells"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) additionalProperties: false
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) examples:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) - |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #include <dt-bindings/interrupt-controller/arm-gic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) // Example 1 (legacy: for pre v1 IP):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) tsens1: thermal-sensor@900000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) reg = <0x4a9000 0x1000>, /* TM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) <0x4a8000 0x1000>; /* SROT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) nvmem-cells = <&tsens_caldata>, <&tsens_calsel>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) nvmem-cell-names = "calib", "calib_sel";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) interrupt-names = "uplow";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #qcom,sensors = <5>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) #thermal-sensor-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) - |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) #include <dt-bindings/interrupt-controller/arm-gic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) // Example 2 (for any platform containing v1 of the TSENS IP):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) tsens2: thermal-sensor@4a9000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) compatible = "qcom,qcs404-tsens", "qcom,tsens-v1";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) reg = <0x004a9000 0x1000>, /* TM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) <0x004a8000 0x1000>; /* SROT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) nvmem-cells = <&tsens_caldata>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) nvmem-cell-names = "calib";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) interrupt-names = "uplow";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #qcom,sensors = <10>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #thermal-sensor-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) - |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #include <dt-bindings/interrupt-controller/arm-gic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) // Example 3 (for any platform containing v2 of the TSENS IP):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) tsens3: thermal-sensor@c263000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) reg = <0xc263000 0x1ff>,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) <0xc222000 0x1ff>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) interrupt-names = "uplow", "critical";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #qcom,sensors = <13>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) #thermal-sensor-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) ...