]> git.ipfire.org Git - thirdparty/linux.git/commit
thermal: renesas: rzg3e: make calibration value retrieval per-chip
authorCosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Thu, 8 Jan 2026 19:52:21 +0000 (21:52 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 21 Jan 2026 18:02:14 +0000 (19:02 +0100)
commitc33edd8f936ccf2e47eb1883f6b6944643d325c7
tree8696bcf497e65b4a201d30b733973c7ef6905ef5
parent6c7f87f517d3704a3fcc3b1c7f4220c2fcf75322
thermal: renesas: rzg3e: make calibration value retrieval per-chip

The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs expose the
temperature calibration data via SMC SIP calls.

To prepare for supporting these SoCs, do the following changes.

Rename rzg3e_thermal_parse_dt() to rzg3e_thermal_get_syscon_trim().

Move the syscon usage out of rzg3e_thermal_get_calibration() and into
rzg3e_thermal_get_syscon_trim() and remove single-use variables from the
private state.

Place a pointer to rzg3e_thermal_get_syscon_trim() into the
chip-specific struct, and use it in the probe function to retrieve the
calibration values.

Now that syscon usage has been moved out of
rzg3e_thermal_get_calibration(), remove it and inline the calibration
validation into the probe function.

Also, reuse the TSU_CODE_MAX macro to mask the calibration values, as
GEMASK(11, 0) and 0xFFF are equivalent, and replace the hardcoded 0xFFF
with TSU_CODE_MAX in the calibration validation.

Reviewed-by: John Madieu <john.madieu.xa@bp.renesas.com>
Tested-by: John Madieu <john.madieu.xa@bp.renesas.com>
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260108195223.193531-4-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/renesas/rzg3e_thermal.c