From e8e00c83a268d5b7d2f5bd490c2269c1ede76a07 Mon Sep 17 00:00:00 2001 From: Erik Rosen Date: Wed, 9 Jun 2021 11:32:06 +0200 Subject: 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 [groeck: Initialize ret with -EINVAL in pmbus_init_coefficients()] Signed-off-by: Guenter Roeck --- include/linux/pmbus.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/pmbus.h') diff --git a/include/linux/pmbus.h b/include/linux/pmbus.h index 12c515a27d3a..fa9f08164c36 100644 --- a/include/linux/pmbus.h +++ b/include/linux/pmbus.h @@ -65,6 +65,14 @@ */ #define PMBUS_NO_WRITE_PROTECT BIT(4) +/* + * PMBUS_USE_COEFFICIENTS_CMD + * + * When this flag is set the PMBus core driver will use the COEFFICIENTS + * register to initialize the coefficients for the direct mode format. + */ +#define PMBUS_USE_COEFFICIENTS_CMD BIT(5) + struct pmbus_platform_data { u32 flags; /* Device specific flags */ -- cgit v1.2.1