Skip to content

Commit 9e33c1d

Browse files
carl-lee-amdgroeck
authored andcommitted
hwmon: (pmbus/mpq8785) fix VOUT_MODE mismatch during identification
When MPQ8785 reports VOUT_MODE as VID mode, mpq8785_identify() configures the driver for direct mode. The subsequent pmbus_identify_common() check then fails due to a mismatch between the reported mode and the configured mode, causing device initialization to fail. Override the reported VOUT_MODE to direct mode to keep the driver configuration consistent with the reported mode and allow successful device initialization. This does not change how voltages are interpreted, but avoids a false identification failure caused by mismatched mode handling. Fixes: f20b4a9 ("hwmon: Add driver for MPS MPQ8785 Synchronous Step-Down Converter") Signed-off-by: Carl Lee <carl.lee@amd.com> Link: https://lore.kernel.org/r/20260210-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v3-1-84636ccfe76f@amd.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 8bde3e3 commit 9e33c1d

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

drivers/hwmon/pmbus/mpq8785.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ static int mpq8785_identify(struct i2c_client *client,
4747
return 0;
4848
};
4949

50+
static int mpq8785_read_byte_data(struct i2c_client *client, int page, int reg)
51+
{
52+
int ret;
53+
54+
switch (reg) {
55+
case PMBUS_VOUT_MODE:
56+
ret = pmbus_read_byte_data(client, page, reg);
57+
if (ret < 0)
58+
return ret;
59+
60+
if ((ret >> 5) == 1) {
61+
/*
62+
* The MPQ8785 chip reports VOUT_MODE as VID mode, but the driver
63+
* treats VID as direct mode. Without this, identification would fail
64+
* due to mode mismatch.
65+
* This override ensures the reported mode matches the driver
66+
* configuration, allowing successful initialization.
67+
*/
68+
return PB_VOUT_MODE_DIRECT;
69+
}
70+
71+
return ret;
72+
default:
73+
return -ENODATA;
74+
}
75+
}
76+
5077
static int mpm82504_read_word_data(struct i2c_client *client, int page,
5178
int phase, int reg)
5279
{
@@ -129,6 +156,7 @@ static int mpq8785_probe(struct i2c_client *client)
129156
break;
130157
case mpq8785:
131158
info->identify = mpq8785_identify;
159+
info->read_byte_data = mpq8785_read_byte_data;
132160
break;
133161
default:
134162
return -ENODEV;

0 commit comments

Comments
 (0)