diff options
author | Tim Harvey <tharvey@gateworks.com> | 2016-05-24 18:03:51 (GMT) |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2016-05-31 15:24:30 (GMT) |
commit | 82a17e75da0d812c2e583e733efd1e67e7488933 (patch) | |
tree | b0dabd77e86287eae33d0661ee689641e61136f3 | |
parent | efa7ed7236ee5bfab871f35ce70f3e3e1d39b4f6 (diff) | |
download | u-boot-fsl-qoriq-82a17e75da0d812c2e583e733efd1e67e7488933.tar.xz |
imx: ventana: gsc: fix negative temperature readings
The GSC Temperature sensor is a 2's complement value - adjust accordingly
for negative temperatures.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
-rw-r--r-- | board/gateworks/gw_ventana/gsc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c index 2555824..c626ba2 100644 --- a/board/gateworks/gw_ventana/gsc.c +++ b/board/gateworks/gw_ventana/gsc.c @@ -71,6 +71,8 @@ static void read_hwmon(const char *name, uint reg, uint size) puts("fRD\n"); } else { ui = buf[0] | (buf[1]<<8) | (buf[2]<<16); + if (reg == GSC_HWMON_TEMP && ui > 0x8000) + ui -= 0xffff; if (ui == 0xffffff) puts("invalid\n"); else |