Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: thermal: tsens: support per-sensor calibration cells

Allow specifying the exact calibration mode and calibration data as nvmem
cells, rather than specifying just a single calibration data blob.

Note, unlike the vendor kernel the calibration data uses hw_ids rather
than software sensor indices (to match actual tsens usage in
thermal zones).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230101194034.831222-3-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Dmitry Baryshkov and committed by
Daniel Lezcano
4f4292bf 8c142145

+84 -10
+84 -10
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
··· 81 81 maxItems: 2 82 82 83 83 nvmem-cells: 84 - minItems: 1 85 - maxItems: 2 86 - description: 87 - Reference to an nvmem node for the calibration data 84 + oneOf: 85 + - minItems: 1 86 + maxItems: 2 87 + description: 88 + Reference to an nvmem node for the calibration data 89 + - minItems: 5 90 + maxItems: 35 91 + description: | 92 + Reference to nvmem cells for the calibration mode, two calibration 93 + bases and two cells per each sensor 88 94 89 95 nvmem-cell-names: 90 - minItems: 1 91 - items: 92 - - const: calib 93 - - enum: 94 - - calib_backup 95 - - calib_sel 96 + oneOf: 97 + - minItems: 1 98 + items: 99 + - const: calib 100 + - enum: 101 + - calib_backup 102 + - calib_sel 103 + - minItems: 5 104 + items: 105 + - const: mode 106 + - const: base1 107 + - const: base2 108 + - pattern: '^s[0-9]+_p1$' 109 + - pattern: '^s[0-9]+_p2$' 110 + - pattern: '^s[0-9]+_p1$' 111 + - pattern: '^s[0-9]+_p2$' 112 + - pattern: '^s[0-9]+_p1$' 113 + - pattern: '^s[0-9]+_p2$' 114 + - pattern: '^s[0-9]+_p1$' 115 + - pattern: '^s[0-9]+_p2$' 116 + - pattern: '^s[0-9]+_p1$' 117 + - pattern: '^s[0-9]+_p2$' 118 + - pattern: '^s[0-9]+_p1$' 119 + - pattern: '^s[0-9]+_p2$' 120 + - pattern: '^s[0-9]+_p1$' 121 + - pattern: '^s[0-9]+_p2$' 122 + - pattern: '^s[0-9]+_p1$' 123 + - pattern: '^s[0-9]+_p2$' 124 + - pattern: '^s[0-9]+_p1$' 125 + - pattern: '^s[0-9]+_p2$' 126 + - pattern: '^s[0-9]+_p1$' 127 + - pattern: '^s[0-9]+_p2$' 128 + - pattern: '^s[0-9]+_p1$' 129 + - pattern: '^s[0-9]+_p2$' 130 + - pattern: '^s[0-9]+_p1$' 131 + - pattern: '^s[0-9]+_p2$' 132 + - pattern: '^s[0-9]+_p1$' 133 + - pattern: '^s[0-9]+_p2$' 134 + - pattern: '^s[0-9]+_p1$' 135 + - pattern: '^s[0-9]+_p2$' 136 + - pattern: '^s[0-9]+_p1$' 137 + - pattern: '^s[0-9]+_p2$' 138 + - pattern: '^s[0-9]+_p1$' 139 + - pattern: '^s[0-9]+_p2$' 96 140 97 141 "#qcom,sensors": 98 142 description: ··· 263 219 #qcom,sensors = <11>; 264 220 #thermal-sensor-cells = <1>; 265 221 }; 222 + }; 223 + 224 + - | 225 + #include <dt-bindings/interrupt-controller/arm-gic.h> 226 + // Example 1 (new calbiration data: for pre v1 IP): 227 + thermal-sensor@900000 { 228 + compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1"; 229 + reg = <0x4a9000 0x1000>, /* TM */ 230 + <0x4a8000 0x1000>; /* SROT */ 231 + 232 + nvmem-cells = <&tsens_mode>, 233 + <&tsens_base1>, <&tsens_base2>, 234 + <&tsens_s0_p1>, <&tsens_s0_p2>, 235 + <&tsens_s1_p1>, <&tsens_s1_p2>, 236 + <&tsens_s2_p1>, <&tsens_s2_p2>, 237 + <&tsens_s4_p1>, <&tsens_s4_p2>, 238 + <&tsens_s5_p1>, <&tsens_s5_p2>; 239 + nvmem-cell-names = "mode", 240 + "base1", "base2", 241 + "s0_p1", "s0_p2", 242 + "s1_p1", "s1_p2", 243 + "s2_p1", "s2_p2", 244 + "s4_p1", "s4_p2", 245 + "s5_p1", "s5_p2"; 246 + 247 + interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 248 + interrupt-names = "uplow"; 249 + 250 + #qcom,sensors = <5>; 251 + #thermal-sensor-cells = <1>; 266 252 }; 267 253 268 254 - |