mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD
@ 2023-07-31  9:22 Naresh Solanki
  2023-07-31  9:54 ` Vadim Pasternak
  2023-07-31 16:11 ` Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Naresh Solanki @ 2023-07-31  9:22 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare
  Cc: vadimp, Patrick Rudolph, Naresh Solanki, linux-hwmon, linux-kernel

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

MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N.
Fix that in the read_word_data hook.
MP2975 might be affected but needs verification.

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

diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c
index 28f33f4618fa..27bb39370662 100644
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
 	int ret;
 
 	switch (reg) {
+	case PMBUS_STATUS_WORD:
+		/* MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. */
+		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: cb7022b8976e3c4d12cea2e7bb820a2944e2fd7b
-- 
2.41.0


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31  9:22 [PATCH v2] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD Naresh Solanki
2023-07-31  9:54 ` Vadim Pasternak
2023-07-31 13:52   ` Guenter Roeck
2023-07-31 16:11 ` 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®