[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-3-3744cd9b2850@amd.com>
Date: Thu, 05 Feb 2026 18:01:39 +0800
From: Carl Lee via B4 Relay <devnull+carl.lee.amd.com@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Charles Hsu <ythsu0511@...il.com>
Cc: linux-hwmon@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, carl.lee@....com, peter.shen@....com,
colin.huang2@....com
Subject: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID
VOUT on MPQ8785/MPQ8786
From: Carl Lee <carl.lee@....com>
According to MPQ8785/MPQ8786 datasheet, VID mode configuration is
the same as direct mode configuration. Therefore, when VOUT is
reported in VID mode, it must be forced to use direct format.
Signed-off-by: Carl Lee <carl.lee@....com>
---
drivers/hwmon/pmbus/mpq8785.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c
index f35534836cb8..d6624af076c3 100644
--- a/drivers/hwmon/pmbus/mpq8785.c
+++ b/drivers/hwmon/pmbus/mpq8785.c
@@ -48,6 +48,25 @@ static int mpq8785_identify(struct i2c_client *client,
return 0;
};
+static int mpq8785_read_byte_data(struct i2c_client *client, int page, int reg)
+{
+ int ret;
+
+ switch (reg) {
+ case PMBUS_VOUT_MODE:
+ ret = pmbus_read_byte_data(client, page, reg);
+ if (ret < 0)
+ return ret;
+
+ if ((ret >> 5) == 1)
+ return PB_VOUT_MODE_DIRECT;
+ default:
+ return -ENODATA;
+ }
+
+ return ret;
+}
+
static int mpm82504_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{
@@ -133,6 +152,7 @@ static int mpq8785_probe(struct i2c_client *client)
case mpq8785:
case mpq8786:
info->identify = mpq8785_identify;
+ info->read_byte_data = mpq8785_read_byte_data;
break;
default:
return -ENODEV;
--
2.34.1
Powered by blists - more mailing lists