diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2019-12-12 09:14:34 -0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2020-01-23 13:15:09 -0800 |
| commit | 9e347728c4fe0f0661194243384ac9f61d7a5c73 (patch) | |
| tree | d601b417d40bbec1760081188efbdf08e115e20e /drivers/hwmon/pmbus/pmbus.h | |
| parent | d21ed22ba7b110746315dff56f62d76352ac5437 (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 'drivers/hwmon/pmbus/pmbus.h')
| -rw-r--r-- | drivers/hwmon/pmbus/pmbus.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h index d198af3a92b6..90d6c9e23d5f 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h @@ -22,6 +22,8 @@ enum pmbus_regs { PMBUS_CLEAR_FAULTS = 0x03, PMBUS_PHASE = 0x04, + PMBUS_WRITE_PROTECT = 0x10, + PMBUS_CAPABILITY = 0x19, PMBUS_QUERY = 0x1A, @@ -226,6 +228,15 @@ enum pmbus_regs { #define PB_OPERATION_CONTROL_ON BIT(7) /* + * WRITE_PROTECT + */ +#define PB_WP_ALL BIT(7) /* all but WRITE_PROTECT */ +#define PB_WP_OP BIT(6) /* all but WP, OPERATION, PAGE */ +#define PB_WP_VOUT BIT(5) /* all but WP, OPERATION, PAGE, VOUT, ON_OFF */ + +#define PB_WP_ANY (PB_WP_ALL | PB_WP_OP | PB_WP_VOUT) + +/* * CAPABILITY */ #define PB_CAPABILITY_SMBALERT BIT(4) |
