diff mbox series

[4/5] thermal: imx_tmu: Fix th temperature unit

Message ID 20230823172637.303101-4-festevam@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [1/5] imx8mm_evk_defconfig: Select CONFIG_IMX_TMU | expand

Commit Message

Fabio Estevam Aug. 23, 2023, 5:26 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

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 <festevam@denx.de>
---
 drivers/thermal/imx_tmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Aug. 23, 2023, 5:37 p.m. UTC | #1
On Wed, Aug 23, 2023 at 02:26:36PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> 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 <festevam@denx.de>
> ---
>  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 d9a04eaf79..f79b583811 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_info(dev, "CPU Temperature (%dC) has beyond alert (%dC), close to critical (%dC) waiting...\n",
> -			 cpu_tmp, pdata->alert, pdata->critical);
> +		dev_info(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, &cpu_tmp);
>  		if (ret)

To follow-up on the patch about select'ing LOG, this shouldn't be
dev_info, it should be higher, at least warning if not critical.  And
given the default LOGLEVEL of 4, it will be included and printed.
diff mbox series

Patch

diff --git a/drivers/thermal/imx_tmu.c b/drivers/thermal/imx_tmu.c
index d9a04eaf79..f79b583811 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_info(dev, "CPU Temperature (%dC) has beyond alert (%dC), close to critical (%dC) waiting...\n",
-			 cpu_tmp, pdata->alert, pdata->critical);
+		dev_info(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, &cpu_tmp);
 		if (ret)