* [PATCH] pmbus core: Add power good support
@ 2022-11-17 18:40 Naresh Solanki
2022-11-20 13:54 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Naresh Solanki @ 2022-11-17 18:40 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon, Jean Delvare
Cc: Patrick Rudolph, Naresh Solanki, linux-kernel
From: Patrick Rudolph <patrick.rudolph@9elements.com>
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>
---
drivers/hwmon/pmbus/pmbus_core.c | 8 ++++++--
1 file 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).
base-commit: 27fea302952d8c90cafbdbee96bafeca03544401
--
2.37.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pmbus core: Add power good support
2022-11-17 18:40 [PATCH] pmbus core: Add power good support Naresh Solanki
@ 2022-11-20 13:54 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-11-20 13:54 UTC (permalink / raw)
To: Naresh Solanki; +Cc: linux-hwmon, Jean Delvare, Patrick Rudolph, linux-kernel
On Thu, Nov 17, 2022 at 07:40:22PM +0100, Naresh Solanki wrote:
> From: Patrick Rudolph <patrick.rudolph@9elements.com>
>
> 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>
Applied to hwmon-next.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-20 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 18:40 [PATCH] pmbus core: Add power good support Naresh Solanki
2022-11-20 13:54 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®