diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2022-11-17 19:40:22 +0100 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-12-04 16:45:03 -0800 |
commit | ef9948dfe1056a89f699edc8eb691a8ed99eda5e (patch) | |
tree | 8fff1ce48602cae55435f488ab2fe531fe2ae87d /drivers/hwmon | |
parent | 1864069c695d475e0ce98a335c62274b81be57b4 (diff) | |
download | linux-stable-ef9948dfe1056a89f699edc8eb691a8ed99eda5e.tar.gz linux-stable-ef9948dfe1056a89f699edc8eb691a8ed99eda5e.tar.bz2 linux-stable-ef9948dfe1056a89f699edc8eb691a8ed99eda5e.zip |
hwmon: (pmbus) Add power good support
Update error flags with regulation out if regulator is on & power
good status bit is set
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
Link: https://lore.kernel.org/r/20221117184022.1808508-1-Naresh.Solanki@9elements.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 7ec04934747e..20ca26e19db7 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -2827,9 +2827,13 @@ static int pmbus_regulator_get_error_flags(struct regulator_dev *rdev, unsigned if (status < 0) return status; - if (pmbus_regulator_is_enabled(rdev) && (status & PB_STATUS_OFF)) - *flags |= REGULATOR_ERROR_FAIL; + if (pmbus_regulator_is_enabled(rdev)) { + if (status & PB_STATUS_OFF) + *flags |= REGULATOR_ERROR_FAIL; + if (status & PB_STATUS_POWER_GOOD_N) + *flags |= REGULATOR_ERROR_REGULATION_OUT; + } /* * Unlike most other status bits, PB_STATUS_{IOUT_OC,VOUT_OV} are * defined strictly as fault indicators (not warnings). |