]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus) Fix low limit temperature alarms
authorGuenter Roeck <guenter.roeck@ericsson.com>
Sat, 10 Sep 2011 13:02:12 +0000 (06:02 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Tue, 13 Sep 2011 13:19:15 +0000 (06:19 -0700)
commitd3a3496419dfe7dc38d8d56148135039fa30569e
tree2e4e8e368b262648d7d96fbd9af4b012551df282
parentae7ce1f433e7554abda22b607f7f0f6fef33142a
hwmon: (pmbus) Fix low limit temperature alarms

Temperature alarms are detected by checking the alarm bit and comparing
temperature limits against the current temperature. For low limits, this
comparison needs to be reversed (temp < limit instead of temp > limit).
This was not taken into account, resulting in wrong alarms if a temperature
fell below a low limit.

Fix by adding a low limit flag in the limit data structure. When creating the
sensor entry, the order of registers to compare is now reversed for low limits.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 3.0+
drivers/hwmon/pmbus/pmbus_core.c