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 <[email protected]>
Signed-off-by: Naresh Solanki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
This commit is contained in:
Patrick Rudolph authored and Guenter Roeck committed 2022-12-04 16:45:03 -08:00
1 parent 1864069c69
commit ef9948dfe1
1 file changed
+6 -2
+6 -2
View File
@@ -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).