[PATCH] drivers: imx_tmu: Select polling-rate from cpu-thermal devicetree node

The polling rate is already specified in some devicetrees, like imx8mp.dtsi for example, but was not selected so far. For the trippoints, the cpu-thermal node is used. Also get the polling rate from this node. Use the default of 5000ms if the polling rate should not be specified in the devicetree.
NOTE: The polling rate from the devicetree will be used after this patch. In imx8*.dtsi devicetrees the polling delay is set to 2000ms for example.
Signed-off-by: Benjamin Hahn B.Hahn@phytec.de --- drivers/thermal/imx_tmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c index 4721cfbc0218..c7fe0f07a607 100644 --- a/drivers/thermal/imx_tmu.c +++ b/drivers/thermal/imx_tmu.c @@ -570,12 +570,14 @@ static int imx_tmu_parse_fdt(struct udevice *dev) { struct imx_tmu_plat *pdata = dev_get_plat(dev), *p_parent_data; struct ofnode_phandle_args args; - ofnode trips_np; + ofnode trips_np, cpu_thermal_np; int ret;
dev_dbg(dev, "%s\n", __func__);
- pdata->polling_delay = IMX_TMU_POLLING_DELAY_MS; + cpu_thermal_np = ofnode_path("/thermal-zones/cpu-thermal"); + pdata->polling_delay = ofnode_read_u32_default(cpu_thermal_np, "polling-delay", + IMX_TMU_POLLING_DELAY_MS);
if (pdata->zone_node) { pdata->regs = (union tmu_regs *)dev_read_addr_ptr(dev);
--- base-commit: eac52e4be4e234d563d6911737ee7ccdc0ada1f1 change-id: 20240304-fix-thermal-driver-issue-34004526aa4f
Best regards,

On Mon, Mar 4, 2024 at 8:49 AM Benjamin Hahn B.Hahn@phytec.de wrote:
The polling rate is already specified in some devicetrees, like imx8mp.dtsi for example, but was not selected so far. For the trippoints, the cpu-thermal node is used. Also get the polling rate from this node. Use the default of 5000ms if the polling rate should not be specified in the devicetree.
NOTE: The polling rate from the devicetree will be used after this patch. In imx8*.dtsi devicetrees the polling delay is set to 2000ms for example.
Signed-off-by: Benjamin Hahn B.Hahn@phytec.de
Reviewed-by: Fabio Estevam festevam@gmail.com

On Mon, Mar 4, 2024 at 8:49 AM Benjamin Hahn B.Hahn@phytec.de wrote:
The polling rate is already specified in some devicetrees, like imx8mp.dtsi for example, but was not selected so far. For the trippoints, the cpu-thermal node is used. Also get the polling rate from this node. Use the default of 5000ms if the polling rate should not be specified in the devicetree.
NOTE: The polling rate from the devicetree will be used after this patch. In imx8*.dtsi devicetrees the polling delay is set to 2000ms for example.
Signed-off-by: Benjamin Hahn B.Hahn@phytec.de
Applied for u-boot-imx/next, thanks.
participants (2)
-
Benjamin Hahn
-
Fabio Estevam