提交 ef9948df 编写于 作者: P Patrick Rudolph 提交者: Guenter Roeck

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: NPatrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: NNaresh Solanki <Naresh.Solanki@9elements.com>
Link: https://lore.kernel.org/r/20221117184022.1808508-1-Naresh.Solanki@9elements.comSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 1864069c
...@@ -2827,9 +2827,13 @@ static int pmbus_regulator_get_error_flags(struct regulator_dev *rdev, unsigned ...@@ -2827,9 +2827,13 @@ static int pmbus_regulator_get_error_flags(struct regulator_dev *rdev, unsigned
if (status < 0) if (status < 0)
return status; return status;
if (pmbus_regulator_is_enabled(rdev) && (status & PB_STATUS_OFF)) if (pmbus_regulator_is_enabled(rdev)) {
*flags |= REGULATOR_ERROR_FAIL; 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 * Unlike most other status bits, PB_STATUS_{IOUT_OC,VOUT_OV} are
* defined strictly as fault indicators (not warnings). * defined strictly as fault indicators (not warnings).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册