Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: pmbus: mpq8785: Add support for MPM3695 family

Add support for the Monolithic Power Systems MPM3695 family.
It contains four devices with suffixes: -10, -20, -25 and -100.
The device is PMBus compliant and shares characteristics with the
MPM82504.

MPM3695-25 has different VOLTAGE_SCALE_LOOP register size [11:0]
and therefore needs to have a separate compatible entry.

Tested with device tree based matching (MPM3695-10).

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://lore.kernel.org/r/20250511035701.2607947-6-paweldembicki@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Pawel Dembicki and committed by
Guenter Roeck
8fcefe78 c2729146

+18 -5
+9 -4
Documentation/hwmon/mpq8785.rst
··· 5 5 6 6 Supported chips: 7 7 8 + * MPS MPM3695 family 8 9 * MPS MPM82504 9 10 * MPS MPQ8785 10 11 ··· 15 14 16 15 Description 17 16 ----------- 17 + 18 + The MPM3695 family is a scalable, ultra-thin, fully integrated power module with 19 + a PMBus interface. It offers a complete power solution that achieves up to 20 + 10A (-10 variant), 20A (-25 variant), 25A (-20 variant), 100A (-100 variant) 21 + of output current with excellent load and line regulation across a wide input 22 + voltage range. It operates at high efficiency over a wide load range, and can 23 + be parallled to deliver higher current. Variants -10,-20 and -100 have different 24 + voltage scale configuration register range (10 bits) than -25 version (11 bits). 18 25 19 26 The MPM82504 is a quad 25A, scalable, fully integrated power module with a PMBus 20 27 interface. The device offers a complete power solution that achieves up to 25A ··· 50 41 Fully integrated protection features include over-current protection (OCP), 51 42 over-voltage protection (OVP), under-voltage protection (UVP), and 52 43 over-temperature protection (OTP). 53 - 54 - All supported modules require a minimal number of readily available, standard 55 - external components. The MPM82504 is available in a BGA (15mmx30mmx5.18mm) 56 - package and the MPQ8785 is available in a TLGA (5mmx6mm) package. 57 44 58 45 Device compliant with: 59 46
+9 -1
drivers/hwmon/pmbus/mpq8785.c
··· 12 12 13 13 #define MPM82504_READ_TEMPERATURE_1_SIGN_POS 9 14 14 15 - enum chips { mpm82504, mpq8785 }; 15 + enum chips { mpm3695, mpm3695_25, mpm82504, mpq8785 }; 16 16 17 17 static u16 voltage_scale_loop_max_val[] = { 18 + [mpm3695] = GENMASK(9, 0), 19 + [mpm3695_25] = GENMASK(11, 0), 18 20 [mpm82504] = GENMASK(9, 0), 19 21 [mpq8785] = GENMASK(10, 0), 20 22 }; ··· 83 81 }; 84 82 85 83 static const struct i2c_device_id mpq8785_id[] = { 84 + { "mpm3695", mpm3695 }, 85 + { "mpm3695-25", mpm3695_25 }, 86 86 { "mpm82504", mpm82504 }, 87 87 { "mpq8785", mpq8785 }, 88 88 { }, ··· 92 88 MODULE_DEVICE_TABLE(i2c, mpq8785_id); 93 89 94 90 static const struct of_device_id __maybe_unused mpq8785_of_match[] = { 91 + { .compatible = "mps,mpm3695", .data = (void *)mpm3695 }, 92 + { .compatible = "mps,mpm3695-25", .data = (void *)mpm3695_25 }, 95 93 { .compatible = "mps,mpm82504", .data = (void *)mpm82504 }, 96 94 { .compatible = "mps,mpq8785", .data = (void *)mpq8785 }, 97 95 {} ··· 118 112 chip_id = (kernel_ulong_t)i2c_get_match_data(client); 119 113 120 114 switch (chip_id) { 115 + case mpm3695: 116 + case mpm3695_25: 121 117 case mpm82504: 122 118 info->format[PSC_VOLTAGE_OUT] = direct; 123 119 info->m[PSC_VOLTAGE_OUT] = 8;