Re: [PATCH] hwmon: (ltc2947) fix temperature scaling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 10, 2022 at 01:21:08PM -0600, Brandon Maier wrote:
> From: Derek Nguyen <derek.nguyen@xxxxxxxxxxx>
> 
> The LTC2947 datasheet (Rev. B) calls out in the section "Register
> Description: Non-Accumulated Result Registers" (pg. 30) that "To
> calculate temperature, multiply the TEMP register value by 0.204°C
> and add 5.5°C". Fix to add 5.5C and not 0.55C.
> 
> Signed-off-by: Derek Nguyen <derek.nguyen@xxxxxxxxxxx>
> Signed-off-by: Brandon Maier <brandon.maier@xxxxxxxxxxx>

Good catch. Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/ltc2947-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/ltc2947-core.c b/drivers/hwmon/ltc2947-core.c
> index 7404e974762fd..2dbbbac9de093 100644
> --- a/drivers/hwmon/ltc2947-core.c
> +++ b/drivers/hwmon/ltc2947-core.c
> @@ -396,7 +396,7 @@ static int ltc2947_read_temp(struct device *dev, const u32 attr, long *val,
>  		return ret;
>  
>  	/* in milidegrees celcius, temp is given by: */
> -	*val = (__val * 204) + 550;
> +	*val = (__val * 204) + 5500;
>  
>  	return 0;
>  }



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux