]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (max31790) Fix fan speed reporting for fan7..12
authorGuenter Roeck <linux@roeck-us.net>
Wed, 26 May 2021 15:40:16 +0000 (08:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:21:01 +0000 (16:21 +0200)
commitf1ee56e2938de714065c588889e6052ba1004d74
tree270c3e3ad6d1b8409fd8d3ef78e7043773bdf96f
parente940b27e8efe679ef04ab8ae9e9423377ed6f112
hwmon: (max31790) Fix fan speed reporting for fan7..12

[ Upstream commit cbbf244f0515af3472084f22b6213121b4a63835 ]

Fans 7..12 do not have their own set of configuration registers.
So far the code ignored that and read beyond the end of the configuration
register range to get the tachometer period. This resulted in more or less
random fan speed values for those fans.

The datasheet is quite vague when it comes to defining the tachometer
period for fans 7..12. Experiments confirm that the period is the same
for both fans associated with a given set of configuration registers.

Fixes: 54187ff9d766 ("hwmon: (max31790) Convert to use new hwmon registration API")
Fixes: 195a4b4298a7 ("hwmon: Driver for Maxim MAX31790")
Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Cc: Václav Kubernát <kubernat@cesnet.cz>
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210526154022.3223012-2-linux@roeck-us.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/max31790.c