hwmon: (pmbus) Add support for reading direct mode coefficients
authorErik Rosen <erik.rosen@metormote.com>
Wed, 9 Jun 2021 09:32:06 +0000 (11:32 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 17 Jun 2021 11:21:46 +0000 (04:21 -0700)
commite8e00c83a268d5b7d2f5bd490c2269c1ede76a07
tree77b6dfb7157089a0dd7499a3e15d1ad9e8e5a95d
parentdbc0860f7a3d43604c380822a456d26ef6f70a06
hwmon: (pmbus) Add support for reading direct mode coefficients

Add support for reading and decoding direct format coefficients to
the PMBus core driver. If the new flag PMBUS_USE_COEFFICIENTS_CMD
is set, the driver will use the COEFFICIENTS register together with
the information in the pmbus_sensor_attr structs to initialize
relevant coefficients for the direct mode format.

Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
[groeck: Initialize ret with -EINVAL in pmbus_init_coefficients()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c
include/linux/pmbus.h