Commit c1ae18d3 authored by Tim Harvey's avatar Tim Harvey Committed by Guenter Roeck

hwmon: (gsc-hwmon) Scale temperature to millidegrees

The GSC registers report temperature in decidegrees celcius so we
need to scale it to represent the hwmon sysfs API of millidegrees.

Fixes: 3bce5377 ("hwmon: Add Gateworks System Controller support")
Signed-off-by: default avatarTim Harvey <>
Link: default avatarGuenter Roeck <>
parent cecf7560
......@@ -172,6 +172,7 @@ gsc_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
case mode_temperature:
if (tmp > 0x8000)
tmp -= 0xffff;
tmp *= 100; /* convert to millidegrees celsius */
case mode_voltage_raw:
tmp = clamp_val(tmp, 0, BIT(GSC_HWMON_RESOLUTION));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment