hwmon: (max31790) Detect and report zero fan speed
authorGuenter Roeck <linux@roeck-us.net>
Wed, 26 May 2021 15:40:21 +0000 (08:40 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 17 Jun 2021 11:21:46 +0000 (04:21 -0700)
commit1814c4e84de2a89d1c2e1e9bbd241240561075a4
treefb83823204e878cafb36d6a7b9f2a8f9c81b5867
parent2013607b85f03ff24a5a19933705905a1b324a31
hwmon: (max31790) Detect and report zero fan speed

If a fan is not running or not connected, of if fan monitoring is disabled,
the fan count register returns a fixed value of 0xffe0. So far this is then
translated to a RPM value larger than 0. Since this is misleading and does
not really make much sense, report a fan RPM of 0 in this situation.

Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
Cc: Václav Kubernát <kubernat@cesnet.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Václav Kubernát <kubernat@cesnet.cz>
Link: https://lore.kernel.org/r/20210526154022.3223012-7-linux@roeck-us.net
drivers/hwmon/max31790.c