mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD
@ 2023-07-28  8:25 Naresh Solanki
  2023-07-28 10:00 ` Guenter Roeck
  0 siblings, 1 reply; 6+ messages in thread
From: Naresh Solanki @ 2023-07-28  8:25 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare, krzysztof.kozlowski+dt
  Cc: linux-hwmon, Patrick Rudolph, Naresh Solanki, linux-kernel

From: Patrick Rudolph <patrick.rudolph@9elements.com>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N.
Fix that in the read_word_data hook.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
---
 drivers/hwmon/pmbus/mp2975.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
index 28f33f4618fa..410b6eae6d02 100644
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
 	int ret;
 
 	switch (reg) {
+	case PMBUS_STATUS_WORD:
+		ret = pmbus_read_word_data(client, page, phase, reg);
+		ret ^= PB_STATUS_POWER_GOOD_N;
+		break;
 	case PMBUS_OT_FAULT_LIMIT:
 		ret = mp2975_read_word_helper(client, page, phase, reg,
 					      GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11
-- 
2.41.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-31  9:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  8:25 [PATCH] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD Naresh Solanki
2023-07-28 10:00 ` Guenter Roeck
2023-07-28 11:28   ` Naresh Solanki
2023-07-28 14:26     ` Guenter Roeck
2023-07-31  9:08       ` Naresh Solanki
2023-07-28 14:33     ` 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®