Skip to content
Snippets Groups Projects
Commit 82a17e75 authored by Tim Harvey's avatar Tim Harvey Committed by Stefano Babic
Browse files

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: default avatarTim Harvey <tharvey@gateworks.com>
parent efa7ed72
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment