summaryrefslogtreecommitdiff
path: root/include/linux/pmbus.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2019-12-12 09:14:34 -0800
committerGuenter Roeck <linux@roeck-us.net>2020-01-23 13:15:09 -0800
commit9e347728c4fe0f0661194243384ac9f61d7a5c73 (patch)
treed601b417d40bbec1760081188efbdf08e115e20e /include/linux/pmbus.h
parentd21ed22ba7b110746315dff56f62d76352ac5437 (diff)
hwmon: (pmbus) Detect if chip is write protected
If a chip is write protected, we can not change any limits, and we can not clear status flags. This may be the reason why clearing status flags is reported to not work for some chips. Detect the condition in the pmbus core. If the chip is write protected, set limit attributes as read-only, and set the flag indicating that the status flag should be ignored. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/pmbus.h')
-rw-r--r--include/linux/pmbus.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/pmbus.h b/include/linux/pmbus.h
index 08468fca5ea2..1ea5bae708a1 100644
--- a/include/linux/pmbus.h
+++ b/include/linux/pmbus.h
@@ -8,6 +8,8 @@
#ifndef _PMBUS_H_
#define _PMBUS_H_
+#include <linux/bits.h>
+
/* flags */
/*
@@ -23,7 +25,14 @@
* communication errors for no explicable reason. For such chips, checking
* the status register must be disabled.
*/
-#define PMBUS_SKIP_STATUS_CHECK (1 << 0)
+#define PMBUS_SKIP_STATUS_CHECK BIT(0)
+
+/*
+ * PMBUS_WRITE_PROTECTED
+ * Set if the chip is write protected and write protection is not determined
+ * by the standard WRITE_PROTECT command.
+ */
+#define PMBUS_WRITE_PROTECTED BIT(1)
struct pmbus_platform_data {
u32 flags; /* Device specific flags */