Skip to content
Commit b6e5122f authored by Henrik Rydberg's avatar Henrik Rydberg Committed by Guenter Roeck
Browse files

hwmon: (applesmc) Allow negative temperature values



There are many userland reports of sensors with unreasonably small and
large temperatures. There seem to be several reasons for this:

Firstly, the major sensor type (sp78) is actually a signed number.
This explains why some sensors show very small or large values - they
are in fact all small, but of different sign.

Secondly, the other sensor type (1-hex) is not properly understood; it
may be that it is not a temperature after all.

Thirdly, some sensors are differential in nature, showing changes over
time rather than absolute numbers.  This explains why those values are
small and of varying sign.

This patch interprets the sp78 type as signed short, but keeps the
original scaling. For other types, -EINVAL is returned, since the
nature of those sensors is unknown.

Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 41bf870e
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