]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus) Detect if chip is write protected
authorGuenter Roeck <linux@roeck-us.net>
Thu, 12 Dec 2019 17:14:34 +0000 (09:14 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 23 Jan 2020 21:15:09 +0000 (13:15 -0800)
commit2d5ec289b51f5e058805048c0a0d0fe1f0e2ccaf
treed601b417d40bbec1760081188efbdf08e115e20e
parentc68532efc62b6a23e2bded4658dff3b640e7e142
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>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c
include/linux/pmbus.h