[PATCH v7 3/6] thermal: renesas: rzg3e: Add thermal driver for the Renesas RZ/G3E SoC
Geert Uytterhoeven
geert at linux-m68k.org
Tue Aug 19 00:49:56 PDT 2025
Hi John,
On Mon, 18 Aug 2025 at 18:29, John Madieu <john.madieu.xa at bp.renesas.com> wrote:
> The RZ/G3E SoC integrates a Temperature Sensor Unit (TSU) block designed
> to monitor the chip's junction temperature. This sensor is connected to
> channel 1 of the APB port clock/reset and provides temperature measurements.
>
> It also requires calibration values stored in the system controller registers
> for accurate temperature measurement. Add a driver for the Renesas RZ/G3E TSU.
>
> Signed-off-by: John Madieu <john.madieu.xa at bp.renesas.com>
> v7: Refactored driver structure:
> - removes splinlock usage
> - updates polling timeout as per the datasheet
> - uses average mode to be more accurate
> - uses polling (faster than irq mode) for get_temp() while keeping IRQ for hw
> trip-point cross detection.
> - adds both runtime and sleep PM support
Thanks for the update!
I only looked at the code to obtain the trim register offsets.
> --- /dev/null
> +++ b/drivers/thermal/renesas/rzg3e_thermal.c
> +static int rzg3e_thermal_parse_dt(struct rzg3e_thermal_priv *priv)
> +{
> + struct device_node *np = priv->dev->of_node;
> + struct of_phandle_args args;
> + int ret;
> +
> + ret = of_parse_phandle_with_args(np, "renesas,tsu-trim",
> + "#address-cells", 0, &args);
of_parse_phandle_with_fixed_args(np, "renesas,tsu-trim", 1, 0, &args)
> + if (ret)
> + return dev_err_probe(priv->dev, ret,
> + "Failed to parse renesas,tsu-trim\n");
> +
> + if (args.args_count < 1) {
"!= 1", however, I think this test is no longer needed after moving
to of_parse_phandle_with_fixed_args().
> + dev_err(priv->dev, "Invalid renesas,tsu-trim property\n");
> + of_node_put(args.np);
> + return -EINVAL;
> + }
> +
> + priv->trim_offset = args.args[0];
> +
> + priv->syscon = syscon_node_to_regmap(args.np);
> + of_node_put(args.np);
> +
> + if (IS_ERR(priv->syscon))
> + return dev_err_probe(priv->dev, PTR_ERR(priv->syscon),
> + "Failed to get syscon regmap\n");
> +
> + return 0;
> +}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
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
More information about the linux-arm-kernel
mailing list