Skip to content

Commit 75b98a2

Browse files
Nicolas Frattarolidlezcano
authored andcommitted
dt-bindings: thermal: rockchip: document otp thermal trim
Several Rockchip SoCs, such as the RK3576, can store calibration trim data for thermal sensors in OTP cells. This capability should be documented. Such a rockchip thermal sensor may reference cell handles that store both a chip-wide trim for all the sensors, as well as cell handles for each individual sensor channel pointing to that specific sensor's trim value. Additionally, the thermal sensor may optionally reference cells which store the base in terms of degrees celsius and decicelsius that the trim is relative to. Each SoC that implements this appears to have a slightly different combination of chip-wide trim, base, base fractional part and per-channel trim, so which ones do which is documented in the bindings. Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250610-rk3576-tsadc-upstream-v6-4-b6e9efbf1015@collabora.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent feb69bc commit 75b98a2

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Documentation/devicetree/bindings/thermal/rockchip-thermal.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ properties:
4040
- const: tsadc
4141
- const: apb_pclk
4242

43+
nvmem-cells:
44+
items:
45+
- description: cell handle to where the trim's base temperature is stored
46+
- description:
47+
cell handle to where the trim's tenths of Celsius base value is stored
48+
49+
nvmem-cell-names:
50+
items:
51+
- const: trim_base
52+
- const: trim_base_frac
53+
4354
resets:
4455
minItems: 1
4556
maxItems: 3
@@ -51,6 +62,12 @@ properties:
5162
- const: tsadc
5263
- const: tsadc-phy
5364

65+
"#address-cells":
66+
const: 1
67+
68+
"#size-cells":
69+
const: 0
70+
5471
"#thermal-sensor-cells":
5572
const: 1
5673

@@ -72,6 +89,27 @@ properties:
7289
$ref: /schemas/types.yaml#/definitions/uint32
7390
enum: [0, 1]
7491

92+
patternProperties:
93+
"@[0-9a-f]+$":
94+
type: object
95+
properties:
96+
reg:
97+
maxItems: 1
98+
description: sensor ID, a.k.a. channel number
99+
100+
nvmem-cells:
101+
items:
102+
- description: handle of cell containing calibration data
103+
104+
nvmem-cell-names:
105+
items:
106+
- const: trim
107+
108+
required:
109+
- reg
110+
111+
unevaluatedProperties: false
112+
75113
required:
76114
- compatible
77115
- reg
@@ -80,6 +118,29 @@ required:
80118
- clock-names
81119
- resets
82120

121+
allOf:
122+
- if:
123+
not:
124+
properties:
125+
compatible:
126+
contains:
127+
const: rockchip,rk3568-tsadc
128+
then:
129+
properties:
130+
nvmem-cells: false
131+
nvmem-cell-names: false
132+
- if:
133+
not:
134+
properties:
135+
compatible:
136+
contains:
137+
enum:
138+
- rockchip,rk3568-tsadc
139+
- rockchip,rk3576-tsadc
140+
then:
141+
patternProperties:
142+
"@[0-9a-f]+$": false
143+
83144
unevaluatedProperties: false
84145

85146
examples:

0 commit comments

Comments
 (0)