]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding
authorVáclav Kubernát <kubernat@cesnet.cz>
Thu, 29 Apr 2021 07:53:38 +0000 (09:53 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 10 May 2021 13:27:33 +0000 (06:27 -0700)
commit4280f3014514a33eba79c575afeeff71c97c65f8
tree739a957bb9a52d34c014cca7c1fc8c0581f291de
parentb62b5519ca59d6078a580256c5cc30299bd22d7e
hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding

I didn't properly test the driver for YH-5151E, so it was completely
broken. Firstly, the log/real mapping was incorrect in one case.
Secondly, PMBus specifies that output voltages should be in the linear16
encoding. However, the YH-5151E is non-compliant and uses linear11.
YM-2151E isn't affected by this. Fix this by converting the values
inside the read functions. linear16 gets the exponent from the VOUT_MODE
command. The device doesn't support it, so I have to manually supply the
value for it.

Both supported devices have now been tested to report correct vout
values.

Fixes: 33e16c8a5d12 ("hwmon: Add driver for fsp-3y PSUs and PDUs")
Signed-off-by: Václav Kubernát <kubernat@cesnet.cz>
Link: https://lore.kernel.org/r/20210429075337.110502-1-kubernat@cesnet.cz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/fsp-3y.c