]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
hwmon: (ftsteutates) Fix scaling of measurements
authorArmin Wolf <W_Armin@gmx.de>
Sat, 24 Dec 2022 04:18:53 +0000 (05:18 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:38 +0000 (16:46 +0100)
commit503a2c1739c3380c8028666cff90b515ee5aa470
treee3f9d9edb1c9c07e774160d1172822e5d4dad79e
parent8e15440afa8727a9438e291a97fc551c7d7d463e
hwmon: (ftsteutates) Fix scaling of measurements

BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit ca8fd8c16a8b77dfcf7f6ce52d2c863220693a78 ]

A user complained that the ftsteutates driver was displaying
bogus values since its introduction. This happens because the
sensor measurements need to be scaled in order to produce
meaningful results:
- the fan speed needs to be multiplied by 60 since its in RPS
- the temperature is in degrees celsius and needs an offset of 64
- the voltage is in 1/256 of 3.3V

The offical datasheet says the voltage needs to be divided by 256,
but this is likely an off-by-one-error, since even the BIOS
devides by 255 (otherwise 3.3V could not be measured).

The voltage channels additionally need a board-specific multiplier,
however this can be done by the driver since its board-specific.

The reason the missing scaling of measurements is the way Fujitsu
used this driver when it was still out-of-tree. Back then, all
scaling was done in userspace by libsensors, even the generic one.

Tested on a Fujitsu DS3401-B1.

Fixes: 08426eda58e0 ("hwmon: Add driver for FTS BMC chip "Teutates"")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20221224041855.83981-2-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Documentation/hwmon/ftsteutates.rst
drivers/hwmon/ftsteutates.c