* [PATCH v2 0/3] hwmon: pmbus: Add support for MPQ8786
@ 2026-02-05 10:01 Carl Lee via B4 Relay
2026-02-05 10:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support Carl Lee via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Carl Lee via B4 Relay @ 2026-02-05 10:01 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Charles Hsu
Cc: linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen,
colin.huang2
This series includes the devicetree binding update followed by the corresponding
hwmon driver changes. In addition to basic MPQ8786 support, the series
also fixes VOUT reporting by forcing direct mode for VID VOUT on both
MPQ8785 and MPQ8786, as VID mode configuration is equivalent to direct
mode according to the datasheet.
Signed-off-by: Carl Lee <carl.lee@amd.com>
---
Changes in v2:
- Combine DT binding and driver changes into a single series
- Fix VOUT reporting by forcing direct mode for VID VOUT
- Link to v1: https://lore.kernel.org/r/20260203-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v1-1-67b041e2f762@amd.com
---
Carl Lee (3):
dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support
hwmon: pmbus: mpq8785: add support for MPQ8786
hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786
.../bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++-
Documentation/hwmon/mpq8785.rst | 7 ++++++
drivers/hwmon/pmbus/mpq8785.c | 26 +++++++++++++++++++++-
3 files changed, 36 insertions(+), 2 deletions(-)
---
base-commit: 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f
change-id: 20260203-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-f48049e8411e
Best regards,
--
Carl Lee <carl.lee@amd.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 10:01 [PATCH v2 0/3] hwmon: pmbus: Add support for MPQ8786 Carl Lee via B4 Relay @ 2026-02-05 10:01 ` Carl Lee via B4 Relay 2026-02-05 13:46 ` Krzysztof Kozlowski 2026-02-05 10:01 ` [PATCH v2 2/3] hwmon: pmbus: mpq8785: add support for MPQ8786 Carl Lee via B4 Relay 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay 2 siblings, 1 reply; 16+ messages in thread From: Carl Lee via B4 Relay @ 2026-02-05 10:01 UTC (permalink / raw) To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu Cc: linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen, colin.huang2 From: Carl Lee <carl.lee@amd.com> Add device type support for MPQ8786 Signed-off-by: Carl Lee <carl.lee@amd.com> --- Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml index 90970a0433e9..aec7397a29f9 100644 --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml @@ -19,6 +19,7 @@ properties: - mps,mpm3695-25 - mps,mpm82504 - mps,mpq8785 + - mps,mpq8786 reg: maxItems: 1 @@ -52,7 +53,9 @@ allOf: - if: properties: compatible: - const: mps,mpq8785 + enum: + - mps,mpq8785 + - mps,mpq8786 then: properties: mps,vout-fb-divider-ratio-permille: -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 10:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support Carl Lee via B4 Relay @ 2026-02-05 13:46 ` Krzysztof Kozlowski 2026-02-05 16:17 ` Guenter Roeck 0 siblings, 1 reply; 16+ messages in thread From: Krzysztof Kozlowski @ 2026-02-05 13:46 UTC (permalink / raw) To: Carl Lee Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: > Add device type support for MPQ8786 > > Signed-off-by: Carl Lee <carl.lee@amd.com> > --- > Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > index 90970a0433e9..aec7397a29f9 100644 > --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > @@ -19,6 +19,7 @@ properties: > - mps,mpm3695-25 > - mps,mpm82504 > - mps,mpq8785 > + - mps,mpq8786 Your driver code says they are the same, so compatible. Express it with fallback or provide real rationale in commit msg. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 13:46 ` Krzysztof Kozlowski @ 2026-02-05 16:17 ` Guenter Roeck 2026-02-06 5:54 ` Carl Lee ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Guenter Roeck @ 2026-02-05 16:17 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Carl Lee, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 02:46:29PM +0100, Krzysztof Kozlowski wrote: > On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: > > Add device type support for MPQ8786 > > > > Signed-off-by: Carl Lee <carl.lee@amd.com> > > --- > > Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > index 90970a0433e9..aec7397a29f9 100644 > > --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > @@ -19,6 +19,7 @@ properties: > > - mps,mpm3695-25 > > - mps,mpm82504 > > - mps,mpq8785 > > + - mps,mpq8786 > > Your driver code says they are the same, so compatible. Express it with > fallback or provide real rationale in commit msg. > Agreed. The mpq8785 datasheet is public, but the mpq8786 datasheet isn't. That makes it all but impossible to determine if there are indeed no notable differences between the chips. Guenter ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 16:17 ` Guenter Roeck @ 2026-02-06 5:54 ` Carl Lee 2026-02-06 6:41 ` Carl Lee 2026-02-06 6:46 ` Carl Lee 2 siblings, 0 replies; 16+ messages in thread From: Carl Lee @ 2026-02-06 5:54 UTC (permalink / raw) To: Guenter Roeck Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 08:17:07AM -0800, Guenter Roeck wrote: > On Thu, Feb 05, 2026 at 02:46:29PM +0100, Krzysztof Kozlowski wrote: > > On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: > > > Add device type support for MPQ8786 > > > > > > Signed-off-by: Carl Lee <carl.lee@amd.com> > > > --- > > > Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > index 90970a0433e9..aec7397a29f9 100644 > > > --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > @@ -19,6 +19,7 @@ properties: > > > - mps,mpm3695-25 > > > - mps,mpm82504 > > > - mps,mpq8785 > > > + - mps,mpq8786 > > > > Your driver code says they are the same, so compatible. Express it with > > fallback or provide real rationale in commit msg. > > > > Agreed. The mpq8785 datasheet is public, but the mpq8786 datasheet isn't. > That makes it all but impossible to determine if there are indeed no > notable differences between the chips. > > Guenter Agreed. There is no chip-specific difference in the driver code to justify separate MPQ8786 support. Therefore, we rely on MPQ8785 support. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 16:17 ` Guenter Roeck 2026-02-06 5:54 ` Carl Lee @ 2026-02-06 6:41 ` Carl Lee 2026-02-06 6:46 ` Carl Lee 2 siblings, 0 replies; 16+ messages in thread From: Carl Lee @ 2026-02-06 6:41 UTC (permalink / raw) To: Guenter Roeck Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 08:17:07AM -0800, Guenter Roeck wrote: > On Thu, Feb 05, 2026 at 02:46:29PM +0100, Krzysztof Kozlowski wrote: > > On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: > > > Add device type support for MPQ8786 > > > > > > Signed-off-by: Carl Lee <carl.lee@amd.com> > > > --- > > > Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > index 90970a0433e9..aec7397a29f9 100644 > > > --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > @@ -19,6 +19,7 @@ properties: > > > - mps,mpm3695-25 > > > - mps,mpm82504 > > > - mps,mpq8785 > > > + - mps,mpq8786 > > > > Your driver code says they are the same, so compatible. Express it with > > fallback or provide real rationale in commit msg. > > > > Agreed. The mpq8785 datasheet is public, but the mpq8786 datasheet isn't. > That makes it all but impossible to determine if there are indeed no > notable differences between the chips. > > Guenter Agreed. There is no chip-specific difference in the driver code to justify separate MPQ8786 support. Therefore, Therefore, I will use MPQ8785 for support. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-05 16:17 ` Guenter Roeck 2026-02-06 5:54 ` Carl Lee 2026-02-06 6:41 ` Carl Lee @ 2026-02-06 6:46 ` Carl Lee 2026-02-07 11:07 ` Krzysztof Kozlowski 2 siblings, 1 reply; 16+ messages in thread From: Carl Lee @ 2026-02-06 6:46 UTC (permalink / raw) To: Guenter Roeck Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 08:17:07AM -0800, Guenter Roeck wrote: > On Thu, Feb 05, 2026 at 02:46:29PM +0100, Krzysztof Kozlowski wrote: > > On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: > > > Add device type support for MPQ8786 > > > > > > Signed-off-by: Carl Lee <carl.lee@amd.com> > > > --- > > > Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > index 90970a0433e9..aec7397a29f9 100644 > > > --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml > > > @@ -19,6 +19,7 @@ properties: > > > - mps,mpm3695-25 > > > - mps,mpm82504 > > > - mps,mpq8785 > > > + - mps,mpq8786 > > > > Your driver code says they are the same, so compatible. Express it with > > fallback or provide real rationale in commit msg. > > > > Agreed. The mpq8785 datasheet is public, but the mpq8786 datasheet isn't. > That makes it all but impossible to determine if there are indeed no > notable differences between the chips. > > Guenter There is no chip-specific difference in the driver code to justify separate MPQ8786 support. Therefore, Therefore, I will use MPQ8785 for support. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support 2026-02-06 6:46 ` Carl Lee @ 2026-02-07 11:07 ` Krzysztof Kozlowski 0 siblings, 0 replies; 16+ messages in thread From: Krzysztof Kozlowski @ 2026-02-07 11:07 UTC (permalink / raw) To: Carl Lee, Guenter Roeck Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On 06/02/2026 07:46, Carl Lee wrote: > On Thu, Feb 05, 2026 at 08:17:07AM -0800, Guenter Roeck wrote: >> On Thu, Feb 05, 2026 at 02:46:29PM +0100, Krzysztof Kozlowski wrote: >>> On Thu, Feb 05, 2026 at 06:01:37PM +0800, Carl Lee wrote: >>>> Add device type support for MPQ8786 >>>> >>>> Signed-off-by: Carl Lee <carl.lee@amd.com> >>>> --- >>>> Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml | 5 ++++- >>>> 1 file changed, 4 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml >>>> index 90970a0433e9..aec7397a29f9 100644 >>>> --- a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml >>>> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml >>>> @@ -19,6 +19,7 @@ properties: >>>> - mps,mpm3695-25 >>>> - mps,mpm82504 >>>> - mps,mpq8785 >>>> + - mps,mpq8786 >>> >>> Your driver code says they are the same, so compatible. Express it with >>> fallback or provide real rationale in commit msg. >>> >> >> Agreed. The mpq8785 datasheet is public, but the mpq8786 datasheet isn't. >> That makes it all but impossible to determine if there are indeed no >> notable differences between the chips. >> >> Guenter > > There is no chip-specific difference in the driver code to justify > separate MPQ8786 support. > Therefore, Therefore, I will use MPQ8785 for support. One message is enough. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 2/3] hwmon: pmbus: mpq8785: add support for MPQ8786 2026-02-05 10:01 [PATCH v2 0/3] hwmon: pmbus: Add support for MPQ8786 Carl Lee via B4 Relay 2026-02-05 10:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support Carl Lee via B4 Relay @ 2026-02-05 10:01 ` Carl Lee via B4 Relay 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay 2 siblings, 0 replies; 16+ messages in thread From: Carl Lee via B4 Relay @ 2026-02-05 10:01 UTC (permalink / raw) To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu Cc: linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen, colin.huang2 From: Carl Lee <carl.lee@amd.com> Add support for the Monolithic Power Systems MPQ8786 digital voltage regulator. Signed-off-by: Carl Lee <carl.lee@amd.com> --- Documentation/hwmon/mpq8785.rst | 7 +++++++ drivers/hwmon/pmbus/mpq8785.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/hwmon/mpq8785.rst b/Documentation/hwmon/mpq8785.rst index 198d5dfd7c30..39306033990f 100644 --- a/Documentation/hwmon/mpq8785.rst +++ b/Documentation/hwmon/mpq8785.rst @@ -8,6 +8,7 @@ Supported chips: * MPS MPM3695 family * MPS MPM82504 * MPS MPQ8785 + * MPS MPQ8786 Prefix: 'mpq8785' @@ -38,6 +39,12 @@ buck converter. The MPQ8785 offers a very compact solution that achieves up to wide input supply range. The MPQ8785 operates at high efficiency over a wide output current load range. +The MPQ8786 is a fully integrated, PMBus-compatible, high-frequency, synchronous +buck converter. The device shares the same PMBus interface and register behavior +as the MPQ8785, but provides a lower output current capability of up to 25A per +phase. It offers excellent load and line regulation over a wide input supply +range and operates at high efficiency over a wide output current load range. + The PMBus interface provides converter configurations and key parameters monitoring. diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c index 1f56aaf4dde8..f35534836cb8 100644 --- a/drivers/hwmon/pmbus/mpq8785.c +++ b/drivers/hwmon/pmbus/mpq8785.c @@ -12,13 +12,14 @@ #define MPM82504_READ_TEMPERATURE_1_SIGN_POS 9 -enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785 }; +enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785, mpq8786 }; static u16 voltage_scale_loop_max_val[] = { [mpm3695] = GENMASK(9, 0), [mpm3695_25] = GENMASK(11, 0), [mpm82504] = GENMASK(9, 0), [mpq8785] = GENMASK(10, 0), + [mpq8786] = GENMASK(10, 0), }; static int mpq8785_identify(struct i2c_client *client, @@ -87,6 +88,7 @@ static const struct i2c_device_id mpq8785_id[] = { { "mpm3695-25", mpm3695_25 }, { "mpm82504", mpm82504 }, { "mpq8785", mpq8785 }, + { "mpq8786", mpq8786 }, { }, }; MODULE_DEVICE_TABLE(i2c, mpq8785_id); @@ -96,6 +98,7 @@ static const struct of_device_id __maybe_unused mpq8785_of_match[] = { { .compatible = "mps,mpm3695-25", .data = (void *)mpm3695_25 }, { .compatible = "mps,mpm82504", .data = (void *)mpm82504 }, { .compatible = "mps,mpq8785", .data = (void *)mpq8785 }, + { .compatible = "mps,mpq8786", .data = (void *)mpq8786 }, {} }; MODULE_DEVICE_TABLE(of, mpq8785_of_match); @@ -128,6 +131,7 @@ static int mpq8785_probe(struct i2c_client *client) info->read_word_data = mpm82504_read_word_data; break; case mpq8785: + case mpq8786: info->identify = mpq8785_identify; break; default: -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 10:01 [PATCH v2 0/3] hwmon: pmbus: Add support for MPQ8786 Carl Lee via B4 Relay 2026-02-05 10:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support Carl Lee via B4 Relay 2026-02-05 10:01 ` [PATCH v2 2/3] hwmon: pmbus: mpq8785: add support for MPQ8786 Carl Lee via B4 Relay @ 2026-02-05 10:01 ` Carl Lee via B4 Relay 2026-02-05 16:58 ` Guenter Roeck ` (3 more replies) 2 siblings, 4 replies; 16+ messages in thread From: Carl Lee via B4 Relay @ 2026-02-05 10:01 UTC (permalink / raw) To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu Cc: linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen, colin.huang2 From: Carl Lee <carl.lee@amd.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@amd.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 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay @ 2026-02-05 16:58 ` Guenter Roeck [not found] ` <aYl+pTlG9rEuE59h@carl-amd> 2026-02-05 17:46 ` Guenter Roeck ` (2 subsequent siblings) 3 siblings, 1 reply; 16+ messages in thread From: Guenter Roeck @ 2026-02-05 16:58 UTC (permalink / raw) To: carl.lee Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 06:01:39PM +0800, Carl Lee via B4 Relay wrote: > From: Carl Lee <carl.lee@amd.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. > Why "must" ? Yes, the LSB is the same, at least for MPQ8785, but that doesn't mean that the mode _must_ be overwritten. Maybe I am missing it, but as far as I can see the datasheet doesn't say that the VID mode configuration is the same as direct mode configuration. It says that the _LSB_ is the same for both modes. I _think_ the problem may be that the output voltages are not really reported as VID values but as raw voltages, but the datasheet is a bit vague in that regard. It talks about LSB values but doesn't exactly say how voltages are reported, and for READ_VIN it is most definitely wrong ("This bit is in VID mode with 25mv/LSB" doesn't make any sense). Thanks, Guenter > Signed-off-by: Carl Lee <carl.lee@amd.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 > > ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <aYl+pTlG9rEuE59h@carl-amd>]
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 [not found] ` <aYl+pTlG9rEuE59h@carl-amd> @ 2026-02-09 15:44 ` Guenter Roeck 0 siblings, 0 replies; 16+ messages in thread From: Guenter Roeck @ 2026-02-09 15:44 UTC (permalink / raw) To: Carl Lee Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On 2/8/26 22:28, Carl Lee wrote: > On Thu, Feb 05, 2026 at 08:58:37AM -0800, Guenter Roeck wrote: >> On Thu, Feb 05, 2026 at 06:01:39PM +0800, Carl Lee via B4 Relay wrote: >>> From: Carl Lee <carl.lee@amd.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. >>> >> >> Why "must" ? Yes, the LSB is the same, at least for MPQ8785, >> but that doesn't mean that the mode _must_ be overwritten. Maybe >> I am missing it, but as far as I can see the datasheet doesn't >> say that the VID mode configuration is the same as direct mode >> configuration. It says that the _LSB_ is the same for both modes. >> >> I _think_ the problem may be that the output voltages are not really >> reported as VID values but as raw voltages, but the datasheet is a bit >> vague in that regard. It talks about LSB values but doesn't exactly >> say how voltages are reported, and for READ_VIN it is most definitely >> wrong ("This bit is in VID mode with 25mv/LSB" doesn't make any sense). >> >> Thanks, >> Guenter > > Thanks for your feedback. I see your point about “must.” > The datasheet only says the LSB is the same for VID and direct modes; > it doesn’t state that VID mode configuration is identical to direct mode. > > Based on current hardware testing where the chip reports VOUT Mode as VID, > Observations on actual hardware: > > 1.Without forcing the mode: driver fails to initialize. > dmesg | grep -i mpq8785 > mpq8785 58-0046: Failed to identify chip capabilities > Wrong conclusion. That message means that the chip reports to be in VID mode, while the configuration data disagrees. That has nothing to do with how voltages are actually reported by the chip. As it turns out, mpq8785_identify() already translates VID mode to direct mode. Here is the real problem: The identify function knows that VID mode is handled wrongly by the chip, and configures the driver for direct mode. pmbus_identify_common(), however, does not take that into account and bails out if the mode read from the chip does not match the configured mode. That is what needs to be fixed, and until I find a cleaner solution the patch is indeed acceptable. However, the above needs to be explained in a comment and in the patch description. Thanks, Guenter > 2.Forcing direct mode: voltage readings are consistent and as expected. > cat /sys/bus/i2c/devices/58-0046/hwmon/hwmon2/in2_input > 3293 > > This suggests that the issue is related to how the chip reports voltages in VID mode, > rather than a datasheet requirement to overwrite the mode. > I’ll revise the patch and update the wording accordingly. > > Thanks, > Carl > > >>> Signed-off-by: Carl Lee <carl.lee@amd.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 >>> >>> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay 2026-02-05 16:58 ` Guenter Roeck @ 2026-02-05 17:46 ` Guenter Roeck 2026-02-09 6:53 ` Carl Lee 2026-02-07 11:04 ` kernel test robot 2026-02-07 11:15 ` kernel test robot 3 siblings, 1 reply; 16+ messages in thread From: Guenter Roeck @ 2026-02-05 17:46 UTC (permalink / raw) To: carl.lee Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 06:01:39PM +0800, Carl Lee via B4 Relay wrote: > From: Carl Lee <carl.lee@amd.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@amd.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; > +} In addition to my earlier reply, here is AI code review feedback: This switch statement appears to fall through to the default case when the mode is not VID (when (ret >> 5) != 1). If it falls through, it returns -ENODATA. The core function _pmbus_read_byte_data() will then see -ENODATA and call pmbus_read_byte_data() again, resulting in a second I2C transaction for the same register. Also, the `return ret;` at the end of the function is unreachable because the default case returns. Should the PMBUS_VOUT_MODE case return `ret` instead of falling through? Guenter ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 17:46 ` Guenter Roeck @ 2026-02-09 6:53 ` Carl Lee 0 siblings, 0 replies; 16+ messages in thread From: Carl Lee @ 2026-02-09 6:53 UTC (permalink / raw) To: Guenter Roeck Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu, linux-hwmon, devicetree, linux-kernel, peter.shen, colin.huang2 On Thu, Feb 05, 2026 at 09:46:05AM -0800, Guenter Roeck wrote: > On Thu, Feb 05, 2026 at 06:01:39PM +0800, Carl Lee via B4 Relay wrote: > > From: Carl Lee <carl.lee@amd.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@amd.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; > > +} > > In addition to my earlier reply, here is AI code review feedback: > > This switch statement appears to fall through to the default case when the > mode is not VID (when (ret >> 5) != 1). If it falls through, it returns > -ENODATA. The core function _pmbus_read_byte_data() will then see -ENODATA > and call pmbus_read_byte_data() again, resulting in a second I2C transaction > for the same register. > > Also, the `return ret;` at the end of the function is unreachable because > the default case returns. > > Should the PMBUS_VOUT_MODE case return `ret` instead of falling through? > > Guenter Got it, I’ll correct this. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay 2026-02-05 16:58 ` Guenter Roeck 2026-02-05 17:46 ` Guenter Roeck @ 2026-02-07 11:04 ` kernel test robot 2026-02-07 11:15 ` kernel test robot 3 siblings, 0 replies; 16+ messages in thread From: kernel test robot @ 2026-02-07 11:04 UTC (permalink / raw) To: Carl Lee via B4 Relay, Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu Cc: oe-kbuild-all, linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen, colin.huang2 Hi Carl, kernel test robot noticed the following build warnings: [auto build test WARNING on 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f] url: https://github.com/intel-lab-lkp/linux/commits/Carl-Lee-via-B4-Relay/dt-bindings-hwmon-pmbus-mpq8785-add-MPQ8786-support/20260205-180428 base: 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f patch link: https://lore.kernel.org/r/20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-3-3744cd9b2850%40amd.com patch subject: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 config: i386-randconfig-141-20260207 (https://download.01.org/0day-ci/archive/20260207/202602071928.rf2Gjdgd-lkp@intel.com/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) smatch version: v0.5.0-8994-gd50c5a4c reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260207/202602071928.rf2Gjdgd-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202602071928.rf2Gjdgd-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/hwmon/pmbus/mpq8785.c:63:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 63 | default: | ^ drivers/hwmon/pmbus/mpq8785.c:63:2: note: insert '__attribute__((fallthrough));' to silence this warning 63 | default: | ^ | __attribute__((fallthrough)); drivers/hwmon/pmbus/mpq8785.c:63:2: note: insert 'break;' to avoid fall-through 63 | default: | ^ | break; 1 warning generated. vim +63 drivers/hwmon/pmbus/mpq8785.c 50 51 static int mpq8785_read_byte_data(struct i2c_client *client, int page, int reg) 52 { 53 int ret; 54 55 switch (reg) { 56 case PMBUS_VOUT_MODE: 57 ret = pmbus_read_byte_data(client, page, reg); 58 if (ret < 0) 59 return ret; 60 61 if ((ret >> 5) == 1) 62 return PB_VOUT_MODE_DIRECT; > 63 default: 64 return -ENODATA; 65 } 66 67 return ret; 68 } 69 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay ` (2 preceding siblings ...) 2026-02-07 11:04 ` kernel test robot @ 2026-02-07 11:15 ` kernel test robot 3 siblings, 0 replies; 16+ messages in thread From: kernel test robot @ 2026-02-07 11:15 UTC (permalink / raw) To: Carl Lee via B4 Relay, Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Charles Hsu Cc: oe-kbuild-all, linux-hwmon, devicetree, linux-kernel, carl.lee, peter.shen, colin.huang2 Hi Carl, kernel test robot noticed the following build warnings: [auto build test WARNING on 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f] url: https://github.com/intel-lab-lkp/linux/commits/Carl-Lee-via-B4-Relay/dt-bindings-hwmon-pmbus-mpq8785-add-MPQ8786-support/20260205-180428 base: 4c87cdd0328495759f6e9f9f4e1e53ef8032a76f patch link: https://lore.kernel.org/r/20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-3-3744cd9b2850%40amd.com patch subject: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 config: s390-randconfig-001-20260207 (https://download.01.org/0day-ci/archive/20260207/202602071904.asgoYuoc-lkp@intel.com/config) compiler: s390-linux-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260207/202602071904.asgoYuoc-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202602071904.asgoYuoc-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/hwmon/pmbus/mpq8785.c: In function 'mpq8785_read_byte_data': >> drivers/hwmon/pmbus/mpq8785.c:61:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if ((ret >> 5) == 1) ^ drivers/hwmon/pmbus/mpq8785.c:63:2: note: here default: ^~~~~~~ vim +61 drivers/hwmon/pmbus/mpq8785.c 50 51 static int mpq8785_read_byte_data(struct i2c_client *client, int page, int reg) 52 { 53 int ret; 54 55 switch (reg) { 56 case PMBUS_VOUT_MODE: 57 ret = pmbus_read_byte_data(client, page, reg); 58 if (ret < 0) 59 return ret; 60 > 61 if ((ret >> 5) == 1) 62 return PB_VOUT_MODE_DIRECT; 63 default: 64 return -ENODATA; 65 } 66 67 return ret; 68 } 69 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-02-09 15:44 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 10:01 [PATCH v2 0/3] hwmon: pmbus: Add support for MPQ8786 Carl Lee via B4 Relay
2026-02-05 10:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: mpq8785: add MPQ8786 support Carl Lee via B4 Relay
2026-02-05 13:46 ` Krzysztof Kozlowski
2026-02-05 16:17 ` Guenter Roeck
2026-02-06 5:54 ` Carl Lee
2026-02-06 6:41 ` Carl Lee
2026-02-06 6:46 ` Carl Lee
2026-02-07 11:07 ` Krzysztof Kozlowski
2026-02-05 10:01 ` [PATCH v2 2/3] hwmon: pmbus: mpq8785: add support for MPQ8786 Carl Lee via B4 Relay
2026-02-05 10:01 ` [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Carl Lee via B4 Relay
2026-02-05 16:58 ` Guenter Roeck
[not found] ` <aYl+pTlG9rEuE59h@carl-amd>
2026-02-09 15:44 ` Guenter Roeck
2026-02-05 17:46 ` Guenter Roeck
2026-02-09 6:53 ` Carl Lee
2026-02-07 11:04 ` kernel test robot
2026-02-07 11:15 ` kernel test robot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox