diff options
author | Guenter Roeck | 2023-06-02 14:34:47 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-07-19 16:21:27 +0200 |
commit | 1ae94553dcfb603363946e5366e348f8ab735a17 (patch) | |
tree | f67dfcf473125456c7b6ab9a54199c8d8b18ed2b /drivers/hwmon/adt7x10.c | |
parent | 421d35912766ecbf8fb9474bf78ec20bfc292589 (diff) |
hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272
[ Upstream commit b153a0bb4199566abd337119207f82b59a8cd1ca ]
The PMON_CONFIG register on ADM1272 is a 16 bit register. Writing a 8 bit
value into it clears the upper 8 bits of the register, resulting in
unexpected side effects. Fix by writing the 16 bit register value.
Also, it has been reported that temperature readings are sometimes widely
inaccurate, to the point where readings may result in device shutdown due
to errant overtemperature faults. Improve by enabling temperature sampling.
While at it, move the common code for ADM1272 and ADM1278 into a separate
function, and clarify in the error message that an attempt was made to
enable both VOUT and temperature monitoring.
Last but not least, return the error code reported by the underlying I2C
controller and not -ENODEV if updating the PMON_CONFIG register fails.
After all, this does not indicate that the chip is not present, but an
error in the communication with the chip.
Fixes: 4ff0ce227a1e ("hwmon: (pmbus/adm1275) Add support for ADM1272")
Fixes: 9da9c2dc57b2 ("hwmon: (adm1275) enable adm1272 temperature reporting")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230602213447.3557346-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hwmon/adt7x10.c')
0 files changed, 0 insertions, 0 deletions