[PATCH v2 4/5] thermal: imx_tmu: Fix the temperature unit

2023-09-05 Thread sbabic
> From: Fabio Estevam 
> The temperature unit is millidegree Celsius, so divide by 1000 to correctly
> print the temperature values in Celsius.
> While at it, also change a typo: "has beyond" to "is beyond".
> Signed-off-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v2 4/5] thermal: imx_tmu: Fix the temperature unit

2023-08-23 Thread Fabio Estevam
From: Fabio Estevam 

The temperature unit is millidegree Celsius, so divide by 1000 to correctly
print the temperature values in Celsius.

While at it, also change a typo: "has beyond" to "is beyond".

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Rebased.

 drivers/thermal/imx_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index d2ea084d2d2f..b877ee36878f 100644
--- a/drivers/thermal/imx_tmu.c
+++ b/drivers/thermal/imx_tmu.c
@@ -238,8 +238,8 @@ int imx_tmu_get_temp(struct udevice *dev, int *temp)
return ret;
 
while (cpu_tmp >= pdata->alert) {
-   dev_crit(dev, "CPU Temperature (%dC) has beyond alert (%dC), 
close to critical (%dC) waiting...\n",
-cpu_tmp, pdata->alert, pdata->critical);
+   dev_crit(dev, "CPU Temperature (%dC) is beyond alert (%dC), 
close to critical (%dC) waiting...\n",
+cpu_tmp / 1000, pdata->alert / 1000, pdata->critical / 
1000);
mdelay(pdata->polling_delay);
ret = read_temperature(dev, _tmp);
if (ret)
-- 
2.34.1