Skip to content

Commit c272914

Browse files
CHKDSK88groeck
authored andcommitted
hwmon: pmbus: mpq8785: Add support for MPM82504
Add support for the Monolithic Power Systems MPM82504 digital voltage regulator. MPM82504 uses PMBus direct format for voltage output. Tested with device tree based matching. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Link: https://lore.kernel.org/r/20250511035701.2607947-5-paweldembicki@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent dc1a4ba commit c272914

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

Documentation/hwmon/mpq8785.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Kernel driver mpq8785
55

66
Supported chips:
77

8+
* MPS MPM82504
89
* MPS MPQ8785
910

1011
Prefix: 'mpq8785'
@@ -14,6 +15,14 @@ Author: Charles Hsu <ythsu0511@gmail.com>
1415
Description
1516
-----------
1617

18+
The MPM82504 is a quad 25A, scalable, fully integrated power module with a PMBus
19+
interface. The device offers a complete power solution that achieves up to 25A
20+
per output channel. The MPM82504 has four output channels that can be paralleled
21+
to provide 50A, 75A, or 100A of output current for flexible configurations.
22+
The device can also operate in parallel with the MPM3695-100 and additional
23+
MPM82504 devices to provide a higher output current. The MPM82504 operates
24+
at high efficiency across a wide load range.
25+
1726
The MPQ8785 is a fully integrated, PMBus-compatible, high-frequency, synchronous
1827
buck converter. The MPQ8785 offers a very compact solution that achieves up to
1928
40A output current per phase, with excellent load and line regulation over a
@@ -23,18 +32,19 @@ output current load range.
2332
The PMBus interface provides converter configurations and key parameters
2433
monitoring.
2534

26-
The MPQ8785 adopts MPS's proprietary multi-phase digital constant-on-time (MCOT)
35+
The devices adopts MPS's proprietary multi-phase digital constant-on-time (MCOT)
2736
control, which provides fast transient response and eases loop stabilization.
28-
The MCOT scheme also allows multiple MPQ8785 devices to be connected in parallel
29-
with excellent current sharing and phase interleaving for high-current
37+
The MCOT scheme also allows multiple devices or channels to be connected in
38+
parallel with excellent current sharing and phase interleaving for high-current
3039
applications.
3140

3241
Fully integrated protection features include over-current protection (OCP),
3342
over-voltage protection (OVP), under-voltage protection (UVP), and
3443
over-temperature protection (OTP).
3544

36-
The MPQ8785 requires a minimal number of readily available, standard external
37-
components, and is available in a TLGA (5mmx6mm) package.
45+
All supported modules require a minimal number of readily available, standard
46+
external components. The MPM82504 is available in a BGA (15mmx30mmx5.18mm)
47+
package and the MPQ8785 is available in a TLGA (5mmx6mm) package.
3848

3949
Device compliant with:
4050

drivers/hwmon/pmbus/mpq8785.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
*/
55

66
#include <linux/i2c.h>
7+
#include <linux/bitops.h>
78
#include <linux/module.h>
89
#include <linux/property.h>
910
#include <linux/of_device.h>
1011
#include "pmbus.h"
1112

12-
enum chips { mpq8785 };
13+
#define MPM82504_READ_TEMPERATURE_1_SIGN_POS 9
14+
15+
enum chips { mpm82504, mpq8785 };
1316

1417
static u16 voltage_scale_loop_max_val[] = {
18+
[mpm82504] = GENMASK(9, 0),
1519
[mpq8785] = GENMASK(10, 0),
1620
};
1721

@@ -41,6 +45,20 @@ static int mpq8785_identify(struct i2c_client *client,
4145
return 0;
4246
};
4347

48+
static int mpm82504_read_word_data(struct i2c_client *client, int page,
49+
int phase, int reg)
50+
{
51+
int ret;
52+
53+
ret = pmbus_read_word_data(client, page, phase, reg);
54+
55+
if (ret < 0 || reg != PMBUS_READ_TEMPERATURE_1)
56+
return ret;
57+
58+
/* Fix PMBUS_READ_TEMPERATURE_1 signedness */
59+
return sign_extend32(ret, MPM82504_READ_TEMPERATURE_1_SIGN_POS) & 0xffff;
60+
}
61+
4462
static struct pmbus_driver_info mpq8785_info = {
4563
.pages = 1,
4664
.format[PSC_VOLTAGE_IN] = direct,
@@ -63,12 +81,14 @@ static struct pmbus_driver_info mpq8785_info = {
6381
};
6482

6583
static const struct i2c_device_id mpq8785_id[] = {
84+
{ "mpm82504", mpm82504 },
6685
{ "mpq8785", mpq8785 },
6786
{ },
6887
};
6988
MODULE_DEVICE_TABLE(i2c, mpq8785_id);
7089

7190
static const struct of_device_id __maybe_unused mpq8785_of_match[] = {
91+
{ .compatible = "mps,mpm82504", .data = (void *)mpm82504 },
7292
{ .compatible = "mps,mpq8785", .data = (void *)mpq8785 },
7393
{}
7494
};
@@ -92,6 +112,13 @@ static int mpq8785_probe(struct i2c_client *client)
92112
chip_id = (kernel_ulong_t)i2c_get_match_data(client);
93113

94114
switch (chip_id) {
115+
case mpm82504:
116+
info->format[PSC_VOLTAGE_OUT] = direct;
117+
info->m[PSC_VOLTAGE_OUT] = 8;
118+
info->b[PSC_VOLTAGE_OUT] = 0;
119+
info->R[PSC_VOLTAGE_OUT] = 2;
120+
info->read_word_data = mpm82504_read_word_data;
121+
break;
95122
case mpq8785:
96123
info->identify = mpq8785_identify;
97124
break;

0 commit comments

Comments
 (0)