aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Nguyen <[email protected]>2022-11-10 13:21:08 -0600
committerGuenter Roeck <[email protected]>2022-11-20 06:04:15 -0800
commit07e06193ead86d4812f431b4d87bbd4161222e3f (patch)
tree5a923804f74ef2ecba5d6074766fe239e2a776c7
parent094226ad94f471a9f19e8f8e7140a09c2625abaa (diff)
hwmon: (ltc2947) fix temperature scaling
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. Fixes: 9f90fd652bed ("hwmon: Add support for ltc2947") Signed-off-by: Derek Nguyen <[email protected]> Signed-off-by: Brandon Maier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
-rw-r--r--drivers/hwmon/ltc2947-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/ltc2947-core.c b/drivers/hwmon/ltc2947-core.c
index 7404e974762f..2dbbbac9de09 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;
}