]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (nct7802) Fix non-working alarm on voltages
authorGilles Buloz <gilles.buloz@kontron.com>
Fri, 29 Nov 2019 09:56:05 +0000 (10:56 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 17 Jan 2020 15:56:48 +0000 (07:56 -0800)
commitf099520b395e697ad6e875c22c46dea484d147b4
tree7a38489aa8e58a09b5ad8f083bc804229d8418a0
parent0e4555ff4d5e417542e8f2b7fe9c57af580fc38d
hwmon: (nct7802) Fix non-working alarm on voltages

No alarm is reported by /sys/.../inX_alarm

In detail:

The SMI Voltage status register is the only register giving a status
for voltages, but it does not work like the non-SMI status registers
used for temperatures and fans.
A bit is set for each input crossing a threshold, in both direction,
but the "inside" or "outside" limits info is not available.
Also this register is cleared on read.
Note : this is not explicitly spelled out in the datasheet, but from
experiment.
As a result if an input is crossing a threshold (min or max in any
direction), the alarm is reported only once even if the input is
still outside limits. Also if the alarm for another input is read
before the one of this input, no alarm is reported at all.

Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
Link: https://lore.kernel.org/r/5de0f566.tBga5POKAgHlmd0p%gilles.buloz@kontron.com
Fixes: e46d5130c5a1 ("hwmon: Driver for Nuvoton NCT7802Y")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/nct7802.c