summaryrefslogtreecommitdiff
path: root/include/linux/pmbus.h
diff options
context:
space:
mode:
authorErik Rosen <erik.rosen@metormote.com>2021-05-07 21:40:21 +0200
committerGuenter Roeck <linux@roeck-us.net>2021-06-17 04:21:45 -0700
commit86c908d90fb17273f5f6d15539ad3d7bf134d892 (patch)
tree7d75e5c466f839ba21b83c52f32c397c4d61672e /include/linux/pmbus.h
parent5c1c78e0a0a2f37de0b05851878af8e02eeae02f (diff)
hwmon: (pmbus) Add new flag PMBUS_READ_STATUS_AFTER_FAILED_CHECK
Some PMBus chips end up in an undefined state when trying to read an unsupported register. For such chips, it is necessary to reset the chip pmbus controller to a known state after a failed register check. This can be done by reading a known register. By setting this flag the driver will try to read the STATUS register after each failed register check. This read may fail, but it will put the chip into a known state. Signed-off-by: Erik Rosen <erik.rosen@metormote.com> Link: https://lore.kernel.org/r/20210507194023.61138-2-erik.rosen@metormote.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/pmbus.h')
-rw-r--r--include/linux/pmbus.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pmbus.h b/include/linux/pmbus.h
index 12cbbf305969..edd7c84fef65 100644
--- a/include/linux/pmbus.h
+++ b/include/linux/pmbus.h
@@ -43,6 +43,19 @@
*/
#define PMBUS_NO_CAPABILITY BIT(2)
+/*
+ * PMBUS_READ_STATUS_AFTER_FAILED_CHECK
+ *
+ * Some PMBus chips end up in an undefined state when trying to read an
+ * unsupported register. For such chips, it is necessary to reset the
+ * chip pmbus controller to a known state after a failed register check.
+ * This can be done by reading a known register. By setting this flag the
+ * driver will try to read the STATUS register after each failed
+ * register check. This read may fail, but it will put the chip in a
+ * known state.
+ */
+#define PMBUS_READ_STATUS_AFTER_FAILED_CHECK BIT(3)
+
struct pmbus_platform_data {
u32 flags; /* Device specific flags */