Re: [PATCH v5 3/5] thermal: renesas: rzg3e: make calibration value retrieval per-chip

From: Geert Uytterhoeven
Date: Fri Jan 09 2026 - 08:59:33 EST


On Thu, 8 Jan 2026 at 20:53, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@xxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxxxxx>
> Tested-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
> ---
>
> V5:
> * replace hardcoded 0xFFF values with TSU_CODE_MAX
>
> V4:
> * pick up John's Reviewed-by and Tested-by
> * replace new macro TSU_TEMP_MASK usage with existing macro
> TSU_CODE_MAX
> * remove "Validate calibration data" comments
> * inline rzg3e_validate_calibration() into rzg3e_thermal_probe()

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds