summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorFabio Estevam <festevam@denx.de>2023-08-23 20:59:08 +0300
committerStefano Babic <stefano.babic@swupdate.org>2023-09-04 18:26:44 +0300
commit402b8106eca604d3e1c150fbde88064d5044cb7c (patch)
treed9e6738dfd2e3bf13b92c6b7b8547d232c0a2008 /drivers/thermal
parent282ff895c89c4c403be8a2331bcc265ff5224a83 (diff)
downloadu-boot-402b8106eca604d3e1c150fbde88064d5044cb7c.tar.xz
thermal: imx_tmu: Fix the polling default
When the 'polling-delay' property is not passed via devicetree, pdata->polling_delay keeps at 0. This causes the imx_tmu driver to get stuck inside the busy while() loop when the CPU temperature is above the alert point. Fix this problem by passing a one second polling interval, which provides a proper delay to let the system to cool down and exit the while() loop when the temperature is below the alert point. Signed-off-by: Fabio Estevam <festevam@denx.de>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_tmu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index 97efc55044..d9a04eaf79 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -37,6 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define TER_ADC_PD 0x40000000
#define TER_ALPF 0x3
+#define IMX_TMU_POLLING_DELAY_MS 1000
/*
* i.MX TMU Registers
*/
@@ -574,6 +575,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
dev_dbg(dev, "%s\n", __func__);
+ pdata->polling_delay = IMX_TMU_POLLING_DELAY_MS;
+
if (pdata->zone_node) {
pdata->regs = (union tmu_regs *)dev_read_addr_ptr(dev);
@@ -602,7 +605,8 @@ static int imx_tmu_parse_fdt(struct udevice *dev)
dev_dbg(dev, "args.args_count %d, id %d\n", args.args_count, pdata->id);
- pdata->polling_delay = dev_read_u32_default(dev, "polling-delay", 1000);
+ pdata->polling_delay = dev_read_u32_default(dev, "polling-delay",
+ IMX_TMU_POLLING_DELAY_MS);
trips_np = ofnode_path("/thermal-zones/cpu-thermal/trips");
ofnode_for_each_subnode(trips_np, trips_np) {